Also adds more overrides of GrBatch::dumpInfo.
This removes a use case of the GrPipeline member of GrDrawBatch.
Change-Id: I93f5f2993be41ffa290122f12a683d2bac453e1d
Reviewed-on: https://skia-review.googlesource.com/5354
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
fGeoData[i].fInnerRadius,
fGeoData[i].fOuterRadius);
}
+ string.append(DumpPipelineInfo(*this->pipeline()));
string.append(INHERITED::dumpInfo());
return string;
}
const char* name() const override { return "EllipseBatch"; }
+ SkString dumpInfo() const override {
+ SkString string;
+ string.appendf("Stroked: %d\n", fStroked);
+ for (const auto& geo : fGeoData) {
+ string.appendf("Color: 0x%08x Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f], "
+ "XRad: %.2f, YRad: %.2f, InnerXRad: %.2f, InnerYRad: %.2f\n",
+ geo.fColor,
+ geo.fDevBounds.fLeft, geo.fDevBounds.fTop,
+ geo.fDevBounds.fRight, geo.fDevBounds.fBottom,
+ geo.fXRadius,
+ geo.fYRadius,
+ geo.fInnerXRadius,
+ geo.fInnerYRadius);
+ }
+ string.append(DumpPipelineInfo(*this->pipeline()));
+ string.append(INHERITED::dumpInfo());
+ return string;
+ }
+
void computePipelineOptimizations(GrInitInvariantOutput* color,
GrInitInvariantOutput* coverage,
GrBatchToXPOverrides* overrides) const override {
const char* name() const override { return "DIEllipseBatch"; }
+ SkString dumpInfo() const override {
+ SkString string;
+ for (const auto& geo : fGeoData) {
+ string.appendf("Color: 0x%08x Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f], XRad: %.2f, "
+ "YRad: %.2f, InnerXRad: %.2f, InnerYRad: %.2f, GeoDX: %.2f, "
+ "GeoDY: %.2f\n",
+ geo.fColor,
+ geo.fBounds.fLeft, geo.fBounds.fTop,
+ geo.fBounds.fRight, geo.fBounds.fBottom,
+ geo.fXRadius,
+ geo.fYRadius,
+ geo.fInnerXRadius,
+ geo.fInnerYRadius,
+ geo.fGeoDx,
+ geo.fGeoDy);
+ }
+ string.append(DumpPipelineInfo(*this->pipeline()));
+ string.append(INHERITED::dumpInfo());
+ return string;
+ }
+
void computePipelineOptimizations(GrInitInvariantOutput* color,
GrInitInvariantOutput* coverage,
GrBatchToXPOverrides* overrides) const override {
fGeoData[i].fInnerRadius,
fGeoData[i].fOuterRadius);
}
+ string.append(DumpPipelineInfo(*this->pipeline()));
string.append(INHERITED::dumpInfo());
return string;
}
const char* name() const override { return "RRectEllipseRendererBatch"; }
+ SkString dumpInfo() const override {
+ SkString string;
+ string.appendf("Stroked: %d\n", fStroked);
+ for (const auto& geo : fGeoData) {
+ string.appendf("Color: 0x%08x Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f], "
+ "XRad: %.2f, YRad: %.2f, InnerXRad: %.2f, InnerYRad: %.2f\n",
+ geo.fColor,
+ geo.fDevBounds.fLeft, geo.fDevBounds.fTop,
+ geo.fDevBounds.fRight, geo.fDevBounds.fBottom,
+ geo.fXRadius,
+ geo.fYRadius,
+ geo.fInnerXRadius,
+ geo.fInnerYRadius);
+ }
+ string.append(DumpPipelineInfo(*this->pipeline()));
+ string.append(INHERITED::dumpInfo());
+ return string;
+ }
+
void computePipelineOptimizations(GrInitInvariantOutput* color,
GrInitInvariantOutput* coverage,
GrBatchToXPOverrides* overrides) const override {
const char* name() const override { return "AAConvexBatch"; }
+ SkString dumpInfo() const override {
+ SkString string;
+ for (const auto& geo : fGeoData) {
+ string.appendf("Color: 0x%08x\n", geo.fColor);
+ }
+ string.append(DumpPipelineInfo(*this->pipeline()));
+ string.append(INHERITED::dumpInfo());
+ return string;
+ }
+
void computePipelineOptimizations(GrInitInvariantOutput* color,
GrInitInvariantOutput* coverage,
GrBatchToXPOverrides* overrides) const override {
const char* name() const override { return "AADistanceFieldPathBatch"; }
+ SkString dumpInfo() const override {
+ SkString string;
+ for (const auto& geo : fGeoData) {
+ string.appendf("Color: 0x%08x AA:%d\n", geo.fColor, geo.fAntiAlias);
+ }
+ string.append(DumpPipelineInfo(*this->pipeline()));
+ string.append(INHERITED::dumpInfo());
+ return string;
+ }
+
void computePipelineOptimizations(GrInitInvariantOutput* color,
GrInitInvariantOutput* coverage,
GrBatchToXPOverrides* overrides) const override {
i, info->color(), rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
info = this->next(info);
}
+ str.append(DumpPipelineInfo(*this->pipeline()));
str.append(INHERITED::dumpInfo());
return str;
}
const char* name() const override { return "AAHairlineBatch"; }
+ SkString dumpInfo() const override {
+ SkString string;
+ for (const auto& geo : fGeoData) {
+ string.appendf("Color: 0x%08x Coverage: 0x%02x\n", geo.fColor, geo.fCoverage);
+ }
+ string.append(DumpPipelineInfo(*this->pipeline()));
+ string.append(INHERITED::dumpInfo());
+ return string;
+ }
+
void computePipelineOptimizations(GrInitInvariantOutput* color,
GrInitInvariantOutput* coverage,
GrBatchToXPOverrides* overrides) const override {
this->setTransformedBounds(bounds, viewMatrix, HasAABloat::kYes, IsZeroArea::kNo);
}
- const char* name() const override { return "AAConvexBatch"; }
+ const char* name() const override { return "AAFlatteningConvexBatch"; }
+
+ SkString dumpInfo() const override {
+ SkString string;
+ for (const auto& geo : fGeoData) {
+ string.appendf("Color: 0x%08x, StrokeWidth: %.2f, Style: %d, Join: %d, "
+ "MiterLimit: %.2f\n",
+ geo.fColor, geo.fStrokeWidth, geo.fStyle, geo.fJoin, geo.fMiterLimit);
+ }
+ string.append(DumpPipelineInfo(*this->pipeline()));
+ string.append(INHERITED::dumpInfo());
+ return string;
+ }
void computePipelineOptimizations(GrInitInvariantOutput* color,
GrInitInvariantOutput* coverage,
const char* name() const override { return "AAStrokeRect"; }
+ SkString dumpInfo() const override {
+ SkString string;
+ for (const auto& geo : fGeoData) {
+ string.appendf("Color: 0x%08x, ORect [L: %.2f, T: %.2f, R: %.2f, B: %.2f], "
+ "AssistORect [L: %.2f, T: %.2f, R: %.2f, B: %.2f], "
+ "IRect [L: %.2f, T: %.2f, R: %.2f, B: %.2f], Degen: %d",
+ geo.fColor,
+ geo.fDevOutside.fLeft, geo.fDevOutside.fTop,
+ geo.fDevOutside.fRight, geo.fDevOutside.fBottom,
+ geo.fDevOutsideAssist.fLeft, geo.fDevOutsideAssist.fTop,
+ geo.fDevOutsideAssist.fRight, geo.fDevOutsideAssist.fBottom,
+ geo.fDevInside.fLeft, geo.fDevInside.fTop,
+ geo.fDevInside.fRight, geo.fDevInside.fBottom,
+ geo.fDegenerate);
+ }
+ string.append(DumpPipelineInfo(*this->pipeline()));
+ string.append(INHERITED::dumpInfo());
+ return string;
+ }
+
void computePipelineOptimizations(GrInitInvariantOutput* color,
GrInitInvariantOutput* coverage,
GrBatchToXPOverrides* overrides) const override {
fGeoData[i].fHalfWidth,
fGeoData[i].fHalfHeight);
}
+ string.append(DumpPipelineInfo(*this->pipeline()));
string.append(INHERITED::dumpInfo());
return string;
}
fGeoData[i].fBlob->runCount());
}
+ str.append(DumpPipelineInfo(*this->pipeline()));
str.append(INHERITED::dumpInfo());
return str;
}
const char* name() const override { return "DefaultPathBatch"; }
+ SkString dumpInfo() const override {
+ SkString string;
+ for (const auto& geo : fGeoData) {
+ string.appendf("Color: 0x%08x Tolerance: %.2f\n", geo.fColor, geo.fTolerance);
+ }
+ string.append(DumpPipelineInfo(*this->pipeline()));
+ string.append(INHERITED::dumpInfo());
+ return string;
+ }
+
void computePipelineOptimizations(GrInitInvariantOutput* color,
GrInitInvariantOutput* coverage,
GrBatchToXPOverrides* overrides) const override {
const char* name() const override { return "DrawAtlasBatch"; }
+ SkString dumpInfo() const override {
+ SkString string;
+ for (const auto& geo : fGeoData) {
+ string.appendf("Color: 0x%08x, Quads: %d\n", geo.fColor, geo.fVerts.count() / 4);
+ }
+ string.append(DumpPipelineInfo(*this->pipeline()));
+ string.append(INHERITED::dumpInfo());
+ return string;
+ }
+
void computePipelineOptimizations(GrInitInvariantOutput* color,
GrInitInvariantOutput* coverage,
GrBatchToXPOverrides* overrides) const override {
return this->pipeline()->getRenderTarget()->uniqueID();
}
- SkString dumpInfo() const override {
+protected:
+ static SkString DumpPipelineInfo(const GrPipeline& pipeline) {
SkString string;
- string.appendf("RT: %d\n", this->renderTargetUniqueID().asUInt());
+ string.appendf("RT: %d\n", pipeline.getRenderTarget()->uniqueID().asUInt());
string.append("ColorStages:\n");
- for (int i = 0; i < this->pipeline()->numColorFragmentProcessors(); i++) {
+ for (int i = 0; i < pipeline.numColorFragmentProcessors(); i++) {
string.appendf("\t\t%s\n\t\t%s\n",
- this->pipeline()->getColorFragmentProcessor(i).name(),
- this->pipeline()->getColorFragmentProcessor(i).dumpInfo().c_str());
+ pipeline.getColorFragmentProcessor(i).name(),
+ pipeline.getColorFragmentProcessor(i).dumpInfo().c_str());
}
string.append("CoverageStages:\n");
- for (int i = 0; i < this->pipeline()->numCoverageFragmentProcessors(); i++) {
+ for (int i = 0; i < pipeline.numCoverageFragmentProcessors(); i++) {
string.appendf("\t\t%s\n\t\t%s\n",
- this->pipeline()->getCoverageFragmentProcessor(i).name(),
- this->pipeline()->getCoverageFragmentProcessor(i).dumpInfo().c_str());
+ pipeline.getCoverageFragmentProcessor(i).name(),
+ pipeline.getCoverageFragmentProcessor(i).dumpInfo().c_str());
}
- string.appendf("XP: %s\n", this->pipeline()->getXferProcessor().name());
+ string.appendf("XP: %s\n", pipeline.getXferProcessor().name());
- bool scissorEnabled = this->pipeline()->getScissorState().enabled();
+ bool scissorEnabled = pipeline.getScissorState().enabled();
string.appendf("Scissor: ");
if (scissorEnabled) {
string.appendf("[L: %d, T: %d, R: %d, B: %d]\n",
- this->pipeline()->getScissorState().rect().fLeft,
- this->pipeline()->getScissorState().rect().fTop,
- this->pipeline()->getScissorState().rect().fRight,
- this->pipeline()->getScissorState().rect().fBottom);
+ pipeline.getScissorState().rect().fLeft,
+ pipeline.getScissorState().rect().fTop,
+ pipeline.getScissorState().rect().fRight,
+ pipeline.getScissorState().rect().fBottom);
} else {
string.appendf("<disabled>\n");
}
- string.append(INHERITED::dumpInfo());
-
return string;
}
-protected:
const GrPipeline* pipeline() const {
SkASSERT(fPipelineInstalled);
return reinterpret_cast<const GrPipeline*>(fPipelineStorage.get());
SkString GrDrawPathBatch::dumpInfo() const {
SkString string;
string.printf("PATH: 0x%p", fPath.get());
+ string.append(DumpPipelineInfo(*this->pipeline()));
string.append(INHERITED::dumpInfo());
return string;
}
}
string.remove(string.size() - 2, 2);
string.append("]");
+ string.append(DumpPipelineInfo(*this->pipeline()));
string.append(INHERITED::dumpInfo());
return string;
}
const char* name() const override { return "DrawVerticesBatch"; }
+ SkString dumpInfo() const override {
+ SkString string;
+ string.appendf("PrimType: %d, VarColor: %d, VCount: %d, ICount: %d\n",
+ fPrimitiveType, fVariableColor, fVertexCount, fIndexCount);
+ string.append(DumpPipelineInfo(*this->pipeline()));
+ string.append(INHERITED::dumpInfo());
+ return string;
+ }
+
void computePipelineOptimizations(GrInitInvariantOutput* color,
GrInitInvariantOutput* coverage,
GrBatchToXPOverrides* overrides) const override;
const char* name() const override { return "MSAAPathBatch"; }
+ SkString dumpInfo() const override {
+ SkString string;
+ string.appendf("Indexed: %d\n", fIsIndexed);
+ for (const auto& path : fPaths) {
+ string.appendf("Color: 0x%08x\n", path.fColor);
+ }
+ string.append(DumpPipelineInfo(*this->pipeline()));
+ string.append(INHERITED::dumpInfo());
+ return string;
+ }
+
void computePipelineOptimizations(GrInitInvariantOutput* color,
GrInitInvariantOutput* coverage,
GrBatchToXPOverrides* overrides) const override {
fPatches[i].fDst.fRight, fPatches[i].fDst.fBottom);
}
+ str.append(DumpPipelineInfo(*this->pipeline()));
str.append(INHERITED::dumpInfo());
return str;
}
i, info.fColor,
info.fRect.fLeft, info.fRect.fTop, info.fRect.fRight, info.fRect.fBottom);
}
+ str.append(DumpPipelineInfo(*this->pipeline()));
str.append(INHERITED::dumpInfo());
return str;
}
i, geo.fColor,
geo.fRect.fLeft, geo.fRect.fTop, geo.fRect.fRight, geo.fRect.fBottom);
}
+ str.append(DumpPipelineInfo(*this->pipeline()));
str.append(INHERITED::dumpInfo());
return str;
}
const char* name() const override { return "NonAAStrokeRectBatch"; }
+ SkString dumpInfo() const override {
+ SkString string;
+ string.appendf("Color: 0x%08x, Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f], "
+ "StrokeWidth: %.2f\n",
+ fColor, fRect.fLeft, fRect.fTop, fRect.fRight, fRect.fBottom,
+ fStrokeWidth);
+ string.append(DumpPipelineInfo(*this->pipeline()));
+ string.append(INHERITED::dumpInfo());
+ return string;
+ }
+
void computePipelineOptimizations(GrInitInvariantOutput* color,
GrInitInvariantOutput* coverage,
GrBatchToXPOverrides* overrides) const override {
const char* name() const override { return "PLSBatch"; }
+ SkString dumpInfo() const override {
+ SkString string;
+ string.printf("Color 0x%08x, UsesLocalCoords: %d\n", fColor, fUsesLocalCoords);
+ string.append(DumpPipelineInfo(*this->pipeline()));
+ string.append(INHERITED::dumpInfo());
+ return string;
+ }
+
void computePipelineOptimizations(GrInitInvariantOutput* color,
GrInitInvariantOutput* coverage,
GrBatchToXPOverrides* overrides) const override {
SkPath path;
args.fShape->asPath(&path);
- sk_sp<GrDrawBatch> batch(new PLSPathBatch(args.fPaint->getColor(),
- path, *args.fViewMatrix));
+ sk_sp<GrDrawBatch> batch(new PLSPathBatch(args.fPaint->getColor(), path, *args.fViewMatrix));
GrPipelineBuilder pipelineBuilder(*args.fPaint,
args.fRenderTargetContext->mustUseHWAA(*args.fPaint));
str.appendf("%d: Color: 0x%08x, Region with %d rects\n",
i, info.fColor, info.fRegion.computeRegionComplexity());
}
+ str.append(DumpPipelineInfo(*this->pipeline()));
str.append(INHERITED::dumpInfo());
return str;
}
fGeoData[i].fOuterRadius, fGeoData[i].fInnerRadius,
fGeoData[i].fBlurRadius);
}
+ string.append(DumpPipelineInfo(*this->pipeline()));
string.append(INHERITED::dumpInfo());
return string;
}
fGeoData[i].fOuterRadius, fGeoData[i].fInnerRadius,
fGeoData[i].fBlurRadius);
}
+ string.append(DumpPipelineInfo(*this->pipeline()));
string.append(INHERITED::dumpInfo());
return string;
}
const char* name() const override { return "TessellatingPathBatch"; }
+ SkString dumpInfo() const override {
+ SkString string;
+ string.appendf("Color 0x%08x, aa: %d\n", fColor, fAntiAlias);
+ string.append(DumpPipelineInfo(*this->pipeline()));
+ string.append(INHERITED::dumpInfo());
+ return string;
+ }
+
void computePipelineOptimizations(GrInitInvariantOutput* color,
GrInitInvariantOutput* coverage,
GrBatchToXPOverrides* overrides) const override {
const char* name() const override { return "DashBatch"; }
+ SkString dumpInfo() const override {
+ SkString string;
+ for (const auto& geo : fGeoData) {
+ string.appendf("Pt0: [%.2f, %.2f], Pt1: [%.2f, %.2f], Width: %.2f, Ival0: %.2f, "
+ "Ival1 : %.2f, Phase: %.2f\n",
+ geo.fPtsRot[0].fX, geo.fPtsRot[0].fY,
+ geo.fPtsRot[1].fX, geo.fPtsRot[1].fY,
+ geo.fSrcStrokeWidth,
+ geo.fIntervals[0],
+ geo.fIntervals[1],
+ geo.fPhase);
+ }
+ string.append(DumpPipelineInfo(*this->pipeline()));
+ string.append(INHERITED::dumpInfo());
+ return string;
+ }
+
void computePipelineOptimizations(GrInitInvariantOutput* color,
GrInitInvariantOutput* coverage,
GrBatchToXPOverrides* overrides) const override {
~Batch() override;
const char* name() const override { return "Instanced Batch"; }
+ SkString dumpInfo() const override {
+ SkString string;
+ string.printf("AA: %d, ShapeTypes: 0x%02x, IShapeTypes: 0x%02x, Persp %d, "
+ "NonSquare: %d, PLoad: %0.2f, Tracked: %d, NumDraws: %d, "
+ "GeomChanges: %d\n",
+ (int)fInfo.fAntialiasMode,
+ fInfo.fShapeTypes,
+ fInfo.fInnerShapeTypes,
+ fInfo.fHasPerspective,
+ fInfo.fNonSquare,
+ fPixelLoad,
+ fIsTracked,
+ fNumDraws,
+ fNumChangesInGeometry);
+ string.append(DumpPipelineInfo(*this->pipeline()));
+ string.append(INHERITED::dumpInfo());
+ return string;
+ }
+
struct Draw {
Instance fInstance;
IndexRange fGeometry;