diff options
Diffstat (limited to 'src/effects/SkDisplacementMapEffect.cpp')
-rw-r--r-- | src/effects/SkDisplacementMapEffect.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp index 15e93c11cd..a1c18c647e 100644 --- a/src/effects/SkDisplacementMapEffect.cpp +++ b/src/effects/SkDisplacementMapEffect.cpp @@ -194,15 +194,15 @@ void SkDisplacementMapEffect::flatten(SkWriteBuffer& buffer) const { bool SkDisplacementMapEffect::onFilterImage(Proxy* proxy, const SkBitmap& src, - const SkMatrix& ctm, + const Context& ctx, SkBitmap* dst, SkIPoint* offset) const { SkBitmap displ = src, color = src; const SkImageFilter* colorInput = getColorInput(); const SkImageFilter* displInput = getDisplacementInput(); SkIPoint colorOffset = SkIPoint::Make(0, 0), displOffset = SkIPoint::Make(0, 0); - if ((colorInput && !colorInput->filterImage(proxy, src, ctm, &color, &colorOffset)) || - (displInput && !displInput->filterImage(proxy, src, ctm, &displ, &displOffset))) { + if ((colorInput && !colorInput->filterImage(proxy, src, ctx, &color, &colorOffset)) || + (displInput && !displInput->filterImage(proxy, src, ctx, &displ, &displOffset))) { return false; } if ((displ.colorType() != kPMColor_SkColorType) || @@ -217,13 +217,13 @@ bool SkDisplacementMapEffect::onFilterImage(Proxy* proxy, SkIRect bounds; color.getBounds(&bounds); bounds.offset(colorOffset); - if (!this->applyCropRect(&bounds, ctm)) { + if (!this->applyCropRect(&bounds, ctx.ctm())) { return false; } SkIRect displBounds; displ.getBounds(&displBounds); displBounds.offset(displOffset); - if (!this->applyCropRect(&displBounds, ctm)) { + if (!this->applyCropRect(&displBounds, ctx.ctm())) { return false; } if (!bounds.intersect(displBounds)) { @@ -236,7 +236,7 @@ bool SkDisplacementMapEffect::onFilterImage(Proxy* proxy, } SkVector scale = SkVector::Make(fScale, fScale); - ctm.mapVectors(&scale, 1); + ctx.ctm().mapVectors(&scale, 1); SkIRect colorBounds = bounds; colorBounds.offset(-colorOffset); @@ -348,11 +348,11 @@ private: typedef GrEffect INHERITED; }; -bool SkDisplacementMapEffect::filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatrix& ctm, +bool SkDisplacementMapEffect::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx, SkBitmap* result, SkIPoint* offset) const { SkBitmap colorBM = src; SkIPoint colorOffset = SkIPoint::Make(0, 0); - if (getColorInput() && !getColorInput()->getInputResultGPU(proxy, src, ctm, &colorBM, + if (getColorInput() && !getColorInput()->getInputResultGPU(proxy, src, ctx, &colorBM, &colorOffset)) { return false; } @@ -360,7 +360,7 @@ bool SkDisplacementMapEffect::filterImageGPU(Proxy* proxy, const SkBitmap& src, SkBitmap displacementBM = src; SkIPoint displacementOffset = SkIPoint::Make(0, 0); if (getDisplacementInput() && - !getDisplacementInput()->getInputResultGPU(proxy, src, ctm, &displacementBM, + !getDisplacementInput()->getInputResultGPU(proxy, src, ctx, &displacementBM, &displacementOffset)) { return false; } @@ -379,17 +379,17 @@ bool SkDisplacementMapEffect::filterImageGPU(Proxy* proxy, const SkBitmap& src, GrContext::AutoRenderTarget art(context, dst->asRenderTarget()); SkVector scale = SkVector::Make(fScale, fScale); - ctm.mapVectors(&scale, 1); + ctx.ctm().mapVectors(&scale, 1); SkIRect bounds; colorBM.getBounds(&bounds); bounds.offset(colorOffset); - if (!this->applyCropRect(&bounds, ctm)) { + if (!this->applyCropRect(&bounds, ctx.ctm())) { return false; } SkIRect displBounds; displacementBM.getBounds(&displBounds); displBounds.offset(displacementOffset); - if (!this->applyCropRect(&displBounds, ctm)) { + if (!this->applyCropRect(&displBounds, ctx.ctm())) { return false; } if (!bounds.intersect(displBounds)) { |