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

Side by Side 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, 7 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 unified diff | Download patch
« no previous file with comments | « src/gpu/batches/GrBatch.h ('k') | src/gpu/batches/GrDrawPathBatch.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrDrawPathBatch_DEFINED 8 #ifndef GrDrawPathBatch_DEFINED
9 #define GrDrawPathBatch_DEFINED 9 #define GrDrawPathBatch_DEFINED
10 10
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 } 69 }
70 70
71 const char* name() const override { return "DrawPath"; } 71 const char* name() const override { return "DrawPath"; }
72 72
73 SkString dumpInfo() const override; 73 SkString dumpInfo() const override;
74 74
75 private: 75 private:
76 GrDrawPathBatch(const SkMatrix& viewMatrix, GrColor color, GrPathRendering:: FillType fill, 76 GrDrawPathBatch(const SkMatrix& viewMatrix, GrColor color, GrPathRendering:: FillType fill,
77 const GrPath* path) 77 const GrPath* path)
78 : INHERITED(ClassID(), viewMatrix, color, fill) 78 : INHERITED(ClassID(), viewMatrix, color, fill)
79 , fPath(path) { 79 , fPath(path)
80 , fNext(nullptr)
81 , fLastSlot(&fNext)
82 , fTotalPathCount(1) {
80 fBounds = path->getBounds(); 83 fBounds = path->getBounds();
81 viewMatrix.mapRect(&fBounds); 84 viewMatrix.mapRect(&fBounds);
85 fPathBounds = fBounds;
82 } 86 }
83 87 static bool ListBoundsIntersects(const GrDrawPathBatch* a, const GrDrawPathB atch* b);
84 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override { return f alse; } 88 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override;
85 89
86 void onPrepare(GrBatchFlushState*) override {} 90 void onPrepare(GrBatchFlushState*) override {}
87 91
88 void onDraw(GrBatchFlushState* state) override; 92 void onDraw(GrBatchFlushState* state) override;
89 93
90 GrPendingIOResource<const GrPath, kRead_GrIOType> fPath; 94 GrPendingIOResource<const GrPath, kRead_GrIOType> fPath;
91 95 SkRect fPathBounds;
96 sk_sp<GrDrawPathBatch> fNext; // Batch union is made with a linked lis t of batch nodes.
97 sk_sp<GrDrawPathBatch>* fLastSlot; // Points to the fNext of the last batch in the batch list.
98 int fTotalPathCount;
92 typedef GrDrawPathBatchBase INHERITED; 99 typedef GrDrawPathBatchBase INHERITED;
93 }; 100 };
94 101
95 // Template this if we decide to support index types other than 16bit 102 // Template this if we decide to support index types other than 16bit
96 class GrDrawPathRangeBatch final : public GrDrawPathBatchBase { 103 class GrDrawPathRangeBatch final : public GrDrawPathBatchBase {
97 public: 104 public:
98 typedef GrPathRendering::PathTransformType TransformType; 105 typedef GrPathRendering::PathTransformType TransformType;
99 106
100 DEFINE_BATCH_CLASS_ID 107 DEFINE_BATCH_CLASS_ID
101 108
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 207
201 PendingPathRange fPathRange; 208 PendingPathRange fPathRange;
202 DrawList fDraws; 209 DrawList fDraws;
203 int fTotalPathCount; 210 int fTotalPathCount;
204 SkScalar fScale; 211 SkScalar fScale;
205 212
206 typedef GrDrawPathBatchBase INHERITED; 213 typedef GrDrawPathBatchBase INHERITED;
207 }; 214 };
208 215
209 #endif 216 #endif
OLDNEW
« 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