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

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: revert two files 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
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;

Powered by Google App Engine
This is Rietveld 408576698