Index: src/gpu/GrRODrawState.h |
diff --git a/src/gpu/GrRODrawState.h b/src/gpu/GrRODrawState.h |
index 54d87bdfc8ca111f16edff88164749c6fd653de0..92cb3b5fa8aa1a22892f939f5b9ba1402685c5b9 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; |
/** |
@@ -238,7 +238,9 @@ public: |
* |
* @return The currently set render target. |
*/ |
- GrRenderTarget* getRenderTarget() const { return fRenderTarget.get(); } |
+ GrRenderTarget* getRenderTarget() const { |
+ return static_cast<GrRenderTarget*>(fRenderTarget.getResource()); |
+ } |
/// @} |
@@ -340,10 +342,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; |