diff options
author | 2011-03-15 19:09:25 +0000 | |
---|---|---|
committer | 2011-03-15 19:09:25 +0000 | |
commit | 080773ca79cbdc230730d295441255e9254d76a6 (patch) | |
tree | 549239db566093d9f0a7743f6e67471931142f4e /gpu/include/GrDrawTarget.h | |
parent | dc008e17104fc544d2b80c09c9835cf173c25b50 (diff) |
Add blend constant color and use it for lcd text common case (no fancy blend or shaded text)
Review URL: http://codereview.appspot.com/4274057/
git-svn-id: http://skia.googlecode.com/svn/trunk@941 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu/include/GrDrawTarget.h')
-rw-r--r-- | gpu/include/GrDrawTarget.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gpu/include/GrDrawTarget.h b/gpu/include/GrDrawTarget.h index aef5937ea7..35f912b7c4 100644 --- a/gpu/include/GrDrawTarget.h +++ b/gpu/include/GrDrawTarget.h @@ -136,6 +136,7 @@ protected: uint32_t fFlagBits; GrBlendCoeff fSrcBlend; GrBlendCoeff fDstBlend; + GrColor fBlendConstant; GrTexture* fTextures[kNumStages]; GrSamplerState fSamplerStates[kNumStages]; GrRenderTarget* fRenderTarget; @@ -359,6 +360,24 @@ public: void setBlendFunc(GrBlendCoeff srcCoef, GrBlendCoeff dstCoef); /** + * Sets the blending function constant referenced by the following blending + * coeffecients: + * kConstC_BlendCoeff + * kIConstC_BlendCoeff + * kConstA_BlendCoeff + * kIConstA_BlendCoeff + * + * @param constant the constant to set + */ + void setBlendConstant(GrColor constant) { fCurrDrawState.fBlendConstant = constant; } + + /** + * Retrieves the last value set by setBlendConstant() + * @return the blending constant value + */ + GrColor getBlendConstant() const { return fCurrDrawState.fBlendConstant; } + + /** * Used to save and restore the GrGpu's drawing state */ struct SavedDrawState { |