зеркало из https://github.com/mozilla/pjs.git
Bug 734263 - Set offscreen surface format according to screen format, r=cjones
This commit is contained in:
Родитель
72f9203ea6
Коммит
50a77e5681
|
@ -42,6 +42,8 @@
|
|||
#include "gfxFT2FontList.h"
|
||||
#include "gfxImageSurface.h"
|
||||
#include "nsXULAppAPI.h"
|
||||
#include "nsIScreen.h"
|
||||
#include "nsIScreenManager.h"
|
||||
|
||||
#include "cairo.h"
|
||||
|
||||
|
@ -57,6 +59,15 @@ static FT_Library gPlatformFTLibrary = NULL;
|
|||
gfxAndroidPlatform::gfxAndroidPlatform()
|
||||
{
|
||||
FT_Init_FreeType(&gPlatformFTLibrary);
|
||||
|
||||
nsCOMPtr<nsIScreenManager> screenMgr = do_GetService("@mozilla.org/gfx/screenmanager;1");
|
||||
nsCOMPtr<nsIScreen> screen;
|
||||
screenMgr->GetPrimaryScreen(getter_AddRefs(screen));
|
||||
PRInt32 depth = 24;
|
||||
screen->GetColorDepth(&depth);
|
||||
|
||||
mOffscreenFormat = depth == 16 ? gfxASurface::ImageFormatRGB16_565 :
|
||||
gfxASurface::ImageFormatARGB32;
|
||||
}
|
||||
|
||||
gfxAndroidPlatform::~gfxAndroidPlatform()
|
||||
|
|
|
@ -68,7 +68,7 @@ public:
|
|||
|
||||
virtual bool SupportsAzure(mozilla::gfx::BackendType& aBackend) { aBackend = mozilla::gfx::BACKEND_SKIA; return true; }
|
||||
|
||||
virtual gfxImageFormat GetOffscreenFormat() { return gfxASurface::ImageFormatRGB16_565; }
|
||||
virtual gfxImageFormat GetOffscreenFormat() { return mOffscreenFormat; }
|
||||
|
||||
mozilla::RefPtr<mozilla::gfx::ScaledFont>
|
||||
GetScaledFontForFont(gfxFont *aFont);
|
||||
|
@ -102,6 +102,9 @@ public:
|
|||
virtual bool FontHintingEnabled() MOZ_OVERRIDE;
|
||||
|
||||
FT_Library GetFTLibrary();
|
||||
|
||||
private:
|
||||
gfxImageFormat mOffscreenFormat;
|
||||
};
|
||||
|
||||
#endif /* GFX_PLATFORM_ANDROID_H */
|
||||
|
|
Загрузка…
Ссылка в новой задаче