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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 typedef GrNonAtomicRef INHERITED; | 141 typedef GrNonAtomicRef INHERITED; |
142 }; | 142 }; |
143 | 143 |
144 // Template this if we decide to support index types other than 16bit | 144 // Template this if we decide to support index types other than 16bit |
145 class GrDrawPathRangeBatch final : public GrDrawPathBatchBase { | 145 class GrDrawPathRangeBatch final : public GrDrawPathBatchBase { |
146 public: | 146 public: |
147 DEFINE_BATCH_CLASS_ID | 147 DEFINE_BATCH_CLASS_ID |
148 | 148 |
149 // This can't return a more abstract type because we install the stencil set
tings late :( | 149 // This can't return a more abstract type because we install the stencil set
tings late :( |
150 static GrDrawPathBatchBase* Create(const SkMatrix& viewMatrix, const SkMatri
x& localMatrix, | 150 static GrDrawPathBatchBase* Create(const SkMatrix& viewMatrix, const SkMatri
x& localMatrix, |
151 GrColor color, GrPathRange* range, GrPath
RangeDraw* draw) { | 151 GrColor color, GrPathRange* range, GrPath
RangeDraw* draw, |
152 return new GrDrawPathRangeBatch(viewMatrix, localMatrix, color, range, d
raw); | 152 const SkRect& bounds) { |
| 153 return new GrDrawPathRangeBatch(viewMatrix, localMatrix, color, range, d
raw, bounds); |
153 } | 154 } |
154 | 155 |
155 ~GrDrawPathRangeBatch() override; | 156 ~GrDrawPathRangeBatch() override; |
156 | 157 |
157 const char* name() const override { return "DrawPathRange"; } | 158 const char* name() const override { return "DrawPathRange"; } |
158 | 159 |
159 SkString dumpInfo() const override; | 160 SkString dumpInfo() const override; |
160 | 161 |
161 private: | 162 private: |
162 inline bool isWinding() const; | 163 inline bool isWinding() const; |
163 | 164 |
164 GrDrawPathRangeBatch(const SkMatrix& viewMatrix, const SkMatrix& localMatrix
, GrColor color, | 165 GrDrawPathRangeBatch(const SkMatrix& viewMatrix, const SkMatrix& localMatrix
, GrColor color, |
165 GrPathRange* range, GrPathRangeDraw* draw); | 166 GrPathRange* range, GrPathRangeDraw* draw, const SkRect
& bounds); |
166 | 167 |
167 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override; | 168 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override; |
168 | 169 |
169 void onPrepare(GrBatchFlushState*) override {} | 170 void onPrepare(GrBatchFlushState*) override {} |
170 | 171 |
171 void onDraw(GrBatchFlushState* state) override; | 172 void onDraw(GrBatchFlushState* state) override; |
172 | 173 |
173 typedef GrPendingIOResource<const GrPathRange, kRead_GrIOType> PendingPathRa
nge; | 174 typedef GrPendingIOResource<const GrPathRange, kRead_GrIOType> PendingPathRa
nge; |
174 typedef SkTLList<GrPathRangeDraw*, 4> DrawList; | 175 typedef SkTLList<GrPathRangeDraw*, 4> DrawList; |
175 PendingPathRange fPathRange; | 176 PendingPathRange fPathRange; |
176 DrawList fDraws; | 177 DrawList fDraws; |
177 int fTotalPathCount; | 178 int fTotalPathCount; |
178 SkMatrix fLocalMatrix; | 179 SkMatrix fLocalMatrix; |
179 | 180 |
180 typedef GrDrawPathBatchBase INHERITED; | 181 typedef GrDrawPathBatchBase INHERITED; |
181 }; | 182 }; |
182 | 183 |
183 #endif | 184 #endif |
OLD | NEW |