diff options
Diffstat (limited to 'gm')
-rw-r--r-- | gm/tinybitmap.cpp | 9 |
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(); |