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

Unified Diff: include/core/SkColorTable.h

Issue 1322933005: Port uses of SkLazyPtr to SkOncePtr. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: the rest 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/SkLazyPtr.h » ('j') | include/private/SkOncePtr.h » ('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 c6ca1e961f83f23c5f2b539d1e0279776d02ca1c..343faf82332ef9cc43bd66228457d92cc351dbaa 100644
--- a/include/core/SkColorTable.h
+++ b/include/core/SkColorTable.h
@@ -10,10 +10,10 @@
#ifndef SkColorTable_DEFINED
#define SkColorTable_DEFINED
+#include "../private/SkOncePtr.h"
#include "SkColor.h"
#include "SkFlattenable.h"
#include "SkImageInfo.h"
-#include "SkLazyPtr.h"
/** \class SkColorTable
@@ -55,16 +55,16 @@ public:
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);
+ struct Free16BitCache { void operator()(uint16_t* cache) const; };
herb_g 2015/09/08 20:24:34 Consider inline implementation?
mtklein_C 2015/09/08 20:37:17 Done. If nothing else this is clearer to read.
+
SkPMColor* fColors;
- SkLazyPtr<uint16_t, Free16BitCache> f16BitCache;
+ SkOncePtr<uint16_t, Free16BitCache> f16BitCache;
herb_g 2015/09/08 20:24:34 It will be nice to have uint16_t[] in the future.
mtklein_C 2015/09/08 20:37:17 This will be my next CL.
int fCount;
void init(const SkPMColor* colors, int count);
« no previous file with comments | « no previous file | include/core/SkLazyPtr.h » ('j') | include/private/SkOncePtr.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698