Index: samplecode/SampleTinyBitmap.cpp |
diff --git a/samplecode/SampleTinyBitmap.cpp b/samplecode/SampleTinyBitmap.cpp |
index 16cbce4adc7e038c23116f3ef3974734b00bd49e..42866d07adfe6b370e7be9f4430fbfbfb6631dbd 100644 |
--- a/samplecode/SampleTinyBitmap.cpp |
+++ b/samplecode/SampleTinyBitmap.cpp |
@@ -13,15 +13,15 @@ |
#include "SkUtils.h" |
static SkBitmap make_bitmap() { |
- SkBitmap bm; |
const int N = 1; |
- SkColorTable* ctable = new SkColorTable(N); |
- SkPMColor* c = ctable->lockColors(); |
+ SkPMColor c[N]; |
for (int i = 0; i < N; i++) { |
c[i] = SkPackARGB32(0x80, 0x80, 0, 0); |
} |
- ctable->unlockColors(true); |
+ SkColorTable* ctable = new SkColorTable(c, N); |
+ |
+ SkBitmap bm; |
bm.setConfig(SkBitmap::kIndex8_Config, 1, 1); |
bm.allocPixels(ctable); |
ctable->unref(); |
@@ -58,10 +58,13 @@ protected: |
static void setBitmapOpaque(SkBitmap* bm, bool isOpaque) { |
SkAutoLockPixels alp(*bm); // needed for ctable |
bm->setIsOpaque(isOpaque); |
+#if 0 |
+ // TODO - I think we just want to not allow this anymore |
SkColorTable* ctable = bm->getColorTable(); |
if (ctable) { |
ctable->setIsOpaque(isOpaque); |
} |
+#endif |
} |
virtual void onDrawContent(SkCanvas* canvas) { |