diff options
author | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-07-08 20:09:23 +0000 |
---|---|---|
committer | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-07-08 20:09:23 +0000 |
commit | 1134426f6b1c4130e8dbe4c38a4aa976fbb18b4b (patch) | |
tree | df7c4a1592d7c9627571211e4c7be5265467b9c7 /include | |
parent | 40443b2371ecc61e04ad496f69919dc1e30036f5 (diff) |
respect preferred config when png is index-based
git-svn-id: http://skia.googlecode.com/svn/trunk@261 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkBitmap.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h index 4c204120dc..ecf7b2f5fb 100644 --- a/include/core/SkBitmap.h +++ b/include/core/SkBitmap.h @@ -613,19 +613,22 @@ public: */ const SkPMColor* colors() const { return fColors; } - /** If a previous bitmap has been locked by this object, unlock its colors - first. If the specified bitmap has a colortable, lock its colors and - return them. - */ - const SkPMColor* lockColors(const SkBitmap& bm) { + /** Locks the table and returns is colors (assuming ctable is not null) and + unlocks the previous table if one was present + */ + const SkPMColor* lockColors(SkColorTable* ctable) { if (fCTable) { fCTable->unlockColors(false); } - fCTable = bm.getColorTable(); - fColors = fCTable ? fCTable->lockColors() : NULL; + fCTable = ctable; + fColors = ctable ? ctable->lockColors() : NULL; return fColors; } + const SkPMColor* lockColors(const SkBitmap& bm) { + return this->lockColors(bm.getColorTable()); + } + private: SkColorTable* fCTable; const SkPMColor* fColors; |