Bug 1046921 - Remove usage of legacy Skia API, SK_SUPPORT_LEGACY_BITMAP_CONFIG. r=gw280

This commit is contained in:
Walter Litwinczyk 2014-08-15 10:02:46 -07:00
parent 3fa4499a41
commit 9b66615f0b
3 changed files with 7 additions and 43 deletions

View File

@ -19,41 +19,6 @@
namespace mozilla {
namespace gfx {
static inline SkBitmap::Config
GfxFormatToSkiaConfig(SurfaceFormat format)
{
switch (format)
{
case SurfaceFormat::B8G8R8A8:
return SkBitmap::kARGB_8888_Config;
case SurfaceFormat::B8G8R8X8:
// We probably need to do something here.
return SkBitmap::kARGB_8888_Config;
case SurfaceFormat::R5G6B5:
return SkBitmap::kRGB_565_Config;
case SurfaceFormat::A8:
return SkBitmap::kA8_Config;
default:
return SkBitmap::kARGB_8888_Config;
}
}
static inline SurfaceFormat
SkiaConfigToGfxFormat(SkBitmap::Config config)
{
switch (config)
{
case SkBitmap::kARGB_8888_Config:
return SurfaceFormat::B8G8R8A8;
case SkBitmap::kRGB_565_Config:
return SurfaceFormat::R5G6B5;
case SkBitmap::kA8_Config:
return SurfaceFormat::A8;
default:
return SurfaceFormat::B8G8R8A8;
}
}
static inline SkColorType
GfxFormatToSkiaColorType(SurfaceFormat format)
{

View File

@ -206,7 +206,6 @@
#define SK_SUPPORT_LEGACY_GETDEVICE
#define SK_SUPPORT_LEGACY_GETTOPDEVICE
#define SK_SUPPORT_LEGACY_BITMAP_CONFIG
#define SK_IGNORE_ETC1_SUPPORT
#endif

View File

@ -81,15 +81,15 @@ bool SkANP::SetBitmap(ANPBitmap* dst, const SkBitmap& src) {
return false;
}
switch (src.config()) {
case SkBitmap::kARGB_8888_Config:
switch (src.colorType()) {
case SkColorType::kRGBA_8888_SkColorType:
dst->format = kRGBA_8888_ANPBitmapFormat;
break;
case SkBitmap::kRGB_565_Config:
case SkColorType::kRGB_565_SkColorType:
dst->format = kRGB_565_ANPBitmapFormat;
break;
default:
SkDebugf("SkANP::SetBitmap - unsupported src.config %d\n", src.config());
SkDebugf("SkANP::SetBitmap - unsupported src.colorType %d\n", src.colorType());
return false;
}