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