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

Unified Diff: include/gpu/GrRenderTarget.h

Issue 1406173003: Loosen requirement that there be only one GrDrawTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix comment Created 5 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 | « include/gpu/GrDrawContext.h ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrRenderTarget.h
diff --git a/include/gpu/GrRenderTarget.h b/include/gpu/GrRenderTarget.h
index 2309dbd876f6cf4e9d58b715730088045e83fb65..b5fc6f001af093256b40b8d82d8ddaa455a2120e 100644
--- a/include/gpu/GrRenderTarget.h
+++ b/include/gpu/GrRenderTarget.h
@@ -11,6 +11,7 @@
#include "GrSurface.h"
#include "SkRect.h"
+class GrDrawTarget;
class GrStencilAttachment;
class GrRenderTargetPriv;
@@ -151,12 +152,16 @@ public:
GrRenderTargetPriv renderTargetPriv();
const GrRenderTargetPriv renderTargetPriv() const;
+ void setLastDrawTarget(GrDrawTarget* dt);
+ GrDrawTarget* getLastDrawTarget() { return fLastDrawTarget; }
+
protected:
GrRenderTarget(GrGpu* gpu, LifeCycle lifeCycle, const GrSurfaceDesc& desc,
SampleConfig sampleConfig, GrStencilAttachment* stencil = nullptr)
: INHERITED(gpu, lifeCycle, desc)
, fStencilAttachment(stencil)
- , fSampleConfig(sampleConfig) {
+ , fSampleConfig(sampleConfig)
+ , fLastDrawTarget(nullptr) {
fResolveRect.setLargestInverted();
}
@@ -178,6 +183,14 @@ private:
SkIRect fResolveRect;
+ // The last drawTarget that wrote to or is currently going to write to this renderTarget
+ // The drawTarget can be closed (e.g., no draw context is currently bound
+ // to this renderTarget).
+ // This back-pointer is required so that we can add a dependancy between
+ // the drawTarget used to create the current contents of this renderTarget
+ // and the drawTarget of a destination renderTarget to which this one is being drawn.
+ GrDrawTarget* fLastDrawTarget;
+
typedef GrSurface INHERITED;
};
« no previous file with comments | « include/gpu/GrDrawContext.h ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698