mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 764752 - Choose optimal 2D format based on off-screen format. r=joe
--HG-- extra : rebase_source : 064638dfa5fa4324aa376f794ebf10bf4d6dd2c3
This commit is contained in:
parent
fc968e2de7
commit
35f20c776f
@ -56,17 +56,6 @@ gfxAndroidPlatform::CreateOffscreenSurface(const gfxIntSize& size,
|
||||
return newSurface.forget();
|
||||
}
|
||||
|
||||
mozilla::gfx::SurfaceFormat
|
||||
gfxAndroidPlatform::Optimal2DFormatForContent(gfxASurface::gfxContentType aContent)
|
||||
{
|
||||
// On Android we always use RGB565 for now.
|
||||
if (aContent == gfxASurface::CONTENT_COLOR) {
|
||||
return mozilla::gfx::FORMAT_R5G6B5;
|
||||
} else {
|
||||
return gfxPlatform::Optimal2DFormatForContent(aContent);
|
||||
}
|
||||
}
|
||||
|
||||
nsresult
|
||||
gfxAndroidPlatform::GetFontList(nsIAtom *aLangGroup,
|
||||
const nsACString& aGenericFamily,
|
||||
|
@ -35,8 +35,6 @@ public:
|
||||
|
||||
virtual bool SupportsAzure(mozilla::gfx::BackendType& aBackend) { aBackend = mozilla::gfx::BACKEND_SKIA; return true; }
|
||||
|
||||
virtual mozilla::gfx::SurfaceFormat Optimal2DFormatForContent(gfxASurface::gfxContentType aContent);
|
||||
|
||||
virtual gfxImageFormat GetOffscreenFormat() { return mOffscreenFormat; }
|
||||
|
||||
mozilla::RefPtr<mozilla::gfx::ScaledFont>
|
||||
|
@ -1441,7 +1441,17 @@ gfxPlatform::Optimal2DFormatForContent(gfxASurface::gfxContentType aContent)
|
||||
{
|
||||
switch (aContent) {
|
||||
case gfxASurface::CONTENT_COLOR:
|
||||
return mozilla::gfx::FORMAT_B8G8R8X8;
|
||||
switch (GetOffscreenFormat()) {
|
||||
case gfxASurface::ImageFormatARGB32:
|
||||
return mozilla::gfx::FORMAT_B8G8R8A8;
|
||||
case gfxASurface::ImageFormatRGB24:
|
||||
return mozilla::gfx::FORMAT_B8G8R8X8;
|
||||
case gfxASurface::ImageFormatRGB16_565:
|
||||
return mozilla::gfx::FORMAT_R5G6B5;
|
||||
default:
|
||||
NS_NOTREACHED("unknown gfxImageFormat for CONTENT_COLOR");
|
||||
return mozilla::gfx::FORMAT_B8G8R8A8;
|
||||
}
|
||||
case gfxASurface::CONTENT_ALPHA:
|
||||
return mozilla::gfx::FORMAT_A8;
|
||||
case gfxASurface::CONTENT_COLOR_ALPHA:
|
||||
|
Loading…
Reference in New Issue
Block a user