/** 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; }
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];
}
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;