diff options
author | 2013-01-16 15:16:18 +0000 | |
---|---|---|
committer | 2013-01-16 15:16:18 +0000 | |
commit | 0ac6af49975c54c2debf41e9200af416ecd2d973 (patch) | |
tree | 79ee2038a2b5c994f688f30f9770310555dcc6bf /src/gpu/GrContext.cpp | |
parent | 6f54724c11ab739fa0d6deff1d4b564596fe3970 (diff) |
Wrap GrEffects in GrEffectPtr.
This is the first step towards automatic recycling of scratch resouces in the cache via ref-cnts.
R=robertphillips@google.com
Review URL: https://codereview.appspot.com/7092061
git-svn-id: http://skia.googlecode.com/svn/trunk@7222 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/GrContext.cpp')
-rw-r--r-- | src/gpu/GrContext.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index 9d80ebc548..a8ce05510a 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -200,9 +200,10 @@ void convolve_gaussian(GrDrawTarget* target, GrDrawTarget::AutoStateRestore asr(target, GrDrawTarget::kReset_ASRInit); GrDrawState* drawState = target->drawState(); drawState->setRenderTarget(rt); - SkAutoTUnref<GrConvolutionEffect> conv(SkNEW_ARGS(GrConvolutionEffect, - (texture, direction, radius, - sigma))); + SkAutoTUnref<GrEffectRef> conv(GrConvolutionEffect::Create(texture, + direction, + radius, + sigma)); drawState->stage(0)->setEffect(conv); target->drawSimpleRect(rect, NULL); } @@ -1859,8 +1860,9 @@ GrTexture* GrContext::gaussianBlur(GrTexture* srcTexture, scale_rect(&dstRect, i < scaleFactorX ? 0.5f : 1.0f, i < scaleFactorY ? 0.5f : 1.0f); - paint.colorStage(0)->setEffect(SkNEW_ARGS(GrSingleTextureEffect, - (srcTexture, matrix, true)))->unref(); + paint.colorStage(0)->setEffect(GrSingleTextureEffect::Create(srcTexture, + matrix, + true))->unref(); this->drawRectToRect(paint, dstRect, srcRect); srcRect = dstRect; srcTexture = dstTexture; @@ -1917,8 +1919,9 @@ GrTexture* GrContext::gaussianBlur(GrTexture* srcTexture, // FIXME: This should be mitchell, not bilinear. matrix.setIDiv(srcTexture->width(), srcTexture->height()); this->setRenderTarget(dstTexture->asRenderTarget()); - paint.colorStage(0)->setEffect(SkNEW_ARGS(GrSingleTextureEffect,(srcTexture, - matrix, true)))->unref(); + paint.colorStage(0)->setEffect(GrSingleTextureEffect::Create(srcTexture, + matrix, + true))->unref(); SkRect dstRect(srcRect); scale_rect(&dstRect, (float) scaleFactorX, (float) scaleFactorY); this->drawRectToRect(paint, dstRect, srcRect); |