Skip to content

Commit 44e2c5f

Browse files
rphilliSkia Commit-Bot
authored andcommitted
Add render task type to flush-time op spew
In the flush-time op spew it is clear which renderTasks are the Ops-based ones. This clarifies which of the other varieties occur. Change-Id: I0e55b93f6e8d3cc0d9a9223f9c0ba967eeebb633 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283483 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
1 parent 308c072 commit 44e2c5f

File tree

7 files changed

+14
-5
lines changed

7 files changed

+14
-5
lines changed

src/gpu/GrCopyRenderTask.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class GrCopyRenderTask final : public GrRenderTask {
4040
bool onExecute(GrOpFlushState*) override;
4141

4242
#ifdef SK_DEBUG
43+
const char* name() const final { return "Copy"; }
4344
void visitProxies_debugOnly(const GrOp::VisitProxyFunc& fn) const override {
4445
fn(fSrcView.proxy(), GrMipMapped::kNo);
4546
}

src/gpu/GrOpsTask.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,12 @@ class GrOpsTask : public GrRenderTask {
110110

111111
void discard();
112112

113-
SkDEBUGCODE(void dump(bool printDependencies) const override;)
114-
SkDEBUGCODE(int numClips() const override { return fNumClips; })
115-
SkDEBUGCODE(void visitProxies_debugOnly(const GrOp::VisitProxyFunc&) const override;)
113+
#ifdef SK_DEBUG
114+
void dump(bool printDependencies) const override;
115+
const char* name() const final { return "Ops"; }
116+
int numClips() const override { return fNumClips; }
117+
void visitProxies_debugOnly(const GrOp::VisitProxyFunc&) const override;
118+
#endif
116119

117120
#if GR_TEST_UTILS
118121
int numOpChains() const { return fOpChains.count(); }

src/gpu/GrRenderTask.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ bool GrRenderTask::isInstantiated() const {
272272
void GrRenderTask::dump(bool printDependencies) const {
273273
SkDebugf("--------------------------------------------------------------\n");
274274
GrSurfaceProxy* proxy = fTargetView.proxy();
275-
SkDebugf("renderTaskID: %d - proxyID: %d - surfaceID: %d\n", fUniqueID,
275+
SkDebugf("%s - renderTaskID: %d - proxyID: %d - surfaceID: %d\n",
276+
this->name(), fUniqueID,
276277
proxy ? proxy->uniqueID().asUInt() : -1,
277278
proxy && proxy->peekSurface()
278279
? proxy->peekSurface()->uniqueID().asUInt()

src/gpu/GrRenderTask.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class GrRenderTask : public SkRefCnt {
7373
* Dump out the GrRenderTask dependency DAG
7474
*/
7575
virtual void dump(bool printDependencies) const;
76+
virtual const char* name() const = 0;
7677

7778
virtual int numClips() const { return 0; }
7879

src/gpu/GrTextureResolveRenderTask.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ class GrTextureResolveRenderTask final : public GrRenderTask {
3535
bool onExecute(GrOpFlushState*) override;
3636

3737
#ifdef SK_DEBUG
38-
SkDEBUGCODE(void visitProxies_debugOnly(const GrOp::VisitProxyFunc&) const override;)
38+
const char* name() const final { return "TextureResolve"; }
39+
void visitProxies_debugOnly(const GrOp::VisitProxyFunc&) const override;
3940
#endif
4041

4142
struct Resolve {

src/gpu/GrTransferFromRenderTask.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class GrTransferFromRenderTask final : public GrRenderTask {
4242
bool onExecute(GrOpFlushState*) override;
4343

4444
#ifdef SK_DEBUG
45+
const char* name() const final { return "TransferFrom"; }
4546
void visitProxies_debugOnly(const GrOp::VisitProxyFunc& fn) const override {
4647
fn(fSrcProxy.get(), GrMipMapped::kNo);
4748
}

src/gpu/GrWaitRenderTask.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class GrWaitRenderTask final : public GrRenderTask {
3636
bool onExecute(GrOpFlushState*) override;
3737

3838
#ifdef SK_DEBUG
39+
const char* name() const final { return "Wait"; }
3940
// No non-dst proxies.
4041
void visitProxies_debugOnly(const GrOp::VisitProxyFunc& fn) const override {}
4142
#endif

0 commit comments

Comments
 (0)