aboutsummaryrefslogtreecommitdiffstats
path: root/include/core/SkBitmap.h
diff options
context:
space:
mode:
authorMike Reed <reed@google.com>2009-07-08 15:45:45 -0400
committerMike Reed <reed@google.com>2009-07-08 15:45:45 -0400
commite762975133c7c9f529b996b3b1fee8b8910dc650 (patch)
tree8197d6fb8ea0b91ac905630dd3433b703d44ec07 /include/core/SkBitmap.h
parent9c762df18b8a4dae9969cb79eb3b1f53a749f5eb (diff)
downloadexternal_skia-e762975133c7c9f529b996b3b1fee8b8910dc650.zip
external_skia-e762975133c7c9f529b996b3b1fee8b8910dc650.tar.gz
external_skia-e762975133c7c9f529b996b3b1fee8b8910dc650.tar.bz2
respect preferred config when decoding index-based png images
Diffstat (limited to 'include/core/SkBitmap.h')
-rw-r--r--include/core/SkBitmap.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h
index 4c20412..ecf7b2f 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;