From de83b41cc7fc5bd1398e06c011e698215261665f Mon Sep 17 00:00:00 2001 From: joshualitt Date: Thu, 14 Jan 2016 09:58:36 -0800 Subject: Add Audittrail for path renderers BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1588683002 Review URL: https://codereview.chromium.org/1588683002 --- src/gpu/GrDrawTarget.h | 2 ++ src/gpu/GrSoftwarePathRenderer.cpp | 1 + src/gpu/GrTest.cpp | 1 + src/gpu/batches/GrAAConvexPathRenderer.cpp | 1 + src/gpu/batches/GrAADistanceFieldPathRenderer.cpp | 2 ++ src/gpu/batches/GrAAHairLinePathRenderer.cpp | 1 + src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp | 2 ++ src/gpu/batches/GrDashLinePathRenderer.cpp | 1 + src/gpu/batches/GrDefaultPathRenderer.cpp | 2 ++ src/gpu/batches/GrStencilAndCoverPathRenderer.cpp | 4 ++++ src/gpu/batches/GrTessellatingPathRenderer.cpp | 2 ++ 11 files changed, 19 insertions(+) (limited to 'src') diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h index d16d6e8c45..55c11da667 100644 --- a/src/gpu/GrDrawTarget.h +++ b/src/gpu/GrDrawTarget.h @@ -167,6 +167,8 @@ public: const CMMAccess cmmAccess() { return CMMAccess(this); } + GrAuditTrail* getAuditTrail() const { return fAuditTrail; } + private: friend class GrDrawingManager; // for resetFlag & TopoSortTraits diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp index 28a4b9ccfe..af77c205b5 100644 --- a/src/gpu/GrSoftwarePathRenderer.cpp +++ b/src/gpu/GrSoftwarePathRenderer.cpp @@ -116,6 +116,7 @@ void draw_around_inv_path(GrDrawTarget* target, //////////////////////////////////////////////////////////////////////////////// // return true on success; false on failure bool GrSoftwarePathRenderer::onDrawPath(const DrawPathArgs& args) { + GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(), "GrSoftwarePathRenderer::onDrawPath"); if (nullptr == fContext) { return false; } diff --git a/src/gpu/GrTest.cpp b/src/gpu/GrTest.cpp index b83d67f39e..8174d76779 100644 --- a/src/gpu/GrTest.cpp +++ b/src/gpu/GrTest.cpp @@ -261,6 +261,7 @@ void GrDrawContext::internal_drawBatch(const GrPipelineBuilder& pipelineBuilder, ASSERT_SINGLE_OWNER RETURN_IF_ABANDONED SkDEBUGCODE(this->validate();) + GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::internal_drawBatch"); this->getDrawTarget()->drawBatch(pipelineBuilder, batch); } diff --git a/src/gpu/batches/GrAAConvexPathRenderer.cpp b/src/gpu/batches/GrAAConvexPathRenderer.cpp index cd8579c1f8..9fde34c186 100644 --- a/src/gpu/batches/GrAAConvexPathRenderer.cpp +++ b/src/gpu/batches/GrAAConvexPathRenderer.cpp @@ -1002,6 +1002,7 @@ private: }; bool GrAAConvexPathRenderer::onDrawPath(const DrawPathArgs& args) { + GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(), "GrAAConvexPathRenderer::onDrawPath"); if (args.fPath->isEmpty()) { return true; } diff --git a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp index fbc578e9ad..e94cd591f3 100644 --- a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp +++ b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp @@ -538,6 +538,8 @@ private: }; bool GrAADistanceFieldPathRenderer::onDrawPath(const DrawPathArgs& args) { + GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(), + "GrAADistanceFieldPathRenderer::onDrawPath"); // we've already bailed on inverse filled paths, so this is safe if (args.fPath->isEmpty()) { return true; diff --git a/src/gpu/batches/GrAAHairLinePathRenderer.cpp b/src/gpu/batches/GrAAHairLinePathRenderer.cpp index d6ad9d32c9..6b7b308900 100644 --- a/src/gpu/batches/GrAAHairLinePathRenderer.cpp +++ b/src/gpu/batches/GrAAHairLinePathRenderer.cpp @@ -974,6 +974,7 @@ static GrDrawBatch* create_hairline_batch(GrColor color, } bool GrAAHairLinePathRenderer::onDrawPath(const DrawPathArgs& args) { + GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(),"GrAAHairlinePathRenderer::onDrawPath"); SkIRect devClipBounds; GrRenderTarget* rt = args.fPipelineBuilder->getRenderTarget(); args.fPipelineBuilder->clip().getConservativeBounds(rt->width(), rt->height(), &devClipBounds); diff --git a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp index 0a6e5cfd72..c830509a2a 100644 --- a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp +++ b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp @@ -322,6 +322,8 @@ private: }; bool GrAALinearizingConvexPathRenderer::onDrawPath(const DrawPathArgs& args) { + GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(), + "GrAALinearizingConvexPathRenderer::onDrawPath"); if (args.fPath->isEmpty()) { return true; } diff --git a/src/gpu/batches/GrDashLinePathRenderer.cpp b/src/gpu/batches/GrDashLinePathRenderer.cpp index e26f5d7627..902dca6d86 100644 --- a/src/gpu/batches/GrDashLinePathRenderer.cpp +++ b/src/gpu/batches/GrDashLinePathRenderer.cpp @@ -19,6 +19,7 @@ bool GrDashLinePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const { } bool GrDashLinePathRenderer::onDrawPath(const DrawPathArgs& args) { + GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(), "GrDashLinePathRenderer::onDrawPath"); SkPoint pts[2]; SkAssertResult(args.fPath->isLine(pts)); return GrDashingEffect::DrawDashLine(args.fTarget, *args.fPipelineBuilder, args.fColor, diff --git a/src/gpu/batches/GrDefaultPathRenderer.cpp b/src/gpu/batches/GrDefaultPathRenderer.cpp index 8ed3155a68..c39a530645 100644 --- a/src/gpu/batches/GrDefaultPathRenderer.cpp +++ b/src/gpu/batches/GrDefaultPathRenderer.cpp @@ -730,6 +730,7 @@ bool GrDefaultPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const { } bool GrDefaultPathRenderer::onDrawPath(const DrawPathArgs& args) { + GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(), "GrDefaultPathRenderer::onDrawPath"); return this->internalDrawPath(args.fTarget, args.fPipelineBuilder, args.fColor, @@ -740,6 +741,7 @@ bool GrDefaultPathRenderer::onDrawPath(const DrawPathArgs& args) { } void GrDefaultPathRenderer::onStencilPath(const StencilPathArgs& args) { + GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(),"GrDefaultPathRenderer::onStencilPath"); SkASSERT(SkPath::kInverseEvenOdd_FillType != args.fPath->getFillType()); SkASSERT(SkPath::kInverseWinding_FillType != args.fPath->getFillType()); this->internalDrawPath(args.fTarget, args.fPipelineBuilder, GrColor_WHITE, *args.fViewMatrix, diff --git a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp index 6abe41e997..ada6dbf963 100644 --- a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp +++ b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp @@ -64,12 +64,16 @@ static GrPath* get_gr_path(GrResourceProvider* resourceProvider, const SkPath& s } void GrStencilAndCoverPathRenderer::onStencilPath(const StencilPathArgs& args) { + GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(), + "GrStencilAndCoverPathRenderer::onStencilPath"); SkASSERT(!args.fPath->isInverseFillType()); SkAutoTUnref p(get_gr_path(fResourceProvider, *args.fPath, *args.fStroke)); args.fTarget->stencilPath(*args.fPipelineBuilder, *args.fViewMatrix, p, p->getFillType()); } bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) { + GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(), + "GrStencilAndCoverPathRenderer::onDrawPath"); SkASSERT(!args.fStroke->isHairlineStyle()); const SkPath& path = *args.fPath; GrPipelineBuilder* pipelineBuilder = args.fPipelineBuilder; diff --git a/src/gpu/batches/GrTessellatingPathRenderer.cpp b/src/gpu/batches/GrTessellatingPathRenderer.cpp index 36b6d657cf..81436baec0 100644 --- a/src/gpu/batches/GrTessellatingPathRenderer.cpp +++ b/src/gpu/batches/GrTessellatingPathRenderer.cpp @@ -249,6 +249,8 @@ private: }; bool GrTessellatingPathRenderer::onDrawPath(const DrawPathArgs& args) { + GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(), + "GrTessellatingPathRenderer::onDrawPath"); SkASSERT(!args.fAntiAlias); const GrRenderTarget* rt = args.fPipelineBuilder->getRenderTarget(); if (nullptr == rt) { -- cgit v1.2.3