aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrConfigConversionEffect.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-28 14:26:09 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-28 14:26:09 +0000
commitadc6536fe5baff2216fb76ecda6cc81c61109d5c (patch)
tree97b6150e7d5afc0681a1efde9659fc8c30dbd35a /src/gpu/effects/GrConfigConversionEffect.cpp
parent093455c116c016e95c47740ef7385f8a3372f160 (diff)
Remove getter of writable GrEffectStage from GrDrawState.
Upcoming changes will require GrDrawState to know things about the set of installed effects. Thus all setting of effects must go through a GrDrawState function (setEffect()). This change accomplishes that. Review URL: https://codereview.appspot.com/7214045 git-svn-id: http://skia.googlecode.com/svn/trunk@7411 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/effects/GrConfigConversionEffect.cpp')
-rw-r--r--src/gpu/effects/GrConfigConversionEffect.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index 4c4d0792c0..92df82d940 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -261,29 +261,26 @@ void GrConfigConversionEffect::TestForPreservingPMConversions(GrContext* context
}
}
-bool GrConfigConversionEffect::InstallEffect(GrTexture* texture,
- bool swapRedAndBlue,
- PMConversion pmConversion,
- const SkMatrix& matrix,
- GrEffectStage* stage) {
+const GrEffectRef* GrConfigConversionEffect::Create(GrTexture* texture,
+ bool swapRedAndBlue,
+ PMConversion pmConversion,
+ const SkMatrix& matrix) {
if (!swapRedAndBlue && kNone_PMConversion == pmConversion) {
- // If we returned a GrConfigConversionEffect that was equivalent to a GrSingleTextureEffect
+ // If we returned a GrConfigConversionEffect that was equivalent to a GrSimpleTextureEffect
// then we may pollute our texture cache with redundant shaders. So in the case that no
- // conversions were requested we instead return a GrSingleTextureEffect.
- stage->setEffect(GrSimpleTextureEffect::Create(texture, matrix))->unref();
- return true;
+ // conversions were requested we instead return a GrSimpleTextureEffect.
+ return GrSimpleTextureEffect::Create(texture, matrix);
} else {
if (kRGBA_8888_GrPixelConfig != texture->config() &&
kBGRA_8888_GrPixelConfig != texture->config() &&
kNone_PMConversion != pmConversion) {
// The PM conversions assume colors are 0..255
- return false;
+ return NULL;
}
AutoEffectUnref effect(SkNEW_ARGS(GrConfigConversionEffect, (texture,
swapRedAndBlue,
pmConversion,
matrix)));
- stage->setEffect(CreateEffectRef(effect))->unref();
- return true;
+ return CreateEffectRef(effect);
}
}