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

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: 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') | src/core/SkSpecialImage.h » ('J')
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 374a561030254561941ecf21e67d4a65cdfffe80..f7662c6e75fe5353bdafbcc1466ac93cebab0803 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -593,7 +593,16 @@ 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 (src->peekTexture() && !result->peekTexture()) {
Stephen White 2016/03/17 17:10:08 This is also done in filterInputGPU[Deprecated]().
robertphillips 2016/03/17 21:01:47 Right - filterInputGPU[Deprecated] should go away.
+ // Keep the result on the GPU - this is still required for some
+ // image filters that don't support GPU in all cases
Stephen White 2016/03/17 17:10:08 The only one I can think of off the top of my head
robertphillips 2016/03/17 21:01:47 I believe the SkXfermodeImageFilter balks at cropR
Stephen White 2016/03/17 21:30:17 I think you're misunderstanding what canFilterImag
+ GrContext* context = src->peekTexture()->getContext();
+ result.reset(result->makeTextureImage(src->internal_getProxy(), context));
+ }
+
+ return result.release();
}
#if SK_SUPPORT_GPU
« no previous file with comments | « no previous file | src/core/SkSpecialImage.h » ('j') | src/core/SkSpecialImage.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698