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

Unified Diff: src/gpu/GrRODrawState.h

Issue 542723004: Make GrDrawState and GrEffectStage use the pending io/exec ref mechanisms. (Closed) Base URL: https://skia.googlesource.com/skia.git@complete
Patch Set: rebase again 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 | « src/gpu/GrInOrderDrawBuffer.cpp ('k') | src/gpu/GrRODrawState.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrRODrawState.h
diff --git a/src/gpu/GrRODrawState.h b/src/gpu/GrRODrawState.h
index 19bbfc160dee52cf0bdb2a30c29f9bc4720be4e5..bba50c5522ff7fc805b74b7e0dbbbd9e93d7c452 100644
--- a/src/gpu/GrRODrawState.h
+++ b/src/gpu/GrRODrawState.h
@@ -8,13 +8,13 @@
#ifndef GrRODrawState_DEFINED
#define GrRODrawState_DEFINED
-#include "GrStencil.h"
#include "GrEffectStage.h"
+#include "GrRenderTarget.h"
+#include "GrStencil.h"
#include "SkMatrix.h"
class GrDrawTargetCaps;
class GrPaint;
-class GrRenderTarget;
class GrTexture;
/**
@@ -243,7 +243,9 @@ public:
*
* @return The currently set render target.
*/
- GrRenderTarget* getRenderTarget() const { return fRenderTarget.get(); }
+ GrRenderTarget* getRenderTarget() const {
+ return static_cast<GrRenderTarget*>(fRenderTarget.getResource());
+ }
/// @}
@@ -345,10 +347,23 @@ public:
};
protected:
+ /**
+ * Converts refs on GrGpuResources owned directly or indirectly by this GrRODrawState into
+ * pending reads and writes. This should be called when a GrDrawState is recorded into
+ * a GrDrawTarget for later execution. Subclasses of GrRODrawState may add setters. However,
+ * once this call has been made the GrRODrawState is immutable. It is also no longer copyable.
+ * In the future this conversion will automatically happen when converting a GrDrawState into
+ * an optimized draw state.
+ */
+ void convertToPendingExec();
+
+ friend class GrDrawTarget;
+
+protected:
bool isEqual(const GrRODrawState& that) const;
// These fields are roughly sorted by decreasing likelihood of being different in op==
- SkAutoTUnref<GrRenderTarget> fRenderTarget;
+ GrProgramResource fRenderTarget;
GrColor fColor;
SkMatrix fViewMatrix;
GrColor fBlendConstant;
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.cpp ('k') | src/gpu/GrRODrawState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698