diff options
author | 2013-08-06 15:07:23 +0000 | |
---|---|---|
committer | 2013-08-06 15:07:23 +0000 | |
commit | c1cdf21ab88b63c07990e6bbce559397bf207b47 (patch) | |
tree | 9015cb2d6736d628a5a08a34d291cb53acc882d3 /src/gpu/GrDrawState.h | |
parent | 0b82fbcb464fa480c3fb59bed7524518ed9b32ce (diff) |
Add blend optimization helpers and use to convert rect draws to clears.
Committed: http://code.google.com/p/skia/source/detail?r=10537
R=robertphillips@google.com, jvanverth@google.com, reed@google.com
Author: bsalomon@google.com
Review URL: https://chromiumcodereview.appspot.com/21877006
git-svn-id: http://skia.googlecode.com/svn/trunk@10562 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/GrDrawState.h')
-rw-r--r-- | src/gpu/GrDrawState.h | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h index c006e6c5dd..785be77f58 100644 --- a/src/gpu/GrDrawState.h +++ b/src/gpu/GrDrawState.h @@ -9,6 +9,7 @@ #define GrDrawState_DEFINED #include "GrBackendEffectFactory.h" +#include "GrBlend.h" #include "GrColor.h" #include "GrEffectStage.h" #include "GrPaint.h" @@ -469,27 +470,11 @@ public: fCommon.fSrcBlend = srcCoeff; fCommon.fDstBlend = dstCoeff; #if GR_DEBUG - switch (dstCoeff) { - case kDC_GrBlendCoeff: - case kIDC_GrBlendCoeff: - case kDA_GrBlendCoeff: - case kIDA_GrBlendCoeff: - GrPrintf("Unexpected dst blend coeff. Won't work correctly with" - "coverage stages.\n"); - break; - default: - break; + if (GrBlendCoeffRefsDst(dstCoeff)) { + GrPrintf("Unexpected dst blend coeff. Won't work correctly with coverage stages.\n"); } - switch (srcCoeff) { - case kSC_GrBlendCoeff: - case kISC_GrBlendCoeff: - case kSA_GrBlendCoeff: - case kISA_GrBlendCoeff: - GrPrintf("Unexpected src blend coeff. Won't work correctly with" - "coverage stages.\n"); - break; - default: - break; + if (GrBlendCoeffRefsSrc(srcCoeff)) { + GrPrintf("Unexpected src blend coeff. Won't work correctly with coverage stages.\n"); } #endif } |