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:
parent
e5286e0b37
commit
de83b41cc7
@ -167,6 +167,8 @@ public:
|
|||||||
|
|
||||||
const CMMAccess cmmAccess() { return CMMAccess(this); }
|
const CMMAccess cmmAccess() { return CMMAccess(this); }
|
||||||
|
|
||||||
|
GrAuditTrail* getAuditTrail() const { return fAuditTrail; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class GrDrawingManager; // for resetFlag & TopoSortTraits
|
friend class GrDrawingManager; // for resetFlag & TopoSortTraits
|
||||||
|
|
||||||
|
@ -116,6 +116,7 @@ void draw_around_inv_path(GrDrawTarget* target,
|
|||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// return true on success; false on failure
|
// return true on success; false on failure
|
||||||
bool GrSoftwarePathRenderer::onDrawPath(const DrawPathArgs& args) {
|
bool GrSoftwarePathRenderer::onDrawPath(const DrawPathArgs& args) {
|
||||||
|
GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(), "GrSoftwarePathRenderer::onDrawPath");
|
||||||
if (nullptr == fContext) {
|
if (nullptr == fContext) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -261,6 +261,7 @@ void GrDrawContext::internal_drawBatch(const GrPipelineBuilder& pipelineBuilder,
|
|||||||
ASSERT_SINGLE_OWNER
|
ASSERT_SINGLE_OWNER
|
||||||
RETURN_IF_ABANDONED
|
RETURN_IF_ABANDONED
|
||||||
SkDEBUGCODE(this->validate();)
|
SkDEBUGCODE(this->validate();)
|
||||||
|
GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::internal_drawBatch");
|
||||||
|
|
||||||
this->getDrawTarget()->drawBatch(pipelineBuilder, batch);
|
this->getDrawTarget()->drawBatch(pipelineBuilder, batch);
|
||||||
}
|
}
|
||||||
|
@ -1002,6 +1002,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
bool GrAAConvexPathRenderer::onDrawPath(const DrawPathArgs& args) {
|
bool GrAAConvexPathRenderer::onDrawPath(const DrawPathArgs& args) {
|
||||||
|
GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(), "GrAAConvexPathRenderer::onDrawPath");
|
||||||
if (args.fPath->isEmpty()) {
|
if (args.fPath->isEmpty()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -538,6 +538,8 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
bool GrAADistanceFieldPathRenderer::onDrawPath(const DrawPathArgs& args) {
|
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
|
// we've already bailed on inverse filled paths, so this is safe
|
||||||
if (args.fPath->isEmpty()) {
|
if (args.fPath->isEmpty()) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -974,6 +974,7 @@ static GrDrawBatch* create_hairline_batch(GrColor color,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool GrAAHairLinePathRenderer::onDrawPath(const DrawPathArgs& args) {
|
bool GrAAHairLinePathRenderer::onDrawPath(const DrawPathArgs& args) {
|
||||||
|
GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(),"GrAAHairlinePathRenderer::onDrawPath");
|
||||||
SkIRect devClipBounds;
|
SkIRect devClipBounds;
|
||||||
GrRenderTarget* rt = args.fPipelineBuilder->getRenderTarget();
|
GrRenderTarget* rt = args.fPipelineBuilder->getRenderTarget();
|
||||||
args.fPipelineBuilder->clip().getConservativeBounds(rt->width(), rt->height(), &devClipBounds);
|
args.fPipelineBuilder->clip().getConservativeBounds(rt->width(), rt->height(), &devClipBounds);
|
||||||
|
@ -322,6 +322,8 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
bool GrAALinearizingConvexPathRenderer::onDrawPath(const DrawPathArgs& args) {
|
bool GrAALinearizingConvexPathRenderer::onDrawPath(const DrawPathArgs& args) {
|
||||||
|
GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(),
|
||||||
|
"GrAALinearizingConvexPathRenderer::onDrawPath");
|
||||||
if (args.fPath->isEmpty()) {
|
if (args.fPath->isEmpty()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ bool GrDashLinePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool GrDashLinePathRenderer::onDrawPath(const DrawPathArgs& args) {
|
bool GrDashLinePathRenderer::onDrawPath(const DrawPathArgs& args) {
|
||||||
|
GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(), "GrDashLinePathRenderer::onDrawPath");
|
||||||
SkPoint pts[2];
|
SkPoint pts[2];
|
||||||
SkAssertResult(args.fPath->isLine(pts));
|
SkAssertResult(args.fPath->isLine(pts));
|
||||||
return GrDashingEffect::DrawDashLine(args.fTarget, *args.fPipelineBuilder, args.fColor,
|
return GrDashingEffect::DrawDashLine(args.fTarget, *args.fPipelineBuilder, args.fColor,
|
||||||
|
@ -730,6 +730,7 @@ bool GrDefaultPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool GrDefaultPathRenderer::onDrawPath(const DrawPathArgs& args) {
|
bool GrDefaultPathRenderer::onDrawPath(const DrawPathArgs& args) {
|
||||||
|
GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(), "GrDefaultPathRenderer::onDrawPath");
|
||||||
return this->internalDrawPath(args.fTarget,
|
return this->internalDrawPath(args.fTarget,
|
||||||
args.fPipelineBuilder,
|
args.fPipelineBuilder,
|
||||||
args.fColor,
|
args.fColor,
|
||||||
@ -740,6 +741,7 @@ bool GrDefaultPathRenderer::onDrawPath(const DrawPathArgs& args) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GrDefaultPathRenderer::onStencilPath(const StencilPathArgs& 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::kInverseEvenOdd_FillType != args.fPath->getFillType());
|
||||||
SkASSERT(SkPath::kInverseWinding_FillType != args.fPath->getFillType());
|
SkASSERT(SkPath::kInverseWinding_FillType != args.fPath->getFillType());
|
||||||
this->internalDrawPath(args.fTarget, args.fPipelineBuilder, GrColor_WHITE, *args.fViewMatrix,
|
this->internalDrawPath(args.fTarget, args.fPipelineBuilder, GrColor_WHITE, *args.fViewMatrix,
|
||||||
|
@ -64,12 +64,16 @@ static GrPath* get_gr_path(GrResourceProvider* resourceProvider, const SkPath& s
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GrStencilAndCoverPathRenderer::onStencilPath(const StencilPathArgs& args) {
|
void GrStencilAndCoverPathRenderer::onStencilPath(const StencilPathArgs& args) {
|
||||||
|
GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(),
|
||||||
|
"GrStencilAndCoverPathRenderer::onStencilPath");
|
||||||
SkASSERT(!args.fPath->isInverseFillType());
|
SkASSERT(!args.fPath->isInverseFillType());
|
||||||
SkAutoTUnref<GrPath> p(get_gr_path(fResourceProvider, *args.fPath, *args.fStroke));
|
SkAutoTUnref<GrPath> p(get_gr_path(fResourceProvider, *args.fPath, *args.fStroke));
|
||||||
args.fTarget->stencilPath(*args.fPipelineBuilder, *args.fViewMatrix, p, p->getFillType());
|
args.fTarget->stencilPath(*args.fPipelineBuilder, *args.fViewMatrix, p, p->getFillType());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) {
|
bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) {
|
||||||
|
GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(),
|
||||||
|
"GrStencilAndCoverPathRenderer::onDrawPath");
|
||||||
SkASSERT(!args.fStroke->isHairlineStyle());
|
SkASSERT(!args.fStroke->isHairlineStyle());
|
||||||
const SkPath& path = *args.fPath;
|
const SkPath& path = *args.fPath;
|
||||||
GrPipelineBuilder* pipelineBuilder = args.fPipelineBuilder;
|
GrPipelineBuilder* pipelineBuilder = args.fPipelineBuilder;
|
||||||
|
@ -249,6 +249,8 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
bool GrTessellatingPathRenderer::onDrawPath(const DrawPathArgs& args) {
|
bool GrTessellatingPathRenderer::onDrawPath(const DrawPathArgs& args) {
|
||||||
|
GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(),
|
||||||
|
"GrTessellatingPathRenderer::onDrawPath");
|
||||||
SkASSERT(!args.fAntiAlias);
|
SkASSERT(!args.fAntiAlias);
|
||||||
const GrRenderTarget* rt = args.fPipelineBuilder->getRenderTarget();
|
const GrRenderTarget* rt = args.fPipelineBuilder->getRenderTarget();
|
||||||
if (nullptr == rt) {
|
if (nullptr == rt) {
|
||||||
|
Loading…
Reference in New Issue
Block a user