Bugzilla Bug 78690 Remove the old imagelib.
The removal left some builds likely broken xlib by Tomi.Leppikangas@oulu.fi qt by jcgriggs@sympatico.ca photon by timeless@mac.com based on tomi's patch for xlib git-svn-id: svn://10.0.0.236/trunk@100912 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -51,10 +51,6 @@ nsDeviceContextPh :: nsDeviceContextPh( ) {
|
||||
mPixelsToTwips = 1.0;
|
||||
mDepth = 0 ;
|
||||
mSurface = NULL;
|
||||
mPaletteInfo.isPaletteDevice = PR_FALSE;
|
||||
mPaletteInfo.sizePalette = 0;
|
||||
mPaletteInfo.numReserved = 0;
|
||||
mPaletteInfo.palette = NULL;
|
||||
mPixelScale = 1.0f;
|
||||
mWidthFloat = 0.0f;
|
||||
mHeightFloat = 0.0f;
|
||||
@@ -75,8 +71,6 @@ nsDeviceContextPh :: ~nsDeviceContextPh( ) {
|
||||
NS_IF_RELEASE(surf); //this clears the surf pointer...
|
||||
mSurface = nsnull;
|
||||
|
||||
if( NULL != mPaletteInfo.palette ) PR_Free( mPaletteInfo.palette );
|
||||
|
||||
if( mFontLoadCache ) {
|
||||
delete mFontLoadCache;
|
||||
mFontLoadCache = nsnull;
|
||||
@@ -212,25 +206,6 @@ void nsDeviceContextPh :: CommonInit( nsNativeDeviceContext aDC ) {
|
||||
mWidthFloat = (float) aWidth;
|
||||
mHeightFloat = (float) aHeight;
|
||||
|
||||
if( mDepth > 8 ) {
|
||||
mPaletteInfo.isPaletteDevice = PR_FALSE;
|
||||
mPaletteInfo.sizePalette = 0;
|
||||
mPaletteInfo.numReserved = 0;
|
||||
mPaletteInfo.palette = NULL;
|
||||
}
|
||||
else {
|
||||
PgColor_t color[_Pg_MAX_PALETTE];
|
||||
|
||||
PgGetPalette(color);
|
||||
// palette based
|
||||
mPaletteInfo.isPaletteDevice = PR_TRUE;
|
||||
mPaletteInfo.sizePalette = _Pg_MAX_PALETTE;
|
||||
mPaletteInfo.numReserved = 16; /* GUESS */
|
||||
mPaletteInfo.palette = PR_Malloc(_Pg_MAX_PALETTE * sizeof(PgColor_t));
|
||||
memcpy(mPaletteInfo.palette, color, _Pg_MAX_PALETTE * sizeof(PgColor_t));
|
||||
}
|
||||
|
||||
|
||||
/* Revisit: the scroll bar sizes is a gross guess based on Phab */
|
||||
mScrollbarHeight = 17;
|
||||
mScrollbarWidth = 17;
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include "nsDeviceContextSpecFactoryP.h"
|
||||
#include "nsScreenManagerPh.h"
|
||||
#include "nsScriptableRegion.h"
|
||||
#include "nsIImageManager.h"
|
||||
#include "nsDeviceContextPh.h"
|
||||
#include "nsPrintOptionsPh.h"
|
||||
#include "nsFontList.h"
|
||||
@@ -93,26 +92,6 @@ static nsresult nsScriptableRegionConstructor(nsISupports *aOuter, REFNSIID aIID
|
||||
return rv;
|
||||
}
|
||||
|
||||
static nsresult nsImageManagerConstructor(nsISupports *aOuter, REFNSIID aIID, void **aResult)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
if ( NULL == aResult )
|
||||
{
|
||||
rv = NS_ERROR_NULL_POINTER;
|
||||
return rv;
|
||||
}
|
||||
*aResult = NULL;
|
||||
if (NULL != aOuter)
|
||||
{
|
||||
rv = NS_ERROR_NO_AGGREGATION;
|
||||
return rv;
|
||||
}
|
||||
// this will return an image manager with a count of 1
|
||||
rv = NS_NewImageManager((nsIImageManager **)aResult);
|
||||
return rv;
|
||||
}
|
||||
|
||||
static nsModuleComponentInfo components[] =
|
||||
{
|
||||
{ "Ph Font Metrics",
|
||||
@@ -158,11 +137,6 @@ static nsModuleComponentInfo components[] =
|
||||
"@mozilla.org/gfx/devicecontextspecfactory;1",
|
||||
//"@mozilla.org/gfx/device_context_spec_factory/Ph;1",
|
||||
nsDeviceContextSpecFactoryPhConstructor },
|
||||
{ "Image Manager",
|
||||
NS_IMAGEMANAGER_CID,
|
||||
"@mozilla.org/gfx/imagemanager;1",
|
||||
//"@mozilla.org/gfx/image_manager;1",
|
||||
nsImageManagerConstructor },
|
||||
{ "Print Options",
|
||||
NS_PRINTOPTIONS_CID,
|
||||
// "@mozilla.org/gfx/printoptions;1",
|
||||
|
||||
@@ -1097,6 +1097,9 @@ NS_IMETHODIMP nsRenderingContextPh::DrawTile( nsIImage *aImage, nscoord aSrcXOff
|
||||
|
||||
if( tileRect.width > 0 && tileRect.height > 0 )
|
||||
((nsImagePh*)aImage)->DrawTile(*this, mSurface, srcRect.width, srcRect.height, tileRect);
|
||||
else
|
||||
NS_ASSERTION(aTileRect.width > 0 && aTileRect.height > 0,
|
||||
"You can't draw an image with a 0 width or height!");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ include $(DEPTH)/config/autoconf.mk
|
||||
MODULE = layout
|
||||
LIBRARY_NAME = gfx_qt
|
||||
EXPORT_LIBRARY = 1
|
||||
REQUIRES = xpcom string widget view gfx2 uconv pref img dom util js appshell mozcomps windowwatcher unicharutil
|
||||
REQUIRES = xpcom string widget view gfx2 uconv pref dom util js appshell mozcomps windowwatcher unicharutil
|
||||
IS_COMPONENT = 1
|
||||
MODULE_NAME = nsGfxQTModule
|
||||
|
||||
|
||||
@@ -62,10 +62,6 @@ nsDeviceContextQT::nsDeviceContextQT()
|
||||
mTwipsToPixels = 1.0;
|
||||
mPixelsToTwips = 1.0;
|
||||
mDepth = 0 ;
|
||||
mPaletteInfo.isPaletteDevice = PR_FALSE;
|
||||
mPaletteInfo.sizePalette = 0;
|
||||
mPaletteInfo.numReserved = 0;
|
||||
mPaletteInfo.palette = NULL;
|
||||
mNumCells = 0;
|
||||
mWidthFloat = 0.0f;
|
||||
mHeightFloat = 0.0f;
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#include "nsDeviceContextSpecFactoryQT.h"
|
||||
#include "nsScreenManagerQT.h"
|
||||
#include "nsScriptableRegion.h"
|
||||
#include "nsIImageManager.h"
|
||||
#include "nsDeviceContextQT.h"
|
||||
#include "nsImageQT.h"
|
||||
#include "nsFontList.h"
|
||||
@@ -86,24 +85,6 @@ static nsresult nsScriptableRegionConstructor(nsISupports *aOuter,REFNSIID aIID,
|
||||
return rv;
|
||||
}
|
||||
|
||||
static nsresult nsImageManagerConstructor(nsISupports *aOuter,REFNSIID aIID,void **aResult)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
if (NULL == aResult) {
|
||||
rv = NS_ERROR_NULL_POINTER;
|
||||
return rv;
|
||||
}
|
||||
*aResult = NULL;
|
||||
if (NULL != aOuter) {
|
||||
rv = NS_ERROR_NO_AGGREGATION;
|
||||
return rv;
|
||||
}
|
||||
// this will return an image manager with a count of 1
|
||||
rv = NS_NewImageManager((nsIImageManager**)aResult);
|
||||
return rv;
|
||||
}
|
||||
|
||||
static nsModuleComponentInfo components[] =
|
||||
{
|
||||
{ "Qt Font Metrics",
|
||||
@@ -142,10 +123,6 @@ static nsModuleComponentInfo components[] =
|
||||
NS_DEVICE_CONTEXT_SPEC_FACTORY_CID,
|
||||
"@mozilla.org/gfx/devicecontextspecfactory;1",
|
||||
nsDeviceContextSpecFactoryQTConstructor },
|
||||
{ "Image Manager",
|
||||
NS_IMAGEMANAGER_CID,
|
||||
"@mozilla.org/gfx/imagemanager;1",
|
||||
nsImageManagerConstructor },
|
||||
{ "Qt Font Enumerator",
|
||||
NS_FONT_ENUMERATOR_CID,
|
||||
"@mozilla.org/gfx/fontenumerator;1",
|
||||
|
||||
@@ -422,6 +422,11 @@ NS_IMETHODIMP nsImageQT::DrawTile(nsIRenderingContext &aContext,
|
||||
{
|
||||
nsDrawingSurfaceQT *drawing = (nsDrawingSurfaceQT*)aSurface;
|
||||
|
||||
if (aTileRect.width <= 0 || aTileRect.height <= 0) {
|
||||
NS_ASSERTION(aTileRect.width > 0 && aTileRect.height > 0,
|
||||
"Error: image has 0 width or height!");
|
||||
return NS_OK;
|
||||
}
|
||||
if (drawing->GetDepth() == 8 || mAlphaDepth == 8) {
|
||||
PRInt32 aY0 = aTileRect.y, aX0 = aTileRect.x;
|
||||
PRInt32 aY1 = aTileRect.y + aTileRect.height;
|
||||
|
||||
@@ -33,7 +33,7 @@ EXPORT_LIBRARY = 1
|
||||
IS_COMPONENT = 1
|
||||
MODULE_NAME = nsGfxXlibModule
|
||||
|
||||
REQUIRES = xpcom string xlibrgb widget dom layout appshell js necko pref img util view uconv locale unicharutil gfx2 mozcomps windowwatcher
|
||||
REQUIRES = xpcom string xlibrgb widget dom layout appshell js necko pref util view uconv locale unicharutil gfx2 mozcomps windowwatcher
|
||||
|
||||
CPPSRCS = \
|
||||
nsDeviceContextSpecFactoryX.cpp \
|
||||
|
||||
@@ -68,10 +68,6 @@ nsDeviceContextXlib::nsDeviceContextXlib()
|
||||
NS_INIT_REFCNT();
|
||||
mTwipsToPixels = 1.0;
|
||||
mPixelsToTwips = 1.0;
|
||||
mPaletteInfo.isPaletteDevice = PR_FALSE;
|
||||
mPaletteInfo.sizePalette = 0;
|
||||
mPaletteInfo.numReserved = 0;
|
||||
mPaletteInfo.palette = NULL;
|
||||
mNumCells = 0;
|
||||
mSurface = nsnull;
|
||||
mDisplay = nsnull;
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include "nsDeviceContextSpecFactoryX.h"
|
||||
#include "nsScreenManagerXlib.h"
|
||||
#include "nsScriptableRegion.h"
|
||||
#include "nsIImageManager.h"
|
||||
#include "nsDeviceContextXlib.h"
|
||||
#include "nsImageXlib.h"
|
||||
#include "nsFontList.h"
|
||||
@@ -97,26 +96,6 @@ static nsresult nsScriptableRegionConstructor(nsISupports *aOuter, REFNSIID aIID
|
||||
return rv;
|
||||
}
|
||||
|
||||
static nsresult nsImageManagerConstructor(nsISupports *aOuter, REFNSIID aIID, void **aResult)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
if ( NULL == aResult )
|
||||
{
|
||||
rv = NS_ERROR_NULL_POINTER;
|
||||
return rv;
|
||||
}
|
||||
*aResult = NULL;
|
||||
if (NULL != aOuter)
|
||||
{
|
||||
rv = NS_ERROR_NO_AGGREGATION;
|
||||
return rv;
|
||||
}
|
||||
// this will return an image manager with a count of 1
|
||||
rv = NS_NewImageManager((nsIImageManager **)aResult);
|
||||
return rv;
|
||||
}
|
||||
|
||||
static nsModuleComponentInfo components[] =
|
||||
{
|
||||
{ "Xlib Font Metrics",
|
||||
@@ -163,11 +142,6 @@ static nsModuleComponentInfo components[] =
|
||||
// "@mozilla.org/gfx/device_context_spec_factory/xlib;1",
|
||||
"@mozilla.org/gfx/devicecontextspecfactory;1",
|
||||
nsDeviceContextSpecFactoryXlibConstructor },
|
||||
{ "Image Manager",
|
||||
NS_IMAGEMANAGER_CID,
|
||||
// "@mozilla.org/gfx/image_manager;1",
|
||||
"@mozilla.org/gfx/imagemanager;1",
|
||||
nsImageManagerConstructor },
|
||||
{ "Print Options",
|
||||
NS_PRINTOPTIONS_CID,
|
||||
// "@mozilla.org/gfx/printoptions;1",
|
||||
|
||||
@@ -1452,6 +1452,12 @@ NS_IMETHODIMP nsImageXlib::DrawTile(nsIRenderingContext &aContext,
|
||||
{
|
||||
if ((mAlphaDepth == 1) && mIsSpacer)
|
||||
return NS_OK;
|
||||
|
||||
if (aTileRect.width <= 0 || aTileRect.height <= 0) {
|
||||
NS_ASSERTION(aTileRect.width > 0 && aTileRect.height > 0,
|
||||
"You can't draw an image with a 0 width or height!");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsDrawingSurfaceXlib *drawing = (nsDrawingSurfaceXlib*)aSurface;
|
||||
if (mDisplay == nsnull)
|
||||
|
||||
Reference in New Issue
Block a user