aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/tinybitmap.cpp
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-10 14:44:56 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-10 14:44:56 +0000
commit0a6151d66cc32d91eca037c91e557158cf8a2be2 (patch)
tree7fe96285f9fee5c8804bbbc60dd0395b983511a0 /gm/tinybitmap.cpp
parentb006fe7e2f6178ce076a5e2c76b4540d3d27ca98 (diff)
Revert "Revert "change SkColorTable to be immutable""
This reverts commit b8162cb840f4cb6002ef68d5ac775c6a122c52a9. Fixed was call-sites in benches that used the (now gone) setIsOpaque api. R=scroggo@google.com Review URL: https://codereview.chromium.org/26572006 git-svn-id: http://skia.googlecode.com/svn/trunk@11695 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm/tinybitmap.cpp')
-rw-r--r--gm/tinybitmap.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/gm/tinybitmap.cpp b/gm/tinybitmap.cpp
index 26bf25e665..6cb9eded73 100644
--- a/gm/tinybitmap.cpp
+++ b/gm/tinybitmap.cpp
@@ -14,13 +14,10 @@
namespace skiagm {
static SkBitmap make_bitmap() {
- SkBitmap bm;
-
- SkColorTable* ctable = new SkColorTable(1);
- SkPMColor* c = ctable->lockColors();
- c[0] = SkPackARGB32(0x80, 0x80, 0, 0);
- ctable->unlockColors(true);
+ const SkPMColor c[] = { SkPackARGB32(0x80, 0x80, 0, 0) };
+ SkColorTable* ctable = new SkColorTable(c, SK_ARRAY_COUNT(c));
+ SkBitmap bm;
bm.setConfig(SkBitmap::kIndex8_Config, 1, 1);
bm.allocPixels(ctable);
ctable->unref();