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

Unified Diff: include/core/SkColorTable.h

Issue 1307023004: change colortable to use factory for reinflating, check for empty (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: doh Created 5 years, 4 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 | src/core/SkBitmap.cpp » ('j') | src/core/SkColorTable.cpp » ('J')
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 31891e940182fb98fb0064371fe8ded6bb81c073..c6ca1e961f83f23c5f2b539d1e0279776d02ca1c 100644
--- a/include/core/SkColorTable.h
+++ b/include/core/SkColorTable.h
@@ -49,12 +49,20 @@ public:
*/
const uint16_t* read16BitCache() const;
- explicit SkColorTable(SkReadBuffer&);
void writeToBuffer(SkWriteBuffer&) const;
+ // may return null
+ static SkColorTable* Create(SkReadBuffer&);
+
private:
static void Free16BitCache(uint16_t*);
+ enum AllocatedWithMalloc {
+ kAllocatedWithMalloc
+ };
+ // assumes ownership of colors (assumes it was allocated w/ malloc)
+ SkColorTable(SkPMColor* colors, int count, AllocatedWithMalloc);
+
SkPMColor* fColors;
SkLazyPtr<uint16_t, Free16BitCache> f16BitCache;
int fCount;
« no previous file with comments | « no previous file | src/core/SkBitmap.cpp » ('j') | src/core/SkColorTable.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698