diff --git a/gfx/2d/HelpersSkia.h b/gfx/2d/HelpersSkia.h index 779a9e71156..4ff0b302508 100644 --- a/gfx/2d/HelpersSkia.h +++ b/gfx/2d/HelpersSkia.h @@ -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) { diff --git a/gfx/skia/trunk/include/config/SkUserConfig.h b/gfx/skia/trunk/include/config/SkUserConfig.h index 30828404060..acd669d257c 100644 --- a/gfx/skia/trunk/include/config/SkUserConfig.h +++ b/gfx/skia/trunk/include/config/SkUserConfig.h @@ -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 diff --git a/other-licenses/skia-npapi/SkANP.cpp b/other-licenses/skia-npapi/SkANP.cpp index eb540452f81..f3621234f23 100644 --- a/other-licenses/skia-npapi/SkANP.cpp +++ b/other-licenses/skia-npapi/SkANP.cpp @@ -57,7 +57,7 @@ ANPRectF* SkANP::SetRect(ANPRectF* dst, const SkRect& src) { SkBitmap* SkANP::SetBitmap(SkBitmap* dst, const ANPBitmap& src) { SkColorType colorType = kUnknown_SkColorType; - + switch (src.format) { case kRGBA_8888_ANPBitmapFormat: colorType = kRGBA_8888_SkColorType; @@ -68,7 +68,7 @@ SkBitmap* SkANP::SetBitmap(SkBitmap* dst, const ANPBitmap& src) { default: break; } - + SkImageInfo info = SkImageInfo::Make(src.width, src.height, colorType, kPremul_SkAlphaType); dst->setInfo(info, src.rowBytes); dst->setPixels(src.baseAddr); @@ -81,18 +81,18 @@ 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; } - + dst->width = src.width(); dst->height = src.height(); dst->rowBytes = src.rowBytes();