OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |