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

Unified Diff: gm/gmmain.cpp

Issue 169913003: replace SkBitmap::Config with SkColorType in gms (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 | « gm/drawbitmaprect.cpp ('k') | gm/shadertext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/gmmain.cpp
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp
index 687ee45a663310c0782969d57029fe562fae915e..d6457abb58eedb81a10544e4dcae34290768e713 100644
--- a/gm/gmmain.cpp
+++ b/gm/gmmain.cpp
@@ -265,16 +265,16 @@ public:
otherwise on compare we may not get a perfect match.
*/
static void force_all_opaque(const SkBitmap& bitmap) {
- SkBitmap::Config config = bitmap.config();
- switch (config) {
- case SkBitmap::kARGB_8888_Config:
+ SkColorType colorType = bitmap.colorType();
+ switch (colorType) {
+ case kPMColor_SkColorType:
force_all_opaque_8888(bitmap);
break;
- case SkBitmap::kRGB_565_Config:
+ case kRGB_565_SkColorType:
// nothing to do here; 565 bitmaps are inherently opaque
break;
default:
- gm_fprintf(stderr, "unsupported bitmap config %d\n", config);
+ gm_fprintf(stderr, "unsupported bitmap colorType %d\n", colorType);
DEBUGFAIL_SEE_STDERR;
}
}
@@ -590,8 +590,7 @@ public:
// the device is as large as the current rendertarget, so
// we explicitly only readback the amount we expect (in
// size) overwrite our previous allocation
- bitmap->setConfig(SkBitmap::kARGB_8888_Config, size.fWidth,
- size.fHeight);
+ bitmap->setConfig(SkImageInfo::MakeN32Premul(size.fWidth, size.fHeight));
canvas->readPixels(bitmap, 0, 0);
}
#endif
@@ -741,8 +740,8 @@ public:
return;
}
- if ((SkBitmap::kARGB_8888_Config != expectedBitmap.config()) ||
- (SkBitmap::kARGB_8888_Config != actualBitmap.config())) {
+ if ((kPMColor_SkColorType != expectedBitmap.colorType()) ||
+ (kPMColor_SkColorType != actualBitmap.colorType())) {
gm_fprintf(stderr, "---- %s: not computing max per-channel"
" pixel mismatch because non-8888\n", testName);
return;
« no previous file with comments | « gm/drawbitmaprect.cpp ('k') | gm/shadertext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698