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

Unified Diff: gm/bitmapfilters.cpp

Issue 340533002: hide SkBitmap::Config entirely (behind a flag) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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 | « no previous file | gyp/SampleApp.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/bitmapfilters.cpp
diff --git a/gm/bitmapfilters.cpp b/gm/bitmapfilters.cpp
index 37d49c3fea12c71c8c1acec9238c7c290a1dde5e..eaaa11a2c60e9a0560dff73d0b8946d71e73a89d 100644
--- a/gm/bitmapfilters.cpp
+++ b/gm/bitmapfilters.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+
#include "gm.h"
+#include "sk_tool_utils.h"
namespace skiagm {
@@ -46,15 +47,6 @@ static SkScalar draw_set(SkCanvas* c, const SkBitmap& bm, SkScalar x,
return x + draw_bm(c, bm, x, 0, p);
}
-static const char* gConfigNames[] = {
- "unknown config",
- "A8",
- "Index8",
- "565",
- "4444",
- "8888"
-};
-
static SkScalar draw_row(SkCanvas* canvas, const SkBitmap& bm) {
SkAutoCanvasRestore acr(canvas, true);
@@ -63,7 +55,7 @@ static SkScalar draw_row(SkCanvas* canvas, const SkBitmap& bm) {
const int scale = 32;
paint.setAntiAlias(true);
- const char* name = gConfigNames[bm.config()];
+ const char* name = sk_tool_utils::colortype_name(bm.colorType());
canvas->drawText(name, strlen(name), x, SkIntToScalar(bm.height())*scale*5/8,
paint);
canvas->translate(SkIntToScalar(48), 0);
« no previous file with comments | « no previous file | gyp/SampleApp.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698