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; |