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

Unified Diff: src/core/SkImageFilter.cpp

Issue 1637443003: Image filters: fix srcOffset handling in asFragmentProcessor() path. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT Created 4 years, 11 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 | « gm/imagefiltersgraph.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 141d2e03fbea36eaf89c74dda95aa12b18d25ea6..821edc0e1abbd6af85e2b9f41a6e28a5a27ef4de 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -334,8 +334,6 @@ bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Cont
if (!this->applyCropRect(ctx, proxy, input, &srcOffset, &bounds, &input)) {
return false;
}
- SkRect srcRect = SkRect::Make(bounds);
- SkRect dstRect = SkRect::MakeWH(srcRect.width(), srcRect.height());
GrContext* context = srcTexture->getContext();
GrSurfaceDesc desc;
@@ -349,9 +347,6 @@ bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Cont
return false;
}
- // setup new clip
- GrClip clip(dstRect);
-
GrFragmentProcessor* fp;
offset->fX = bounds.left();
offset->fY = bounds.top();
@@ -366,6 +361,9 @@ bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Cont
SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(dst->asRenderTarget()));
if (drawContext) {
+ SkRect srcRect = SkRect::Make(bounds);
+ SkRect dstRect = SkRect::MakeWH(srcRect.width(), srcRect.height());
+ GrClip clip(dstRect);
drawContext->fillRectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect);
GrWrapTextureInBitmap(dst, bounds.width(), bounds.height(), false, result);
« no previous file with comments | « gm/imagefiltersgraph.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698