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

Unified Diff: src/core/SkImageFilter.cpp

Issue 153113003: Fix image filter crop offsets for GPU path. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 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 | « no previous file | src/effects/SkBlurImageFilter.cpp » ('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 43e96bbb5ff48362335ab1bb77b3b95dee4f6017..9b7e5e488f5789f4323a6f7e1fd4e5ed94ee4a47 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -148,12 +148,14 @@ bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMa
#if SK_SUPPORT_GPU
SkBitmap input;
SkASSERT(fInputCount == 1);
- if (!SkImageFilterUtils::GetInputResultGPU(this->getInput(0), proxy, src, ctm, &input, offset)) {
+ SkIPoint srcOffset = SkIPoint::Make(0, 0);
+ if (!SkImageFilterUtils::GetInputResultGPU(this->getInput(0), proxy, src, ctm, &input, &srcOffset)) {
bsalomon 2014/02/03 21:31:08 if all the callers now pass a non-NULL value maybe
return false;
}
GrTexture* srcTexture = input.getTexture();
SkIRect bounds;
src.getBounds(&bounds);
+ bounds.offset(srcOffset);
if (!this->applyCropRect(&bounds, ctm)) {
return false;
}
@@ -173,6 +175,9 @@ bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMa
GrContext::AutoRenderTarget art(context, dst.texture()->asRenderTarget());
GrContext::AutoClip acs(context, dstRect);
GrEffectRef* effect;
+ offset->fX = bounds.left();
+ offset->fY = bounds.top();
+ bounds.offset(-srcOffset);
SkMatrix matrix(ctm);
matrix.postTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top()));
this->asNewEffect(&effect, srcTexture, matrix, bounds);
@@ -184,8 +189,6 @@ bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMa
SkAutoTUnref<GrTexture> resultTex(dst.detach());
SkImageFilterUtils::WrapTexture(resultTex, bounds.width(), bounds.height(), result);
- offset->fX += bounds.left();
- offset->fY += bounds.top();
return true;
#else
return false;
« no previous file with comments | « no previous file | src/effects/SkBlurImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698