mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-26 18:31:29 +00:00
minor code cleanups
This commit is contained in:
parent
0c1a88f45d
commit
4dad708332
@ -33,8 +33,6 @@
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
static NS_DEFINE_IID(kDeviceContextIID, NS_IDEVICE_CONTEXT_IID);
|
||||
|
||||
typedef unsigned char BYTE;
|
||||
|
||||
nsDeviceContextGTK::nsDeviceContextGTK()
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
@ -66,9 +64,6 @@ NS_IMETHODIMP nsDeviceContextGTK::Init(nsNativeWidget aNativeWidget)
|
||||
{
|
||||
GdkVisual *vis;
|
||||
|
||||
for (PRInt32 cnt = 0; cnt < 256; cnt++)
|
||||
mGammaTable[cnt] = cnt;
|
||||
|
||||
mWidget = aNativeWidget;
|
||||
|
||||
// this is used for something odd. who knows
|
||||
|
@ -75,11 +75,3 @@ private:
|
||||
|
||||
#endif /* nsDeviceContextGTK_h___ */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -88,8 +88,16 @@ nsresult nsImageGTK::Init(PRInt32 aWidth, PRInt32 aHeight, PRInt32 aDepth,nsMask
|
||||
ComputMetrics();
|
||||
|
||||
mImageBits = (PRUint8*) new PRUint8[mSizeImage];
|
||||
if (aMaskRequirements == nsMaskRequirements_kNeeds1Bit)
|
||||
{
|
||||
|
||||
switch(aMaskRequirements)
|
||||
{
|
||||
case nsMaskRequirements_kNoMask:
|
||||
mAlphaBits = nsnull;
|
||||
mAlphaWidth = 0;
|
||||
mAlphaHeight = 0;
|
||||
break;
|
||||
|
||||
case nsMaskRequirements_kNeeds1Bit:
|
||||
mAlphaRowBytes = (aWidth + 7) / 8;
|
||||
mAlphaDepth = 1;
|
||||
|
||||
@ -100,14 +108,16 @@ nsresult nsImageGTK::Init(PRInt32 aWidth, PRInt32 aHeight, PRInt32 aDepth,nsMask
|
||||
mAlphaWidth = aWidth;
|
||||
mAlphaHeight = aHeight;
|
||||
mAlphaPixmap = gdk_pixmap_new(nsnull, mWidth, mHeight, 1);
|
||||
break;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
case nsMaskRequirements_kNeeds8Bit:
|
||||
mAlphaBits = nsnull;
|
||||
mAlphaWidth = 0;
|
||||
mAlphaHeight = 0;
|
||||
}
|
||||
g_print("TODO: want an 8bit mask for an image..\n");
|
||||
break;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -125,7 +135,7 @@ void nsImageGTK::ComputMetrics()
|
||||
|
||||
PRInt32 nsImageGTK::CalcBytesSpan(PRUint32 aWidth)
|
||||
{
|
||||
PRInt32 spanbytes;
|
||||
PRInt32 spanbytes;
|
||||
|
||||
spanbytes = (aWidth * mDepth) >> 5;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user