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

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

Issue 1908433002: Batch multiple single NVPR draw paths to instanced draws Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: address review comments 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/GrBatch.h ('k') | src/gpu/batches/GrDrawPathBatch.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrDrawPathBatch.h
diff --git a/src/gpu/batches/GrDrawPathBatch.h b/src/gpu/batches/GrDrawPathBatch.h
index d29d046de3c9607b452a736dac3d74eb8a79897c..6d5c69a3466fb82c6a43a752c4f343fc890d23c4 100644
--- a/src/gpu/batches/GrDrawPathBatch.h
+++ b/src/gpu/batches/GrDrawPathBatch.h
@@ -76,19 +76,26 @@ private:
GrDrawPathBatch(const SkMatrix& viewMatrix, GrColor color, GrPathRendering::FillType fill,
const GrPath* path)
: INHERITED(ClassID(), viewMatrix, color, fill)
- , fPath(path) {
+ , fPath(path)
+ , fNext(nullptr)
+ , fLastSlot(&fNext)
+ , fTotalPathCount(1) {
fBounds = path->getBounds();
viewMatrix.mapRect(&fBounds);
+ fPathBounds = fBounds;
}
-
- bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override { return false; }
+ static bool ListBoundsIntersects(const GrDrawPathBatch* a, const GrDrawPathBatch* b);
+ bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override;
void onPrepare(GrBatchFlushState*) override {}
void onDraw(GrBatchFlushState* state) override;
GrPendingIOResource<const GrPath, kRead_GrIOType> fPath;
-
+ SkRect fPathBounds;
+ sk_sp<GrDrawPathBatch> fNext; // Batch union is made with a linked list of batch nodes.
+ sk_sp<GrDrawPathBatch>* fLastSlot; // Points to the fNext of the last batch in the batch list.
+ int fTotalPathCount;
typedef GrDrawPathBatchBase INHERITED;
};
« no previous file with comments | « src/gpu/batches/GrBatch.h ('k') | src/gpu/batches/GrDrawPathBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698