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

Unified Diff: src/gpu/GrDrawState.cpp

Issue 630063002: Make createOptDrawState return NULL if we would end up not drawing (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase and Nits Created 6 years, 2 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/GrDrawState.h ('k') | src/gpu/GrOptDrawState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawState.cpp
diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp
index b4cf9c8b4106228fc45d57a72e8ec5e7a7a8b9dd..f967a6fa76182d536bd9aba26221c685335c7896 100644
--- a/src/gpu/GrDrawState.cpp
+++ b/src/gpu/GrDrawState.cpp
@@ -12,29 +12,6 @@
//////////////////////////////////////////////////////////////////////////////s
-GrOptDrawState* GrDrawState::createOptState(const GrDrawTargetCaps& caps) const {
- if (NULL == fCachedOptState || caps.getUniqueID() != fCachedCapsID) {
- GrBlendCoeff srcCoeff;
- GrBlendCoeff dstCoeff;
- GrOptDrawState::BlendOptFlags blendFlags =
- (GrOptDrawState::BlendOptFlags) this->getBlendOpts(false, &srcCoeff, &dstCoeff);
- fCachedOptState = SkNEW_ARGS(GrOptDrawState, (*this, blendFlags, srcCoeff, dstCoeff, caps));
- fCachedCapsID = caps.getUniqueID();
- } else {
-#ifdef SK_DEBUG
- GrBlendCoeff srcCoeff;
- GrBlendCoeff dstCoeff;
- GrOptDrawState::BlendOptFlags blendFlags =
- (GrOptDrawState::BlendOptFlags) this->getBlendOpts(false, &srcCoeff, &dstCoeff);
- SkASSERT(GrOptDrawState(*this, blendFlags, srcCoeff, dstCoeff, caps) == *fCachedOptState);
-#endif
- }
- fCachedOptState->ref();
- return fCachedOptState;
-}
-
-//////////////////////////////////////////////////////////////////////////////s
-
bool GrDrawState::isEqual(const GrDrawState& that) const {
bool usingVertexColors = this->hasColorVertexAttribute();
if (!usingVertexColors && this->fColor != that.fColor) {
« no previous file with comments | « src/gpu/GrDrawState.h ('k') | src/gpu/GrOptDrawState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698