aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2015-10-21 04:16:19 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-10-21 04:16:19 -0700
commit81bdbf8bed8b739c2b65ac576e89d0258276e6dc (patch)
treed013603aa19e350b7faf2d2516c0a2b1857d8e7f /src
parentf428df1be3e96d3f8970d0f7f415b862f7da5404 (diff)
Revert of Dependencies are now added between the drawTargets in GrPipeline (patchset #5 id:100001 of https://codereview.chromium.org/1414903002/ )
Reason for revert: this may have broken the TSAN and ASAN bots Original issue's description: > Dependencies are now added between the drawTargets in GrPipeline > > This CL relies on https://codereview.chromium.org/1414773002/ (Add the machinery to GrDrawTarget to enable topological sorting) > > BUG=skia:4094 > > Committed: https://skia.googlesource.com/skia/+/45a1c34f607a970933e5cd05e1df6cd8090db1be TBR=bsalomon@google.com,robertphillips@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:4094 Review URL: https://codereview.chromium.org/1419613005
Diffstat (limited to 'src')
-rw-r--r--src/gpu/GrDrawTarget.cpp19
-rw-r--r--src/gpu/GrDrawTarget.h3
-rw-r--r--src/gpu/GrDrawingManager.cpp2
-rw-r--r--src/gpu/GrPipeline.cpp30
-rw-r--r--src/gpu/GrPipeline.h3
-rw-r--r--src/gpu/GrRenderTarget.cpp3
6 files changed, 5 insertions, 55 deletions
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 8b2267cad6..f42ee111ce 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -32,14 +32,13 @@
////////////////////////////////////////////////////////////////////////////////
-GrDrawTarget::GrDrawTarget(GrRenderTarget* rt, GrGpu* gpu, GrResourceProvider* resourceProvider)
+GrDrawTarget::GrDrawTarget(GrGpu* gpu, GrResourceProvider* resourceProvider)
: fGpu(SkRef(gpu))
, fResourceProvider(resourceProvider)
, fFlushState(fGpu, fResourceProvider, 0)
, fFlushing(false)
, fFirstUnpreparedBatch(0)
- , fFlags(0)
- , fRenderTarget(rt) {
+ , fFlags(0) {
// TODO: Stop extracting the context (currently needed by GrClipMaskManager)
fContext = fGpu->getContext();
fClipMaskManager.reset(new GrClipMaskManager(this));
@@ -51,10 +50,6 @@ GrDrawTarget::GrDrawTarget(GrRenderTarget* rt, GrGpu* gpu, GrResourceProvider* r
}
GrDrawTarget::~GrDrawTarget() {
- if (fRenderTarget && this == fRenderTarget->getLastDrawTarget()) {
- fRenderTarget->setLastDrawTarget(nullptr);
- }
-
fGpu->unref();
}
@@ -187,7 +182,7 @@ void GrDrawTarget::flush() {
// drawTargets will be created to replace them if the SkGpuDevice(s) write to them again.
this->makeClosed();
- // Loop over the batches that haven't yet generated their geometry
+ // Loop over all batches and generate geometry
for (; fFirstUnpreparedBatch < fBatches.count(); ++fFirstUnpreparedBatch) {
fBatches[fFirstUnpreparedBatch]->prepare(&fFlushState);
}
@@ -232,10 +227,6 @@ void GrDrawTarget::drawBatch(const GrPipelineBuilder& pipelineBuilder, GrDrawBat
return;
}
-#ifdef ENABLE_MDB
- batch->pipeline()->addDependenciesTo(fRenderTarget);
-#endif
-
this->recordBatch(batch);
}
@@ -467,10 +458,6 @@ void GrDrawTarget::copySurface(GrSurface* dst,
const SkIPoint& dstPoint) {
GrBatch* batch = GrCopySurfaceBatch::Create(dst, src, srcRect, dstPoint);
if (batch) {
-#ifdef ENABLE_MDB
- this->addDependency(src);
-#endif
-
this->recordBatch(batch);
batch->unref();
}
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index 32a3fc4fe1..ec94da1f0e 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -45,7 +45,7 @@ class GrDrawTarget final : public SkRefCnt {
public:
// The context may not be fully constructed and should not be used during GrDrawTarget
// construction.
- GrDrawTarget(GrRenderTarget* rt, GrGpu* gpu, GrResourceProvider*);
+ GrDrawTarget(GrGpu* gpu, GrResourceProvider*);
~GrDrawTarget() override;
@@ -314,7 +314,6 @@ private:
// 'this' drawTarget relies on the output of the drawTargets in 'fDependencies'
SkTDArray<GrDrawTarget*> fDependencies;
- GrRenderTarget* fRenderTarget;
typedef SkRefCnt INHERITED;
};
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index c3cc170a82..682b15511a 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -105,7 +105,7 @@ GrDrawTarget* GrDrawingManager::newDrawTarget(GrRenderTarget* rt) {
}
#endif
- GrDrawTarget* dt = new GrDrawTarget(rt, fContext->getGpu(), fContext->resourceProvider());
+ GrDrawTarget* dt = new GrDrawTarget(fContext->getGpu(), fContext->resourceProvider());
*fDrawTargets.append() = dt;
diff --git a/src/gpu/GrPipeline.cpp b/src/gpu/GrPipeline.cpp
index 073349be1e..80e3cbdf69 100644
--- a/src/gpu/GrPipeline.cpp
+++ b/src/gpu/GrPipeline.cpp
@@ -8,7 +8,6 @@
#include "GrPipeline.h"
#include "GrCaps.h"
-#include "GrDrawTarget.h"
#include "GrGpu.h"
#include "GrPipelineBuilder.h"
#include "GrProcOptInfo.h"
@@ -131,35 +130,6 @@ GrPipeline* GrPipeline::CreateAt(void* memory, const CreateArgs& args,
return pipeline;
}
-static void add_dependencies_for_processor(const GrFragmentProcessor* proc, GrRenderTarget* rt) {
- for (int i = 0; i < proc->numChildProcessors(); ++i) {
- // need to recurse
- add_dependencies_for_processor(&proc->childProcessor(i), rt);
- }
-
- for (int i = 0; i < proc->numTextures(); ++i) {
- GrTexture* texture = proc->textureAccess(i).getTexture();
- SkASSERT(rt->getLastDrawTarget());
- rt->getLastDrawTarget()->addDependency(texture);
- }
-}
-
-void GrPipeline::addDependenciesTo(GrRenderTarget* rt) const {
- for (int i = 0; i < fFragmentProcessors.count(); ++i) {
- add_dependencies_for_processor(fFragmentProcessors[i].get(), rt);
- }
-
- if (fXferProcessor.get()) {
- const GrXferProcessor* xfer = fXferProcessor.get();
-
- for (int i = 0; i < xfer->numTextures(); ++i) {
- GrTexture* texture = xfer->textureAccess(i).getTexture();
- SkASSERT(rt->getLastDrawTarget());
- rt->getLastDrawTarget()->addDependency(texture);
- }
- }
-}
-
void GrPipeline::adjustProgramFromOptimizations(const GrPipelineBuilder& pipelineBuilder,
GrXferProcessor::OptFlags flags,
const GrProcOptInfo& colorPOI,
diff --git a/src/gpu/GrPipeline.h b/src/gpu/GrPipeline.h
index 8781058247..df44ba680c 100644
--- a/src/gpu/GrPipeline.h
+++ b/src/gpu/GrPipeline.h
@@ -84,9 +84,6 @@ public:
///////////////////////////////////////////////////////////////////////////
/// @name GrFragmentProcessors
- // Make the renderTarget's drawTarget (if it exists) be dependent on any
- // drawTargets in this pipeline
- void addDependenciesTo(GrRenderTarget* rt) const;
int numColorFragmentProcessors() const { return fNumColorProcessors; }
int numCoverageFragmentProcessors() const {
diff --git a/src/gpu/GrRenderTarget.cpp b/src/gpu/GrRenderTarget.cpp
index d519f028f0..ad56cf761f 100644
--- a/src/gpu/GrRenderTarget.cpp
+++ b/src/gpu/GrRenderTarget.cpp
@@ -71,10 +71,7 @@ void GrRenderTarget::onAbandon() {
void GrRenderTarget::setLastDrawTarget(GrDrawTarget* dt) {
if (fLastDrawTarget) {
- // The non-MDB world never closes so we can't check this condition
-#ifdef ENABLE_MDB
SkASSERT(fLastDrawTarget->isClosed());
-#endif
}
fLastDrawTarget = dt;