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

Unified Diff: src/image/SkImage_Base.h

Issue 1491293002: detect when we can filter bitmaps/images directly, w/o a tmp layer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: move include to the top Created 5 years 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 | « src/core/SkDevice.cpp ('k') | src/image/SkImage_Gpu.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage_Base.h
diff --git a/src/image/SkImage_Base.h b/src/image/SkImage_Base.h
index c91430e5bd4ca88b9dfcbb414bb09ec85ea6cb29..5cb6a48132c997746623c58bcba5dcbad565076f 100644
--- a/src/image/SkImage_Base.h
+++ b/src/image/SkImage_Base.h
@@ -55,6 +55,12 @@ public:
virtual bool onIsLazyGenerated() const { return false; }
+ // Return a bitmap suitable for passing to image-filters
+ // For now, that means wrapping textures into SkGrPixelRefs...
+ virtual bool asBitmapForImageFilters(SkBitmap* bitmap) const {
+ return this->getROPixels(bitmap, kAllow_CachingHint);
+ }
+
// Call when this image is part of the key to a resourcecache entry. This allows the cache
// to know automatically those entries can be purged when this SkImage deleted.
void notifyAddedToCache() const {
« no previous file with comments | « src/core/SkDevice.cpp ('k') | src/image/SkImage_Gpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698