diff options
author | 2014-09-29 12:10:27 -0700 | |
---|---|---|
committer | 2014-09-29 12:10:27 -0700 | |
commit | c5e15a1afab2621e860a251c3fcf5917867ad49f (patch) | |
tree | 52a68d8103a78776d05f5c933b4f715dd7828633 /include/core/SkColorTable.h | |
parent | 4572ae9221a2bef60a2867682b738715a431f3a6 (diff) |
remove alphatype from colortable
the owning bitmap is (already) responsible for knowing the alphatype
BUG=skia:
R=djsollen@google.com
Author: reed@google.com
Review URL: https://codereview.chromium.org/611093002
Diffstat (limited to 'include/core/SkColorTable.h')
-rw-r--r-- | include/core/SkColorTable.h | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/include/core/SkColorTable.h b/include/core/SkColorTable.h index c73b431921..00ef8548f6 100644 --- a/include/core/SkColorTable.h +++ b/include/core/SkColorTable.h @@ -26,16 +26,9 @@ public: /** Makes a deep copy of colors. */ SkColorTable(const SkColorTable& src); - SkColorTable(const SkPMColor colors[], int count, - SkAlphaType alphaType = kPremul_SkAlphaType); + SkColorTable(const SkPMColor colors[], int count); virtual ~SkColorTable(); - SkAlphaType alphaType() const { return (SkAlphaType)fAlphaType; } - - bool isOpaque() const { - return SkAlphaTypeIsOpaque(this->alphaType()); - } - /** Returns the number of colors in the table. */ int count() const { return fCount; } @@ -44,7 +37,7 @@ public: the index is in range (0 <= index < count). */ SkPMColor operator[](int index) const { - SkASSERT(fColors != NULL && (unsigned)index < fCount); + SkASSERT(fColors != NULL && (unsigned)index < (unsigned)fCount); return fColors[index]; } @@ -81,11 +74,12 @@ public: private: SkPMColor* fColors; uint16_t* f16BitCache; - uint16_t fCount; - uint8_t fAlphaType; + int fCount; SkDEBUGCODE(int fColorLockCount;) SkDEBUGCODE(int f16BitCacheLockCount;) + void init(const SkPMColor* colors, int count); + void inval16BitCache(); typedef SkRefCnt INHERITED; |