aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-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 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;