Add GrOpList and rename GrDrawTarget to GrRenderTargetOpList
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3910
Change-Id: I026aa26ecc61a0d002e98892dca728536259e8b1
Reviewed-on: https://skia-review.googlesource.com/3910
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/include/private/GrRenderTargetProxy.h b/include/private/GrRenderTargetProxy.h
index e4bc70f..59fed59 100644
--- a/include/private/GrRenderTargetProxy.h
+++ b/include/private/GrRenderTargetProxy.h
@@ -28,8 +28,6 @@
SkBackingFit, SkBudgeted);
static sk_sp<GrRenderTargetProxy> Make(const GrCaps&, sk_sp<GrRenderTarget>);
- ~GrRenderTargetProxy() override;
-
// TODO: add asTextureProxy variants
GrRenderTargetProxy* asRenderTargetProxy() override { return this; }
const GrRenderTargetProxy* asRenderTargetProxy() const override { return this; }
@@ -60,9 +58,6 @@
*/
int numColorSamples() const { return this->isMixedSampled() ? 0 : fDesc.fSampleCnt; }
- void setLastDrawTarget(GrDrawTarget* dt);
- GrDrawTarget* getLastDrawTarget() { return fLastDrawTarget; }
-
GrRenderTargetPriv::Flags testingOnly_getFlags() const;
private:
@@ -83,14 +78,6 @@
// rendertarget's info here.
GrRenderTargetPriv::Flags fFlags;
- // 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 GrSurfaceProxy INHERITED;
};
diff --git a/include/private/GrSurfaceProxy.h b/include/private/GrSurfaceProxy.h
index 69656fe..4e2ad3b 100644
--- a/include/private/GrSurfaceProxy.h
+++ b/include/private/GrSurfaceProxy.h
@@ -11,6 +11,7 @@
#include "GrGpuResource.h"
#include "SkRect.h"
+class GrOpList;
class GrTextureProxy;
class GrRenderTargetProxy;
@@ -51,13 +52,17 @@
*/
SkBudgeted isBudgeted() const { return fBudgeted; }
+ void setLastOpList(GrOpList* opList);
+ GrOpList* getLastOpList() { return fLastOpList; }
+
protected:
// Deferred version
GrSurfaceProxy(const GrSurfaceDesc& desc, SkBackingFit fit, SkBudgeted budgeted)
: fDesc(desc)
, fFit(fit)
, fBudgeted(budgeted)
- , fUniqueID(GrGpuResource::CreateUniqueID()) {
+ , fUniqueID(GrGpuResource::CreateUniqueID())
+ , fLastOpList(nullptr) {
}
// Wrapped version
@@ -66,10 +71,12 @@
: fDesc(desc)
, fFit(fit)
, fBudgeted(budgeted)
- , fUniqueID(uniqueID) {
+ , fUniqueID(uniqueID)
+ , fLastOpList(nullptr) {
}
- virtual ~GrSurfaceProxy() {}
+ virtual ~GrSurfaceProxy();
+
// For wrapped resources, 'fDesc' will always be filled in from the wrapped resource.
const GrSurfaceDesc fDesc;
@@ -83,6 +90,14 @@
void notifyAllCntsAreZero(CntType) const { delete this; }
bool notifyRefCountIsZero() const { return true; }
+ // The last opList that wrote to or is currently going to write to this surface
+ // The opList 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 opList used to create the current contents of this surface
+ // and the opList of a destination surface to which this one is being drawn or copied.
+ GrOpList* fLastOpList;
+
typedef GrIORef<GrSurfaceProxy> INHERITED;
// to access notifyAllCntsAreZero and notifyRefCntIsZero.