| Index: include/core/SkColorTable.h
|
| diff --git a/include/core/SkColorTable.h b/include/core/SkColorTable.h
|
| index cfd5110fe0f368a2e5263220e841109efea979d9..20d18d26143530b90db3b3d9ec9a9b56b267a84b 100644
|
| --- a/include/core/SkColorTable.h
|
| +++ b/include/core/SkColorTable.h
|
| @@ -30,43 +30,26 @@ public:
|
| virtual ~SkColorTable();
|
|
|
| /** Returns the number of colors in the table.
|
| - */
|
| + */
|
| int count() const { return fCount; }
|
|
|
| /** Returns the specified color from the table. In the debug build, this asserts that
|
| - the index is in range (0 <= index < count).
|
| - */
|
| + * the index is in range (0 <= index < count).
|
| + */
|
| SkPMColor operator[](int index) const {
|
| SkASSERT(fColors != NULL && (unsigned)index < (unsigned)fCount);
|
| return fColors[index];
|
| }
|
|
|
| - /**
|
| - * Return the array of colors for reading. This must be balanced by a call
|
| - * to unlockColors().
|
| + // TODO: Would making the read() methods const allow us to avoid copies?
|
| +
|
| + /** Return the array of colors for reading.
|
| */
|
| - const SkPMColor* lockColors() {
|
| - SkDEBUGCODE(sk_atomic_inc(&fColorLockCount);)
|
| - return fColors;
|
| - }
|
| + const SkPMColor* readColors() { return fColors; }
|
|
|
| - /**
|
| - * Balancing call to lockColors().
|
| + /** read16BitCache() returns the array of RGB16 colors that mirror the 32bit colors.
|
| */
|
| - void unlockColors();
|
| -
|
| - /** Similar to lockColors(), lock16BitCache() returns the array of
|
| - RGB16 colors that mirror the 32bit colors. However, this function
|
| - will return null if kColorsAreOpaque_Flag is not set.
|
| - Also, unlike lockColors(), the returned array here cannot be modified.
|
| - */
|
| - const uint16_t* lock16BitCache();
|
| - /** Balancing call to lock16BitCache().
|
| - */
|
| - void unlock16BitCache() {
|
| - SkASSERT(f16BitCacheLockCount > 0);
|
| - SkDEBUGCODE(sk_atomic_dec(&f16BitCacheLockCount);)
|
| - }
|
| + const uint16_t* read16BitCache();
|
|
|
| explicit SkColorTable(SkReadBuffer&);
|
| void writeToBuffer(SkWriteBuffer&) const;
|
| @@ -75,13 +58,9 @@ private:
|
| SkPMColor* fColors;
|
| uint16_t* f16BitCache;
|
| int fCount;
|
| - SkDEBUGCODE(int fColorLockCount;)
|
| - SkDEBUGCODE(int f16BitCacheLockCount;)
|
|
|
| void init(const SkPMColor* colors, int count);
|
|
|
| - void inval16BitCache();
|
| -
|
| typedef SkRefCnt INHERITED;
|
| };
|
|
|
|
|