diff options
author | tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-06-25 17:27:28 +0000 |
---|---|---|
committer | tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-06-25 17:27:28 +0000 |
commit | f13f58804659175925042a291304d483a4fd9278 (patch) | |
tree | c3c31ab0c9a984f3f0ded3197209ef0fc679a330 /include | |
parent | f41f4d22576c95f0e3ddfc87be40fcf4ee34b408 (diff) |
Add GrPaint::*StageEnabled() and GrDrawState::stageEnabled() functions.
These wrap the question of "is this stage of the shader enabled?" so that
we can change the semantics - previously iff there was a texture, now
if there is a texture OR a GrCustomStage, soon (post-cl 6306097) iff there
is a GrCustomStage, which at that point will hold whatever texture is
necessary.
http://codereview.appspot.com/6306104/
git-svn-id: http://skia.googlecode.com/svn/trunk@4325 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/gpu/GrPaint.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/gpu/GrPaint.h b/include/gpu/GrPaint.h index 729f6f060e..3c8c47afe4 100644 --- a/include/gpu/GrPaint.h +++ b/include/gpu/GrPaint.h @@ -64,6 +64,12 @@ public: return fTextureSamplers[i]; } + bool isTextureStageEnabled(int i) const { + GrAssert((unsigned)i < kMaxTextures); + return (NULL != fTextures[i]) || + (NULL != fTextureSamplers[i].getCustomStage()); + } + // The mask can be alpha-only or per channel. It is applied // after the colorfilter void setMask(int i, GrTexture* mask) { @@ -90,6 +96,12 @@ public: return fMaskSamplers[i]; } + bool isMaskStageEnabled(int i) const { + GrAssert((unsigned)i < kMaxTextures); + return (NULL != fMaskTextures[i]) || + (NULL != fMaskSamplers[i].getCustomStage()); + } + // pre-concats sampler matrices for non-NULL textures and masks void preConcatActiveSamplerMatrices(const GrMatrix& matrix) { for (int i = 0; i < kMaxTextures; ++i) { |