Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Unified Diff: src/gpu/batches/GrDrawPathBatch.cpp

Issue 1919843002: Revert of Batch multiple single NVPR draw paths to instanced draws (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/batches/GrDrawPathBatch.h ('k') | src/gpu/gl/GrGLPath.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrDrawPathBatch.cpp
diff --git a/src/gpu/batches/GrDrawPathBatch.cpp b/src/gpu/batches/GrDrawPathBatch.cpp
index fb9ca943dcb223d9bee72380dc0116ece2b53e37..1395d083286c7482a9c85bd5c0ef63adc81a0aca 100644
--- a/src/gpu/batches/GrDrawPathBatch.cpp
+++ b/src/gpu/batches/GrDrawPathBatch.cpp
@@ -13,84 +13,18 @@
SkString GrDrawPathBatch::dumpInfo() const {
SkString string;
- string.printf("Color: 0x%08x Fill: %x Path count: %d Paths: ", this->color(), this->fillType(),
- fTotalPathCount);
- const GrDrawPathBatch* batch = this;
- do {
- string.appendf("0x%p", batch->fPath.get());
- batch = batch->fNext.get();
- } while (batch);
- string.append("\n");
+ string.printf("PATH: 0x%p", fPath.get());
return string;
}
-bool GrDrawPathBatch::ListBoundsIntersects(const GrDrawPathBatch* a, const GrDrawPathBatch* b) {
- if (!SkRect::Intersects(a->fBounds, b->fBounds)) {
- return false;
- }
- if (!a->fNext && !b->fNext) {
- return true;
- }
- const GrDrawPathBatch* firstA = a;
- do {
- do {
- if (SkRect::Intersects(a->fPathBounds, b->fPathBounds)) {
- return true;
- }
- a = a->fNext.get();
- } while (a);
- a = firstA;
- b = b->fNext.get();
- } while (b);
- return false;
-}
-
-bool GrDrawPathBatch::onCombineIfPossible(GrBatch* t, const GrCaps& caps) {
- GrDrawPathBatch* that = t->cast<GrDrawPathBatch>();
- if (this->color() != that->color() ||
- !this->viewMatrix().cheapEqualTo(that->viewMatrix())) {
- return false;
- }
- if (!GrPipeline::AreEqual(*this->pipeline(), *that->pipeline(), false)) {
- return false;
- }
- if (that->fillType() != this->fillType() ||
- this->stencilSettings() != that->stencilSettings()) {
- return false;
- }
- if (ListBoundsIntersects(this, that)) {
- return false;
- }
- if (!fPath.get()->canCombineDrawPathBatchWith(*that->fPath.get())) {
- return false;
- }
- SkASSERT(!*fLastSlot);
- fLastSlot->reset(SkRef(that));
- fLastSlot = that->fLastSlot;
- fTotalPathCount += that->fTotalPathCount;
- this->joinBounds(that->fBounds);
- return true;
-}
-
void GrDrawPathBatch::onDraw(GrBatchFlushState* state) {
+ GrProgramDesc desc;
+
SkAutoTUnref<GrPathProcessor> pathProc(GrPathProcessor::Create(this->color(),
this->overrides(),
this->viewMatrix()));
- if (fTotalPathCount > 1) {
- SkAutoSTMalloc<32, const GrPath*> paths(fTotalPathCount);
- GrDrawPathBatch* batch = this;
- int i = 0;
- do {
- paths[i++] = batch->fPath.get();
- batch = batch->fNext.get();
- } while (batch);
- state->gpu()->pathRendering()->drawPaths(*this->pipeline(), *pathProc,
- this->stencilSettings(), paths, fTotalPathCount);
- } else {
- const GrPath* path = fPath.get();
- state->gpu()->pathRendering()->drawPaths(*this->pipeline(), *pathProc,
- this->stencilSettings(), &path, 1);
- }
+ state->gpu()->pathRendering()->drawPath(*this->pipeline(), *pathProc, this->stencilSettings(),
+ fPath.get());
}
SkString GrDrawPathRangeBatch::dumpInfo() const {
« no previous file with comments | « src/gpu/batches/GrDrawPathBatch.h ('k') | src/gpu/gl/GrGLPath.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698