aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-06-14 12:30:35 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-15 19:10:28 +0000
commit82dfd3d1b2e173e10d2b4b7ac6c843554a1b229f (patch)
treea6994b5b92d4c65a43b246cd03c9796c5b6452ce /src/gpu
parent8ea60736aaa92cf3cf24705fb356e9e09e85b1fd (diff)
Add processor info dumping to non-legacy mesh draw ops
Change-Id: I2ee77f0971a1b627905ac547bc0511042c40ac38 Reviewed-on: https://skia-review.googlesource.com/19816 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrPipeline.h20
-rw-r--r--src/gpu/GrProcessorSet.cpp50
-rw-r--r--src/gpu/GrProcessorSet.h2
-rw-r--r--src/gpu/ops/GrAAFillRectOp.cpp2
-rw-r--r--src/gpu/ops/GrAAStrokeRectOp.cpp3
-rw-r--r--src/gpu/ops/GrNonAAFillRectOp.cpp5
-rw-r--r--src/gpu/ops/GrNonAAStrokeRectOp.cpp3
-rw-r--r--src/gpu/ops/GrOvalOpFactory.cpp15
-rw-r--r--src/gpu/ops/GrSimpleMeshDrawOpHelper.h27
9 files changed, 119 insertions, 8 deletions
diff --git a/src/gpu/GrPipeline.h b/src/gpu/GrPipeline.h
index 8d2f245e8d..5e22cc53b8 100644
--- a/src/gpu/GrPipeline.h
+++ b/src/gpu/GrPipeline.h
@@ -238,6 +238,26 @@ public:
GrXferBarrierType xferBarrierType(const GrCaps& caps) const;
+ static SkString DumpFlags(uint32_t flags) {
+ if (flags) {
+ SkString result;
+ if (flags & GrPipeline::kSnapVerticesToPixelCenters_Flag) {
+ result.append("Snap vertices to pixel center.\n");
+ }
+ if (flags & GrPipeline::kHWAntialias_Flag) {
+ result.append("HW Antialiasing enabled.\n");
+ }
+ if (flags & GrPipeline::kDisableOutputConversionToSRGB_Flag) {
+ result.append("Disable output conversion to sRGB.\n");
+ }
+ if (flags & GrPipeline::kAllowSRGBInputs_Flag) {
+ result.append("Allow sRGB Inputs.\n");
+ }
+ return result;
+ }
+ return SkString("No pipeline flags\n");
+ }
+
private:
void markAsBad() { fFlags |= kIsBad_Flag; }
diff --git a/src/gpu/GrProcessorSet.cpp b/src/gpu/GrProcessorSet.cpp
index 01de53d94d..e073679d44 100644
--- a/src/gpu/GrProcessorSet.cpp
+++ b/src/gpu/GrProcessorSet.cpp
@@ -47,6 +47,56 @@ GrProcessorSet::~GrProcessorSet() {
}
}
+SkString dump_fragment_processor_tree(const GrFragmentProcessor* fp, int indentCnt) {
+ SkString result;
+ SkString indentString;
+ for (int i = 0; i < indentCnt; ++i) {
+ indentString.append(" ");
+ }
+ result.appendf("%s%s %s \n", indentString.c_str(), fp->name(), fp->dumpInfo().c_str());
+ if (fp->numChildProcessors()) {
+ for (int i = 0; i < fp->numChildProcessors(); ++i) {
+ result += dump_fragment_processor_tree(&fp->childProcessor(i), indentCnt + 1);
+ }
+ }
+ return result;
+}
+
+SkString GrProcessorSet::dumpProcessors() const {
+ SkString result;
+ if (this->numFragmentProcessors()) {
+ if (this->numColorFragmentProcessors()) {
+ result.append("Color Fragment Processors:\n");
+ for (int i = 0; i < this->numColorFragmentProcessors(); ++i) {
+ result += dump_fragment_processor_tree(this->colorFragmentProcessor(i), 1);
+ }
+ } else {
+ result.append("No color fragment processors.\n");
+ }
+ if (this->numCoverageFragmentProcessors()) {
+ result.append("Coverage Fragment Processors:\n");
+ for (int i = 0; i < this->numColorFragmentProcessors(); ++i) {
+ result += dump_fragment_processor_tree(this->coverageFragmentProcessor(i), 1);
+ }
+ } else {
+ result.append("No coverage fragment processors.\n");
+ }
+ } else {
+ result.append("No color or coverage fragment processors.\n");
+ }
+ if (this->isFinalized()) {
+ result.append("Xfer Processor: ");
+ if (this->xferProcessor()) {
+ result.appendf("%s\n", this->xferProcessor()->name());
+ } else {
+ result.append("SrcOver\n");
+ }
+ } else {
+ result.append("XP Factory dumping not implemented.\n");
+ }
+ return result;
+}
+
bool GrProcessorSet::operator==(const GrProcessorSet& that) const {
SkASSERT(this->isFinalized());
SkASSERT(that.isFinalized());
diff --git a/src/gpu/GrProcessorSet.h b/src/gpu/GrProcessorSet.h
index d7cecedc47..407d71e080 100644
--- a/src/gpu/GrProcessorSet.h
+++ b/src/gpu/GrProcessorSet.h
@@ -135,6 +135,8 @@ public:
static const GrProcessorSet& EmptySet();
static constexpr const Analysis EmptySetAnalysis() { return Analysis(Empty::kEmpty); }
+ SkString dumpProcessors() const;
+
private:
GrProcessorSet(Empty) : fXP((const GrXferProcessor*)nullptr), fFlags(kFinalized_Flag) {}
diff --git a/src/gpu/ops/GrAAFillRectOp.cpp b/src/gpu/ops/GrAAFillRectOp.cpp
index ec190c786c..db856b2d0e 100644
--- a/src/gpu/ops/GrAAFillRectOp.cpp
+++ b/src/gpu/ops/GrAAFillRectOp.cpp
@@ -212,6 +212,8 @@ public:
info->color(), rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
info = this->next(info);
}
+ str += fHelper.dumpInfo();
+ str += INHERITED::dumpInfo();
return str;
}
diff --git a/src/gpu/ops/GrAAStrokeRectOp.cpp b/src/gpu/ops/GrAAStrokeRectOp.cpp
index 82b4ec13fa..e42358318a 100644
--- a/src/gpu/ops/GrAAStrokeRectOp.cpp
+++ b/src/gpu/ops/GrAAStrokeRectOp.cpp
@@ -184,7 +184,8 @@ public:
info.fDevOutsideAssist.fBottom, info.fDevInside.fLeft, info.fDevInside.fTop,
info.fDevInside.fRight, info.fDevInside.fBottom, info.fDegenerate);
}
- string.append(INHERITED::dumpInfo());
+ string += fHelper.dumpInfo();
+ string += INHERITED::dumpInfo();
return string;
}
diff --git a/src/gpu/ops/GrNonAAFillRectOp.cpp b/src/gpu/ops/GrNonAAFillRectOp.cpp
index c30f4a198c..2fd44f82c7 100644
--- a/src/gpu/ops/GrNonAAFillRectOp.cpp
+++ b/src/gpu/ops/GrNonAAFillRectOp.cpp
@@ -149,6 +149,8 @@ public:
info.fColor, info.fRect.fLeft, info.fRect.fTop, info.fRect.fRight,
info.fRect.fBottom);
}
+ str += fHelper.dumpInfo();
+ str += INHERITED::dumpInfo();
return str;
}
@@ -265,7 +267,8 @@ public:
geo.fColor, geo.fRect.fLeft, geo.fRect.fTop, geo.fRect.fRight,
geo.fRect.fBottom);
}
- str.append(INHERITED::dumpInfo());
+ str += fHelper.dumpInfo();
+ str += INHERITED::dumpInfo();
return str;
}
diff --git a/src/gpu/ops/GrNonAAStrokeRectOp.cpp b/src/gpu/ops/GrNonAAStrokeRectOp.cpp
index 4177b6526e..016c637fb2 100644
--- a/src/gpu/ops/GrNonAAStrokeRectOp.cpp
+++ b/src/gpu/ops/GrNonAAStrokeRectOp.cpp
@@ -63,7 +63,8 @@ public:
"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(INHERITED::dumpInfo());
+ string += fHelper.dumpInfo();
+ string += INHERITED::dumpInfo();
return string;
}
diff --git a/src/gpu/ops/GrOvalOpFactory.cpp b/src/gpu/ops/GrOvalOpFactory.cpp
index 15c2569334..0eedc425e8 100644
--- a/src/gpu/ops/GrOvalOpFactory.cpp
+++ b/src/gpu/ops/GrOvalOpFactory.cpp
@@ -795,7 +795,8 @@ public:
fCircles[i].fDevBounds.fRight, fCircles[i].fDevBounds.fBottom,
fCircles[i].fInnerRadius, fCircles[i].fOuterRadius);
}
- string.append(INHERITED::dumpInfo());
+ string += fHelper.dumpInfo();
+ string += INHERITED::dumpInfo();
return string;
}
@@ -1257,7 +1258,8 @@ public:
geo.fDevBounds.fBottom, geo.fXRadius, geo.fYRadius, geo.fInnerXRadius,
geo.fInnerYRadius);
}
- string.append(INHERITED::dumpInfo());
+ string += fHelper.dumpInfo();
+ string += INHERITED::dumpInfo();
return string;
}
@@ -1482,7 +1484,8 @@ public:
geo.fBounds.fBottom, geo.fXRadius, geo.fYRadius, geo.fInnerXRadius,
geo.fInnerYRadius, geo.fGeoDx, geo.fGeoDy);
}
- string.append(INHERITED::dumpInfo());
+ string += fHelper.dumpInfo();
+ string += INHERITED::dumpInfo();
return string;
}
@@ -1794,7 +1797,8 @@ public:
fRRects[i].fDevBounds.fRight, fRRects[i].fDevBounds.fBottom,
fRRects[i].fInnerRadius, fRRects[i].fOuterRadius);
}
- string.append(INHERITED::dumpInfo());
+ string += fHelper.dumpInfo();
+ string += INHERITED::dumpInfo();
return string;
}
@@ -2147,7 +2151,8 @@ public:
geo.fDevBounds.fBottom, geo.fXRadius, geo.fYRadius, geo.fInnerXRadius,
geo.fInnerYRadius);
}
- string.append(INHERITED::dumpInfo());
+ string += fHelper.dumpInfo();
+ string += INHERITED::dumpInfo();
return string;
}
diff --git a/src/gpu/ops/GrSimpleMeshDrawOpHelper.h b/src/gpu/ops/GrSimpleMeshDrawOpHelper.h
index 903859c309..f0a21fb69e 100644
--- a/src/gpu/ops/GrSimpleMeshDrawOpHelper.h
+++ b/src/gpu/ops/GrSimpleMeshDrawOpHelper.h
@@ -137,6 +137,27 @@ public:
friend class GrSimpleMeshDrawOpHelper;
};
+ SkString dumpInfo() const {
+ SkString result = this->processors().dumpProcessors();
+ result.append("AA Type: ");
+ switch (this->aaType()) {
+ case GrAAType::kNone:
+ result.append(" none\n");
+ break;
+ case GrAAType::kCoverage:
+ result.append(" coverage\n");
+ break;
+ case GrAAType::kMSAA:
+ result.append(" msaa\n");
+ break;
+ case GrAAType::kMixedSamples:
+ result.append(" mixed samples\n");
+ break;
+ }
+ result.append(GrPipeline::DumpFlags(fPipelineFlags));
+ return result;
+ }
+
protected:
GrAAType aaType() const { return static_cast<GrAAType>(fAAType); }
uint32_t pipelineFlags() const { return fPipelineFlags; }
@@ -214,6 +235,12 @@ public:
return target->allocPipeline(args);
}
+ SkString dumpInfo() const {
+ SkString result = INHERITED::dumpInfo();
+ result.appendf("Stencil settings: %s\n", (fStencilSettings ? "yes" : "no"));
+ return result;
+ }
+
private:
const GrUserStencilSettings* fStencilSettings;
typedef GrSimpleMeshDrawOpHelper INHERITED;