diff options
author | reed <reed@google.com> | 2016-08-08 09:00:29 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-08 09:00:29 -0700 |
commit | 9a5a201472c3fb9f02b954ba09ae1ec13ebd50f4 (patch) | |
tree | 33cf2936a48662b59132bc364ef21d67a7416d1a /src | |
parent | b9a10d8c75bfff7bfe9cbb4f74c71ac3494d418b (diff) |
use onPeekBitmap instead of asLegacyBitmap
Since we know we are raster-backed at this point, it is fine, plus it avoids the copy-mutable logic in asLegacyBitmap, which is not needed here (and is slower if our bitmap was built with kNever_SkCopyPixelsMode).
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2223653002
Review-Url: https://codereview.chromium.org/2223653002
Diffstat (limited to 'src')
-rw-r--r-- | src/image/SkImage_Gpu.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp index c795d54fcb..44bb71c088 100644 --- a/src/image/SkImage_Gpu.cpp +++ b/src/image/SkImage_Gpu.cpp @@ -315,12 +315,12 @@ sk_sp<SkImage> SkImage::makeTextureImage(GrContext *context) const { GrImageTextureMaker maker(context, cacher, this, kDisallow_CachingHint); return create_image_from_maker(&maker, at, this->uniqueID()); } - SkBitmap bmp; - if (!this->asLegacyBitmap(&bmp, kRO_LegacyBitmapMode)) { - return nullptr; + + if (const SkBitmap* bmp = as_IB(this)->onPeekBitmap()) { + GrBitmapTextureMaker maker(context, *bmp); + return create_image_from_maker(&maker, at, this->uniqueID()); } - GrBitmapTextureMaker maker(context, bmp); - return create_image_from_maker(&maker, at, this->uniqueID()); + return nullptr; } sk_sp<SkImage> SkImage::makeNonTextureImage() const { |