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
This commit is contained in:
joshualitt 2016-01-14 09:58:36 -08:00 committed by Commit bot
parent e5286e0b37
commit de83b41cc7
11 changed files with 19 additions and 0 deletions

View File

@ -167,6 +167,8 @@ public:
const CMMAccess cmmAccess() { return CMMAccess(this); }
GrAuditTrail* getAuditTrail() const { return fAuditTrail; }
private:
friend class GrDrawingManager; // for resetFlag & TopoSortTraits

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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);

View File

@ -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;
}

View File

@ -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,

View File

@ -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,

View File

@ -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<GrPath> 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;

View File

@ -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) {