зеркало из https://github.com/mozilla/gecko-dev.git
Bug 556487 - gfxASurface GetSize. r=joe a=blocking2.0
--HG-- extra : rebase_source : 3f587a6352af1c72f5dbf860380dc8a2ef42f72d
This commit is contained in:
Родитель
69326a5fb7
Коммит
a75925884a
|
@ -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; }
|
||||
|
|
Загрузка…
Ссылка в новой задаче