diff options
author | 2013-01-28 14:26:09 +0000 | |
---|---|---|
committer | 2013-01-28 14:26:09 +0000 | |
commit | adc6536fe5baff2216fb76ecda6cc81c61109d5c (patch) | |
tree | 97b6150e7d5afc0681a1efde9659fc8c30dbd35a /src/gpu/GrDrawState.h | |
parent | 093455c116c016e95c47740ef7385f8a3372f160 (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/GrDrawState.h')
-rw-r--r-- | src/gpu/GrDrawState.h | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h index ba9eb217d6..326df0bf95 100644 --- a/src/gpu/GrDrawState.h +++ b/src/gpu/GrDrawState.h @@ -185,16 +185,21 @@ public: /// @} /////////////////////////////////////////////////////////////////////////// - /// @name Textures + /// @name Effect Stages //// + const GrEffectRef* setEffect(int stageIdx, const GrEffectRef* effect) { + fStages[stageIdx].setEffect(effect); + return effect; + } + /** * Creates a GrSimpleTextureEffect. */ void createTextureEffect(int stageIdx, GrTexture* texture, const SkMatrix& matrix) { GrAssert(!this->getStage(stageIdx).getEffect()); GrEffectRef* effect = GrSimpleTextureEffect::Create(texture, matrix); - this->stage(stageIdx)->setEffect(effect)->unref(); + this->setEffect(stageIdx, effect)->unref(); } void createTextureEffect(int stageIdx, GrTexture* texture, @@ -202,7 +207,7 @@ public: const GrTextureParams& params) { GrAssert(!this->getStage(stageIdx).getEffect()); GrEffectRef* effect = GrSimpleTextureEffect::Create(texture, matrix, params); - this->stage(stageIdx)->setEffect(effect)->unref(); + this->setEffect(stageIdx, effect)->unref(); } bool stagesDisabled() { @@ -214,9 +219,7 @@ public: return true; } - void disableStage(int stageIdx) { - fStages[stageIdx].setEffect(NULL); - } + void disableStage(int stageIdx) { this->setEffect(stageIdx, NULL); } /** * Release all the GrEffects referred to by this draw state. @@ -239,12 +242,6 @@ public: GrDrawState* fDrawState; }; - /// @} - - /////////////////////////////////////////////////////////////////////////// - /// @name Stages - //// - /** * Returns the current stage by index. */ @@ -254,14 +251,6 @@ public: } /** - * Writable pointer to a stage. - */ - GrEffectStage* stage(int stageIdx) { - GrAssert((unsigned)stageIdx < kNumStages); - return fStages + stageIdx; - } - - /** * Called when the source coord system is changing. preConcat gives the transformation from the * old coord system to the new coord system. */ |