Bug 778184 - Add GetScreenDepth API for Qt gfx platform port. r=me,dougt NPODB

This commit is contained in:
Oleg Romashin 2012-08-01 12:00:24 -07:00
parent d6d42179d1
commit 3e74feb79c
2 changed files with 10 additions and 0 deletions

View File

@ -135,6 +135,7 @@ gfxQtPlatform::gfxQtPlatform()
if (pixmap.depth() == 16) {
sOffscreenFormat = gfxASurface::ImageFormatRGB16_565;
}
mScreenDepth = pixmap.depth();
#if (QT_VERSION < QT_VERSION_CHECK(4,8,0))
if (pixmap.paintEngine())
sDefaultQtPaintEngineType = pixmap.paintEngine()->type();
@ -606,3 +607,9 @@ gfxQtPlatform::GetOffscreenFormat()
return sOffscreenFormat;
}
int
gfxQtPlatform::GetScreenDepth() const
{
return mScreenDepth;
}

View File

@ -112,6 +112,8 @@ public:
static Screen* GetXScreen(QWidget* aWindow = 0);
#endif
virtual int GetScreenDepth() const;
protected:
static gfxFontconfigUtils *sFontconfigUtils;
@ -122,6 +124,7 @@ private:
nsDataHashtable<nsCStringHashKey, nsTArray<nsRefPtr<gfxFontEntry> > > mPrefFonts;
RenderMode mRenderMode;
int mScreenDepth;
};
#endif /* GFX_PLATFORM_QT_H */