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

Unified Diff: src/gpu/GrOptDrawState.h

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.cpp ('k') | src/gpu/GrOptDrawState.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrOptDrawState.h
diff --git a/src/gpu/GrOptDrawState.h b/src/gpu/GrOptDrawState.h
index f0a726e9547d5d7bddffaf145a690ffcd0244432..1f8c442230f864ac58c342a78deeb7863c8cc251 100644
--- a/src/gpu/GrOptDrawState.h
+++ b/src/gpu/GrOptDrawState.h
@@ -8,7 +8,15 @@
#ifndef GrOptDrawState_DEFINED
#define GrOptDrawState_DEFINED
-#include "GrDrawState.h"
+#include "GrColor.h"
+#include "GrGpu.h"
+#include "GrProcessorStage.h"
+#include "GrStencil.h"
+#include "GrTypesPriv.h"
+#include "SkMatrix.h"
+#include "SkRefCnt.h"
+
+class GrDrawState;
/**
* Class that holds an optimized version of a GrDrawState. It is meant to be an immutable class,
@@ -16,6 +24,15 @@
*/
class GrOptDrawState : public SkRefCnt {
public:
+ /**
+ * Returns a snapshot of the current optimized state. If the current drawState has a valid
+ * cached optimiezed state it will simply return a pointer to it otherwise it will create a new
+ * GrOptDrawState. In all cases the GrOptDrawState is reffed and ownership is given to the
+ * caller.
+ */
+ static GrOptDrawState* Create(const GrDrawState& drawState, const GrDrawTargetCaps& caps,
+ GrGpu::DrawType drawType);
+
bool operator== (const GrOptDrawState& that) const;
///////////////////////////////////////////////////////////////////////////
@@ -443,7 +460,6 @@ private:
PrimaryOutputType fPrimaryOutputType : 8;
SecondaryOutputType fSecondaryOutputType : 8;
- friend GrOptDrawState* GrDrawState::createOptState(const GrDrawTargetCaps&) const;
typedef SkRefCnt INHERITED;
};
« no previous file with comments | « src/gpu/GrDrawState.cpp ('k') | src/gpu/GrOptDrawState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698