diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-10-12 14:51:52 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-10-12 14:51:52 +0000 |
commit | 3cbaa2d4da8bc39a99bf3afaaab43cc6dc481723 (patch) | |
tree | 731c948e0400efe0e4f5b561c15903b89d6a1a8d /src/effects | |
parent | 223d81d8821bffa9b0c9fe608737952ac5c68c32 (diff) |
Beef up GrContext::AutoMatrix to handle doing GrPaint matrix adjustments.
R=robertphillips@google.com
Review URL: https://codereview.appspot.com/6656047
git-svn-id: http://skia.googlecode.com/svn/trunk@5918 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects')
-rw-r--r-- | src/effects/SkBlendImageFilter.cpp | 5 | ||||
-rw-r--r-- | src/effects/SkMorphologyImageFilter.cpp | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/effects/SkBlendImageFilter.cpp b/src/effects/SkBlendImageFilter.cpp index a1ad8ec1b4..7933e27999 100644 --- a/src/effects/SkBlendImageFilter.cpp +++ b/src/effects/SkBlendImageFilter.cpp @@ -196,7 +196,10 @@ GrTexture* SkBlendImageFilter::onFilterImageGPU(Proxy* proxy, GrTexture* src, co GrAutoScratchTexture ast(context, desc); GrTexture* dst = ast.detach(); - GrContext::AutoMatrix avm(context, GrMatrix::I()); + + GrContext::AutoMatrix am; + am.setIdentity(context); + GrContext::AutoRenderTarget art(context, dst->asRenderTarget()); GrContext::AutoClip ac(context, rect); diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp index e00d94a754..64d22be56e 100644 --- a/src/effects/SkMorphologyImageFilter.cpp +++ b/src/effects/SkMorphologyImageFilter.cpp @@ -442,14 +442,19 @@ GrTexture* apply_morphology(GrTexture* srcTexture, SkISize radius) { GrContext* context = srcTexture->getContext(); srcTexture->ref(); - GrContext::AutoMatrix avm(context, GrMatrix::I()); + + GrContext::AutoMatrix am; + am.setIdentity(context); + GrContext::AutoClip acs(context, GrRect::MakeWH(SkIntToScalar(srcTexture->width()), SkIntToScalar(srcTexture->height()))); + GrTextureDesc desc; desc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagBit; desc.fWidth = SkScalarCeilToInt(rect.width()); desc.fHeight = SkScalarCeilToInt(rect.height()); desc.fConfig = kRGBA_8888_GrPixelConfig; + if (radius.fWidth > 0) { GrAutoScratchTexture ast(context, desc); GrContext::AutoRenderTarget art(context, ast.texture()->asRenderTarget()); |