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

Side by Side Diff: src/gpu/batches/GrDrawPathBatch.h

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 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) {
83 fBounds = path->getBounds(); 80 fBounds = path->getBounds();
84 viewMatrix.mapRect(&fBounds); 81 viewMatrix.mapRect(&fBounds);
85 fPathBounds = fBounds;
86 } 82 }
87 static bool ListBoundsIntersects(const GrDrawPathBatch* a, const GrDrawPathB atch* b); 83
88 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override; 84 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override { return f alse; }
89 85
90 void onPrepare(GrBatchFlushState*) override {} 86 void onPrepare(GrBatchFlushState*) override {}
91 87
92 void onDraw(GrBatchFlushState* state) override; 88 void onDraw(GrBatchFlushState* state) override;
93 89
94 GrPendingIOResource<const GrPath, kRead_GrIOType> fPath; 90 GrPendingIOResource<const GrPath, kRead_GrIOType> fPath;
95 SkRect fPathBounds; 91
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;
99 typedef GrDrawPathBatchBase INHERITED; 92 typedef GrDrawPathBatchBase INHERITED;
100 }; 93 };
101 94
102 // Template this if we decide to support index types other than 16bit 95 // Template this if we decide to support index types other than 16bit
103 class GrDrawPathRangeBatch final : public GrDrawPathBatchBase { 96 class GrDrawPathRangeBatch final : public GrDrawPathBatchBase {
104 public: 97 public:
105 typedef GrPathRendering::PathTransformType TransformType; 98 typedef GrPathRendering::PathTransformType TransformType;
106 99
107 DEFINE_BATCH_CLASS_ID 100 DEFINE_BATCH_CLASS_ID
108 101
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 200
208 PendingPathRange fPathRange; 201 PendingPathRange fPathRange;
209 DrawList fDraws; 202 DrawList fDraws;
210 int fTotalPathCount; 203 int fTotalPathCount;
211 SkScalar fScale; 204 SkScalar fScale;
212 205
213 typedef GrDrawPathBatchBase INHERITED; 206 typedef GrDrawPathBatchBase INHERITED;
214 }; 207 };
215 208
216 #endif 209 #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