aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-04-17 07:53:07 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-17 12:41:59 +0000
commitc589b0b5c0235c3adedc574c8846fb62414ed93c (patch)
tree747f760e5b74a05ce5c0cbc7c778d3faece2693a /src
parentbab2dbb5fa50da8e8365abbaa9f1490e659f436c (diff)
Remove lastOpList capability from GrSurface
This is split out of: https://skia-review.googlesource.com/c/11581/ (Split up opLists) TBR=bsalomon@google.com Change-Id: I80d589b42918ddd77538484c808b069576691da4 Reviewed-on: https://skia-review.googlesource.com/11793 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/gpu/GrOpList.cpp7
-rw-r--r--src/gpu/GrOpList.h5
-rw-r--r--src/gpu/GrPipeline.cpp22
-rw-r--r--src/gpu/GrPipeline.h2
-rw-r--r--src/gpu/GrRenderTarget.cpp4
-rw-r--r--src/gpu/GrRenderTargetOpList.h2
-rw-r--r--src/gpu/GrSurface.cpp17
-rw-r--r--src/gpu/GrTextureOpList.cpp5
-rw-r--r--src/gpu/GrTextureOpList.h2
9 files changed, 30 insertions, 36 deletions
diff --git a/src/gpu/GrOpList.cpp b/src/gpu/GrOpList.cpp
index 28b972df99..91c8c7942c 100644
--- a/src/gpu/GrOpList.cpp
+++ b/src/gpu/GrOpList.cpp
@@ -6,11 +6,10 @@
*/
#include "GrOpList.h"
-
-#include "GrRenderTargetOpList.h"
-#include "GrSurface.h"
#include "GrSurfaceProxy.h"
+#include "SkAtomics.h"
+
uint32_t GrOpList::CreateUniqueID() {
static int32_t gUniqueID = SK_InvalidUniqueID;
uint32_t id;
@@ -49,7 +48,7 @@ void GrOpList::addDependency(GrOpList* dependedOn) {
}
// Convert from a GrSurface-based dependency to a GrOpList one
-void GrOpList::addDependency(GrSurface* dependedOn) {
+void GrOpList::addDependency(GrSurfaceProxy* dependedOn) {
if (dependedOn->getLastOpList()) {
// If it is still receiving dependencies, this GrOpList shouldn't be closed
SkASSERT(!this->isClosed());
diff --git a/src/gpu/GrOpList.h b/src/gpu/GrOpList.h
index 0139b6b4d3..b7dd7fa62f 100644
--- a/src/gpu/GrOpList.h
+++ b/src/gpu/GrOpList.h
@@ -16,7 +16,6 @@
class GrAuditTrail;
class GrOpFlushState;
class GrRenderTargetOpList;
-class GrSurface;
class GrSurfaceProxy;
class GrTextureOpList;
@@ -54,7 +53,7 @@ public:
/*
* Notify this GrOpList that it relies on the contents of 'dependedOn'
*/
- void addDependency(GrSurface* dependedOn);
+ void addDependency(GrSurfaceProxy* dependedOn);
/*
* Does this opList depend on 'dependedOn'?
@@ -80,6 +79,8 @@ public:
*/
SkDEBUGCODE(virtual void dump() const;)
+ SkDEBUGCODE(virtual void validateTargetsSingleRenderTarget() const = 0;)
+
protected:
GrSurfaceProxy* fTarget;
GrAuditTrail* fAuditTrail;
diff --git a/src/gpu/GrPipeline.cpp b/src/gpu/GrPipeline.cpp
index 193c32020f..9e04b86e2e 100644
--- a/src/gpu/GrPipeline.cpp
+++ b/src/gpu/GrPipeline.cpp
@@ -83,22 +83,30 @@ void GrPipeline::init(const InitArgs& args) {
}
}
-static void add_dependencies_for_processor(const GrFragmentProcessor* proc, GrRenderTarget* rt) {
+// MDB TODO: re-enable when TextureSamplers store texture proxies
+#if 0
+static void add_dependencies_for_processor(const GrFragmentProcessor* proc,
+ GrRenderTargetProxy* rtp) {
GrFragmentProcessor::TextureAccessIter iter(proc);
while (const GrResourceIOProcessor::TextureSampler* sampler = iter.next()) {
- SkASSERT(rt->getLastOpList());
- rt->getLastOpList()->addDependency(sampler->texture());
+ SkASSERT(rtp->getLastOpList());
+ rtp->getLastOpList()->addDependency(sampler->texture());
}
}
+#endif
-void GrPipeline::addDependenciesTo(GrRenderTarget* rt) const {
+void GrPipeline::addDependenciesTo(GrRenderTargetProxy* rtp) const {
+ // MDB TODO: re-enable when TextureSamplers store texture proxies
+#if 0
for (int i = 0; i < fFragmentProcessors.count(); ++i) {
- add_dependencies_for_processor(fFragmentProcessors[i].get(), rt);
+ add_dependencies_for_processor(fFragmentProcessors[i].get(), rtp);
}
+#endif
if (fDstTexture) {
- SkASSERT(rt->getLastOpList());
- rt->getLastOpList()->addDependency(fDstTexture.get());
+ SkASSERT(rtp->getLastOpList());
+ // MDB TODO: re-enable when TextureSamplers store texture proxies
+ //rtp->getLastOpList()->addDependency(fDstTexture.get());
}
}
diff --git a/src/gpu/GrPipeline.h b/src/gpu/GrPipeline.h
index b08b4baa1f..76e9f2e7d1 100644
--- a/src/gpu/GrPipeline.h
+++ b/src/gpu/GrPipeline.h
@@ -122,7 +122,7 @@ public:
// Make the renderTarget's GrOpList (if it exists) be dependent on any
// GrOpLists in this pipeline
- void addDependenciesTo(GrRenderTarget* rt) const;
+ void addDependenciesTo(GrRenderTargetProxy*) const;
int numColorFragmentProcessors() const { return fNumColorProcessors; }
int numCoverageFragmentProcessors() const {
diff --git a/src/gpu/GrRenderTarget.cpp b/src/gpu/GrRenderTarget.cpp
index 9ea8596050..61a6f92f22 100644
--- a/src/gpu/GrRenderTarget.cpp
+++ b/src/gpu/GrRenderTarget.cpp
@@ -61,10 +61,6 @@ void GrRenderTarget::onRelease() {
void GrRenderTarget::onAbandon() {
SkSafeSetNull(fStencilAttachment);
- // The contents of this renderTarget are gone/invalid. It isn't useful to point back
- // the creating opList.
- this->setLastOpList(nullptr);
-
INHERITED::onAbandon();
}
diff --git a/src/gpu/GrRenderTargetOpList.h b/src/gpu/GrRenderTargetOpList.h
index 1b6f0865b0..5762e0aab5 100644
--- a/src/gpu/GrRenderTargetOpList.h
+++ b/src/gpu/GrRenderTargetOpList.h
@@ -110,7 +110,7 @@ public:
SkDEBUGCODE(void dump() const override;)
- SkDEBUGCODE(void validateTargetsSingleRenderTarget() const;)
+ SkDEBUGCODE(void validateTargetsSingleRenderTarget() const override;)
private:
friend class GrRenderTargetContextPriv; // for stencil clip state. TODO: this is invasive
diff --git a/src/gpu/GrSurface.cpp b/src/gpu/GrSurface.cpp
index 4c9e3b4c1e..1762d00689 100644
--- a/src/gpu/GrSurface.cpp
+++ b/src/gpu/GrSurface.cpp
@@ -15,11 +15,6 @@
#include "SkMathPriv.h"
GrSurface::~GrSurface() {
- if (fLastOpList) {
- fLastOpList->clearTarget();
- }
- SkSafeUnref(fLastOpList);
-
// check that invokeReleaseProc has been called (if needed)
SkASSERT(NULL == fReleaseProc);
}
@@ -184,15 +179,3 @@ void GrSurface::onAbandon() {
this->invokeReleaseProc();
this->INHERITED::onAbandon();
}
-
-void GrSurface::setLastOpList(GrOpList* opList) {
- if (fLastOpList) {
- // The non-MDB world never closes so we can't check this condition
-#ifdef ENABLE_MDB
- SkASSERT(fLastOpList->isClosed());
-#endif
- fLastOpList->clearTarget();
- }
-
- SkRefCnt_SafeAssign(fLastOpList, opList);
-}
diff --git a/src/gpu/GrTextureOpList.cpp b/src/gpu/GrTextureOpList.cpp
index d4becad579..175f178d5e 100644
--- a/src/gpu/GrTextureOpList.cpp
+++ b/src/gpu/GrTextureOpList.cpp
@@ -42,6 +42,11 @@ void GrTextureOpList::dump() const {
clippedBounds.fBottom);
}
}
+
+void GrTextureOpList::validateTargetsSingleRenderTarget() const {
+ SkASSERT(1 == fRecordedOps.count() || 0 == fRecordedOps.count());
+}
+
#endif
void GrTextureOpList::prepareOps(GrOpFlushState* flushState) {
diff --git a/src/gpu/GrTextureOpList.h b/src/gpu/GrTextureOpList.h
index ca5bda44f6..d42818d140 100644
--- a/src/gpu/GrTextureOpList.h
+++ b/src/gpu/GrTextureOpList.h
@@ -62,6 +62,8 @@ public:
SkDEBUGCODE(void dump() const override;)
+ SkDEBUGCODE(virtual void validateTargetsSingleRenderTarget() const override;)
+
private:
// MDB TODO: The unique IDs are only needed for the audit trail. There should only be one
// on the opList itself.