Bug 556487 - gfxASurface GetSize. r=joe a=blocking2.0

--HG--
extra : rebase_source : 3f587a6352af1c72f5dbf860380dc8a2ef42f72d
This commit is contained in:
Oleg Romashin 2010-09-07 17:36:57 -07:00
Родитель 69326a5fb7
Коммит a75925884a
10 изменённых файлов: 36 добавлений и 8 удалений

Просмотреть файл

@ -233,6 +233,8 @@ public:
static PRInt32 BytePerPixelFromFormat(gfxImageFormat format);
virtual const gfxIntSize GetSize() const { return gfxIntSize(-1, -1); }
protected:
gfxASurface() : mSurface(nsnull), mFloatingRefs(0), mBytesRecorded(0), mSurfaceValid(PR_FALSE)
{

Просмотреть файл

@ -77,7 +77,7 @@ public:
// ImageSurface methods
gfxImageFormat Format() const { return mFormat; }
const gfxIntSize& GetSize() const { return mSize; }
virtual const gfxIntSize GetSize() const { return mSize; }
PRInt32 Width() const { return mSize.width; }
PRInt32 Height() const { return mSize.height; }

Просмотреть файл

@ -67,7 +67,7 @@ public:
int Resize(const gfxIntSize& aSize);
HPS GetPS();
gfxIntSize GetSize() { return mSize; }
virtual const gfxIntSize GetSize() const { return mSize; }
private:
HWND mWnd; // non-null if created through the HWND constructor

Просмотреть файл

@ -61,7 +61,10 @@ public:
void GetDPI(double *xDPI, double *yDPI);
// this is in points!
const gfxSize& GetSize() const { return mSize; }
virtual const gfxIntSize GetSize() const
{
return gfxIntSize(mSize.width, mSize.height);
}
virtual PRInt32 GetDefaultContextFlags() const
{

Просмотреть файл

@ -61,7 +61,10 @@ public:
void GetDPI(double *xDPI, double *yDPI);
// this is in points!
const gfxSize& GetSize() const { return mSize; }
virtual const gfxIntSize GetSize() const
{
return gfxIntSize(mSize.width, mSize.height);
}
virtual PRInt32 GetDefaultContextFlags() const
{

Просмотреть файл

@ -54,8 +54,8 @@ public:
nsresult BeginPage();
nsresult EndPage();
gfxSize GetSize() {
gfxSize size(mRect.size.width, mRect.size.height);
virtual const gfxIntSize GetSize() const {
gfxIntSize size(mRect.size.width, mRect.size.height);
return size;
}

Просмотреть файл

@ -65,7 +65,7 @@ public:
return TEXT_QUALITY_OK_OVER_OPAQUE_PIXELS;
}
const gfxSize& GetSize() const { return mSize; }
virtual const gfxIntSize GetSize() const { return gfxIntSize(mSize.width, mSize.height); }
CGContextRef GetCGContext() { return mCGContext; }

Просмотреть файл

@ -419,6 +419,21 @@ gfxUtils::DrawPixelSnapped(gfxContext* aContext,
aContext->SetOperator(op);
}
/* static */ int
gfxUtils::ImageFormatToDepth(gfxASurface::gfxImageFormat aFormat)
{
switch (aFormat) {
case gfxASurface::ImageFormatARGB32:
return 32;
case gfxASurface::ImageFormatRGB24:
return 24;
case gfxASurface::ImageFormatRGB16_565:
return 16;
default:
break;
}
return 0;
}
static void
ClipToRegionInternal(gfxContext* aContext, const nsIntRegion& aRegion,
PRBool aSnap)

Просмотреть файл

@ -94,6 +94,11 @@ public:
* Clip aContext to the region aRegion, snapping the rectangles.
*/
static void ClipToRegionSnapped(gfxContext* aContext, const nsIntRegion& aRegion);
/*
* Convert image format to depth value
*/
static int ImageFormatToDepth(gfxASurface::gfxImageFormat aFormat);
};
#endif

Просмотреть файл

@ -82,7 +82,7 @@ public:
return TEXT_QUALITY_OK_OVER_OPAQUE_PIXELS;
}
const gfxIntSize& GetSize() { return mSize; }
virtual const gfxIntSize GetSize() const { return mSize; }
Display* XDisplay() { return mDisplay; }
Drawable XDrawable() { return mDrawable; }