Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Unified Diff: src/gpu/GrDrawState.h

Issue 21877006: Add blend optimization helpers and use to convert rect draws to clears. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: change src to rect in comment Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrPaint.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawState.h
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h
index c006e6c5dd5de69fc93a8cd9385498069c8472be..785be77f58e2ca0fd7ce9f4e7d2b49f25e01d972 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
}
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698