diff options
author | Cary Clark <caryclark@skia.org> | 2018-02-07 15:51:00 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-02-08 13:34:49 +0000 |
commit | 4f5a79c676757c0f218156077fb0575d46a6583c (patch) | |
tree | 476f8be1a88454c728d6928c4821d71cb82e2de4 /src/image/SkImage_Raster.cpp | |
parent | 4150eea6c49ecec882a8d3e1c61d6a25fcd1e905 (diff) |
remove kRW_LegacyBitmapMode
experiment to see if there are any unknown dependencies
on kRW_LegacyBitmapMode
R=reed@google.com,fmalita@chromium.org,bungeman@google.com
Bug: skia:5615
Change-Id: I2cc578570ac18cd31c3520e1bd801f4a7a669347
Reviewed-on: https://skia-review.googlesource.com/105283
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
Diffstat (limited to 'src/image/SkImage_Raster.cpp')
-rw-r--r-- | src/image/SkImage_Raster.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp index 1e3d6fea16..a92b751140 100644 --- a/src/image/SkImage_Raster.cpp +++ b/src/image/SkImage_Raster.cpp @@ -97,7 +97,7 @@ public: SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); } - bool onAsLegacyBitmap(SkBitmap*, LegacyBitmapMode) const override; + bool onAsLegacyBitmap(SkBitmap*) const override; SkImage_Raster(const SkBitmap& bm, bool bitmapMayBeMutable = false) : INHERITED(bm.width(), bm.height(), @@ -327,20 +327,18 @@ const SkPixelRef* SkBitmapImageGetPixelRef(const SkImage* image) { return ((const SkImage_Raster*)image)->getPixelRef(); } -bool SkImage_Raster::onAsLegacyBitmap(SkBitmap* bitmap, LegacyBitmapMode mode) const { - if (kRO_LegacyBitmapMode == mode) { - // When we're a snapshot from a surface, our bitmap may not be marked immutable - // even though logically always we are, but in that case we can't physically share our - // pixelref since the caller might call setImmutable() themselves - // (thus changing our state). - if (fBitmap.isImmutable()) { - SkIPoint origin = fBitmap.pixelRefOrigin(); - bitmap->setInfo(fBitmap.info(), fBitmap.rowBytes()); - bitmap->setPixelRef(sk_ref_sp(fBitmap.pixelRef()), origin.x(), origin.y()); - return true; - } +bool SkImage_Raster::onAsLegacyBitmap(SkBitmap* bitmap) const { + // When we're a snapshot from a surface, our bitmap may not be marked immutable + // even though logically always we are, but in that case we can't physically share our + // pixelref since the caller might call setImmutable() themselves + // (thus changing our state). + if (fBitmap.isImmutable()) { + SkIPoint origin = fBitmap.pixelRefOrigin(); + bitmap->setInfo(fBitmap.info(), fBitmap.rowBytes()); + bitmap->setPixelRef(sk_ref_sp(fBitmap.pixelRef()), origin.x(), origin.y()); + return true; } - return this->INHERITED::onAsLegacyBitmap(bitmap, mode); + return this->INHERITED::onAsLegacyBitmap(bitmap); } /////////////////////////////////////////////////////////////////////////////// |