Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(701)

Unified Diff: src/image/SkImage_Gpu.cpp

Issue 2223653002: use onPeekBitmap instead of asLegacyBitmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage_Gpu.cpp
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index c795d54fcbb0aaf68bbd63c7e034cfda8e0f7af4..44bb71c0889ab311977e4929271b8e6506e94c29 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;
+
robertphillips 2016/08/08 14:32:29 How do we know we're not in the SkImage_Generator
reed1 2016/08/08 15:19:30 Generator's have a cacherator (by definition), so
+ 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 {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698