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

Unified Diff: bench/RepeatTileBench.cpp

Issue 26572006: Revert "Revert "change SkColorTable to be immutable"" (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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 | « bench/BitmapBench.cpp ('k') | gm/tinybitmap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/RepeatTileBench.cpp
diff --git a/bench/RepeatTileBench.cpp b/bench/RepeatTileBench.cpp
index c311c4af6cc4780648214ca17cd2a09143938513..c3a6102c729068cde4e178452ece9fdb959cd7b1 100644
--- a/bench/RepeatTileBench.cpp
+++ b/bench/RepeatTileBench.cpp
@@ -53,8 +53,8 @@ static uint8_t compute_666_index(SkPMColor c) {
}
static void convert_to_index666(const SkBitmap& src, SkBitmap* dst) {
- SkColorTable* ctable = new SkColorTable(216);
- SkPMColor* colors = ctable->lockColors();
+ SkPMColor storage[216];
+ SkPMColor* colors = storage;
// rrr ggg bbb
for (int r = 0; r < 6; r++) {
int rr = conv_6_to_byte(r);
@@ -66,7 +66,7 @@ static void convert_to_index666(const SkBitmap& src, SkBitmap* dst) {
}
}
}
- ctable->unlockColors(true);
+ SkColorTable* ctable = new SkColorTable(storage, 216, kOpaque_SkAlphaType);
scroggo 2013/10/09 18:33:42 We discussed in person, but for posterity: This s
dst->setConfig(SkBitmap::kIndex8_Config, src.width(), src.height());
dst->allocPixels(ctable);
ctable->unref();
« no previous file with comments | « bench/BitmapBench.cpp ('k') | gm/tinybitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698