Index: src/core/SkColorTable.cpp |
diff --git a/src/core/SkColorTable.cpp b/src/core/SkColorTable.cpp |
index 0d033ec2be9e87cbcc08e7de6209c7889d583b1e..cb9f00cd0edb2ed40c20e975bca7da90bbe527ac 100644 |
--- a/src/core/SkColorTable.cpp |
+++ b/src/core/SkColorTable.cpp |
@@ -19,11 +19,8 @@ void SkColorTable::init(const SkPMColor colors[], int count) { |
f16BitCache = NULL; |
fCount = count; |
fColors = reinterpret_cast<SkPMColor*>(sk_malloc_throw(count * sizeof(SkPMColor))); |
- |
+ |
memcpy(fColors, colors, count * sizeof(SkPMColor)); |
- |
- SkDEBUGCODE(fColorLockCount = 0;) |
- SkDEBUGCODE(f16BitCacheLockCount = 0;) |
} |
// As copy constructor is hidden in the class hierarchy, we need to call |
@@ -43,18 +40,10 @@ SkColorTable::SkColorTable(const SkPMColor colors[], int count) { |
} |
SkColorTable::~SkColorTable() { |
- SkASSERT(fColorLockCount == 0); |
- SkASSERT(f16BitCacheLockCount == 0); |
- |
sk_free(fColors); |
sk_free(f16BitCache); |
} |
-void SkColorTable::unlockColors() { |
- SkASSERT(fColorLockCount != 0); |
- SkDEBUGCODE(sk_atomic_dec(&fColorLockCount);) |
-} |
- |
#include "SkColorPriv.h" |
static inline void build_16bitcache(uint16_t dst[], const SkPMColor src[], |
@@ -64,13 +53,11 @@ static inline void build_16bitcache(uint16_t dst[], const SkPMColor src[], |
} |
} |
-const uint16_t* SkColorTable::lock16BitCache() { |
+const uint16_t* SkColorTable::read16BitCache() { |
if (NULL == f16BitCache) { |
f16BitCache = (uint16_t*)sk_malloc_throw(fCount * sizeof(uint16_t)); |
build_16bitcache(f16BitCache, fColors, fCount); |
} |
- |
- SkDEBUGCODE(sk_atomic_inc(&f16BitCacheLockCount)); |
return f16BitCache; |
} |
@@ -78,9 +65,6 @@ const uint16_t* SkColorTable::lock16BitCache() { |
SkColorTable::SkColorTable(SkReadBuffer& buffer) { |
f16BitCache = NULL; |
- SkDEBUGCODE(fColorLockCount = 0;) |
- SkDEBUGCODE(f16BitCacheLockCount = 0;) |
- |
if (buffer.isVersionLT(SkReadBuffer::kRemoveColorTableAlpha_Version)) { |
/*fAlphaType = */buffer.readUInt(); |
} |