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

Unified Diff: src/core/SkImageFilter.cpp

Issue 1411013004: Image filters: simplify filterInputGPU(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 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 | « bench/ImageFilterDAGBench.cpp ('k') | no next file » | 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 fef88fdf37286702b0c0b047d2da008e8936e10a..95793025e8a0015cbc1133541156684ba54dd576 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -496,23 +496,19 @@ bool SkImageFilter::filterInputGPU(int index, SkImageFilter::Proxy* proxy,
}
Context ctx(origCtx.ctm(), origCtx.clipBounds(), origCtx.cache(), constraint);
- if (input->canFilterImageGPU()) {
- return input->filterImageGPU(proxy, src, ctx, result, offset);
- } else {
- if (input->filterImage(proxy, src, ctx, result, offset)) {
- if (!result->getTexture()) {
- const SkImageInfo info = result->info();
- if (kUnknown_SkColorType == info.colorType()) {
- return false;
- }
- SkAutoTUnref<GrTexture> resultTex(
- GrRefCachedBitmapTexture(context, *result,GrTextureParams::ClampNoFilter()));
- result->setPixelRef(new SkGrPixelRef(info, resultTex))->unref();
+ if (input->filterImage(proxy, src, ctx, result, offset)) {
+ if (!result->getTexture()) {
+ const SkImageInfo info = result->info();
+ if (kUnknown_SkColorType == info.colorType()) {
+ return false;
}
- return true;
- } else {
- return false;
+ SkAutoTUnref<GrTexture> resultTex(
+ GrRefCachedBitmapTexture(context, *result,GrTextureParams::ClampNoFilter()));
+ result->setPixelRef(new SkGrPixelRef(info, resultTex))->unref();
}
+ return true;
+ } else {
+ return false;
}
}
#endif
« no previous file with comments | « bench/ImageFilterDAGBench.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698