Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Unified Diff: src/utils/mac/SkCreateCGImageRef.cpp

Issue 168843002: use SkColorType instead of SkBitmap::Config in views/effects (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/utils/SkCanvasStateUtils.cpp ('k') | src/views/SkWidgets.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/mac/SkCreateCGImageRef.cpp
diff --git a/src/utils/mac/SkCreateCGImageRef.cpp b/src/utils/mac/SkCreateCGImageRef.cpp
index 1b52ba31a695300f63933426d8f0187e40a9c8b6..01f2dacdda44116fb8480e41696120ce56e9a96f 100644
--- a/src/utils/mac/SkCreateCGImageRef.cpp
+++ b/src/utils/mac/SkCreateCGImageRef.cpp
@@ -22,13 +22,19 @@ static bool getBitmapInfo(const SkBitmap& bm,
*upscaleTo32 = false;
}
- switch (bm.config()) {
- case SkBitmap::kRGB_565_Config:
+ switch (bm.colorType()) {
+ case kRGB_565_SkColorType:
+#if 0
+ // doesn't see quite right. Are they thinking 1555?
+ *bitsPerComponent = 5;
+ *info = kCGBitmapByteOrder16Little | kCGImageAlphaNone;
+ break;
+#endif
if (upscaleTo32) {
*upscaleTo32 = true;
}
// fall through
- case SkBitmap::kARGB_8888_Config:
+ case kPMColor_SkColorType:
*bitsPerComponent = 8;
#if SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
*info = kCGBitmapByteOrder32Big;
@@ -60,14 +66,7 @@ This will probably not work.
}
#endif
break;
-#if 0
- case SkBitmap::kRGB_565_Config:
- // doesn't see quite right. Are they thinking 1555?
- *bitsPerComponent = 5;
- *info = kCGBitmapByteOrder16Little | kCGImageAlphaNone;
- break;
-#endif
- case SkBitmap::kARGB_4444_Config:
+ case kARGB_4444_SkColorType:
*bitsPerComponent = 4;
*info = kCGBitmapByteOrder16Little;
if (bm.isOpaque()) {
« no previous file with comments | « src/utils/SkCanvasStateUtils.cpp ('k') | src/views/SkWidgets.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698