Index: samplecode/SampleBlur.cpp |
diff --git a/samplecode/SampleBlur.cpp b/samplecode/SampleBlur.cpp |
index e8e97722872f71186c1fe231868a5687c22db2dd..d951d8508b528961c9444405835294ac6d541123 100644 |
--- a/samplecode/SampleBlur.cpp |
+++ b/samplecode/SampleBlur.cpp |
@@ -15,14 +15,14 @@ |
#include "SkView.h" |
static SkBitmap make_bitmap() { |
- SkBitmap bm; |
- SkColorTable* ctable = new SkColorTable(256); |
- |
- SkPMColor* c = ctable->lockColors(); |
+ SkPMColor c[256]; |
for (int i = 0; i < 256; i++) { |
c[i] = SkPackARGB32(255 - i, 0, 0, 0); |
} |
- ctable->unlockColors(true); |
+ |
+ SkBitmap bm; |
+ SkColorTable* ctable = new SkColorTable(c, 256); |
+ |
bm.setConfig(SkBitmap::kIndex8_Config, 256, 256); |
bm.allocPixels(ctable); |
ctable->unref(); |