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

Unified Diff: src/core/SkImageFilter.cpp

Issue 1813813002: Add SkSpecialImage::makeTextureImage entry point & update filterInput (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix possible nullptr dereference Created 4 years, 9 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 | src/core/SkSpecialImage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkImageFilter.cpp
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index 1a4c876d61c5ed75346e308a495a2cf73af9b609..4ae839c3d441f33a8e6f23b13e346e6f603bfebd 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -596,7 +596,18 @@ SkSpecialImage* SkImageFilter::filterInput(int index,
return SkRef(src);
}
- return input->filterImage(src, this->mapContext(ctx), offset);
+ SkAutoTUnref<SkSpecialImage> result(input->filterImage(src, this->mapContext(ctx), offset));
+
+#if SK_SUPPORT_GPU
+ if (src->peekTexture() && result && !result->peekTexture()) {
+ // Keep the result on the GPU - this is still required for some
+ // image filters that don't support GPU in all cases
+ GrContext* context = src->peekTexture()->getContext();
+ return result->makeTextureImage(src->internal_getProxy(), context).release();
+ }
+#endif
+
+ return result.release();
}
#if SK_SUPPORT_GPU
« no previous file with comments | « no previous file | src/core/SkSpecialImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698