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

Unified Diff: include/core/SkColorTable.h

Issue 1351453004: use allocator (if present) when we allocate our cache bitmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fission out test change to separate CL Created 5 years, 3 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 | « no previous file | include/core/SkImageGenerator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkColorTable.h
diff --git a/include/core/SkColorTable.h b/include/core/SkColorTable.h
index cb613befb1756499a48ca882cf5ecee794c2901f..ccea7ed550bf05b64fd05f0cfc38bc077c6ba4e1 100644
--- a/include/core/SkColorTable.h
+++ b/include/core/SkColorTable.h
@@ -67,6 +67,17 @@ private:
void init(const SkPMColor* colors, int count);
+ friend class SkImageGenerator;
+ // Only call if no other thread or cache has seen this table.
+ void dangerous_overwriteColors(const SkPMColor newColors[], int count) {
+ if (count < 0 || count > fCount) {
+ sk_throw();
+ }
+ // assumes that f16BitCache nas NOT been initialized yet, so we don't try to update it
+ memcpy(fColors, newColors, count * sizeof(SkPMColor));
+ fCount = count; // update fCount, in case count is smaller
+ }
+
typedef SkRefCnt INHERITED;
};
« no previous file with comments | « no previous file | include/core/SkImageGenerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698