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

Unified Diff: src/gpu/GrDrawState.h

Issue 560443004: Revert of Attach GrOptDrawState into shader building pipeline (Closed) Base URL: https://skia.googlesource.com/skia.git@opt2
Patch Set: Created 6 years, 3 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 | « no previous file | src/gpu/GrDrawState.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 4869658b4f3c2f3929832d5ea293cd6a5aafd1d5..6a1e38056bbcad8da3a29498cf3b5f1d0f0ac85b 100644
--- a/src/gpu/GrDrawState.h
+++ b/src/gpu/GrDrawState.h
@@ -9,11 +9,10 @@
#define GrDrawState_DEFINED
#include "GrBlend.h"
+#include "GrOptDrawState.h"
#include "GrProgramResource.h"
#include "GrRODrawState.h"
#include "effects/GrSimpleTextureEffect.h"
-
-class GrOptDrawState;
/**
* Modifiable subclass derived from GrRODrawState. The majority of the data that represents a draw
@@ -48,7 +47,10 @@
**/
GrDrawState(const GrDrawState& state, const SkMatrix& preConcatMatrix);
- virtual ~GrDrawState();
+ virtual ~GrDrawState() {
+ SkSafeUnref(fCachedOptState);
+ SkASSERT(0 == fBlockEffectRemovalCnt);
+ }
/**
* Resets to the default state. GrEffects will be removed from all stages.
@@ -550,9 +552,16 @@
GrOptDrawState* createOptState() const;
private:
- void invalidateOptState() const;
+ void invalidateOptState() const {
+ SkSafeSetNull(fCachedOptState);
+ fBlendOptFlags = kInvalid_BlendOptFlag;
+ }
void onReset(const SkMatrix* initialViewMatrix);
+
+ void invalidateBlendOptFlags() {
+ fBlendOptFlags = kInvalid_BlendOptFlag;
+ }
// Some of the auto restore objects assume that no effects are removed during their lifetime.
// This is used to assert that this condition holds.
« no previous file with comments | « no previous file | src/gpu/GrDrawState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698