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 #include "GrAAStrokeRectBatch.h" | 8 #include "GrAAStrokeRectBatch.h" |
9 | 9 |
10 #include "GrDefaultGeoProcFactory.h" | 10 #include "GrDefaultGeoProcFactory.h" |
(...skipping 185 matching lines...) Loading... |
196 }; | 196 }; |
197 GR_STATIC_ASSERT(SK_ARRAY_COUNT(gBevelIndices) == kBevelIndexCnt); | 197 GR_STATIC_ASSERT(SK_ARRAY_COUNT(gBevelIndices) == kBevelIndexCnt); |
198 | 198 |
199 GR_DEFINE_STATIC_UNIQUE_KEY(gBevelIndexBufferKey); | 199 GR_DEFINE_STATIC_UNIQUE_KEY(gBevelIndexBufferKey); |
200 return resourceProvider->findOrCreateInstancedIndexBuffer(gBevelIndices, | 200 return resourceProvider->findOrCreateInstancedIndexBuffer(gBevelIndices, |
201 kBevelIndexCnt, kNumBevelRectsInIndexBuffer, kBevelVertexCnt, | 201 kBevelIndexCnt, kNumBevelRectsInIndexBuffer, kBevelVertexCnt, |
202 gBevelIndexBufferKey); | 202 gBevelIndexBufferKey); |
203 } | 203 } |
204 } | 204 } |
205 | 205 |
206 bool GrAAStrokeRectBatch::onCombineIfPossible(GrBatch* t) { | 206 bool GrAAStrokeRectBatch::onCombineIfPossible(GrBatch* t, const GrCaps& caps) { |
207 if (!this->pipeline()->isEqual(*t->pipeline())) { | 207 if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *t->pipeline(
), t->bounds(), |
| 208 caps)) { |
208 return false; | 209 return false; |
209 } | 210 } |
210 | 211 |
211 GrAAStrokeRectBatch* that = t->cast<GrAAStrokeRectBatch>(); | 212 GrAAStrokeRectBatch* that = t->cast<GrAAStrokeRectBatch>(); |
212 | 213 |
213 // TODO batch across miterstroke changes | 214 // TODO batch across miterstroke changes |
214 if (this->miterStroke() != that->miterStroke()) { | 215 if (this->miterStroke() != that->miterStroke()) { |
215 return false; | 216 return false; |
216 } | 217 } |
217 | 218 |
(...skipping 153 matching lines...) Loading... |
371 geo.fColor = GrRandomColor(random); | 372 geo.fColor = GrRandomColor(random); |
372 geo.fDevOutside = outside; | 373 geo.fDevOutside = outside; |
373 geo.fDevOutsideAssist = outsideAssist; | 374 geo.fDevOutsideAssist = outsideAssist; |
374 geo.fDevInside = inside; | 375 geo.fDevInside = inside; |
375 geo.fMiterStroke = miterStroke; | 376 geo.fMiterStroke = miterStroke; |
376 | 377 |
377 return GrAAStrokeRectBatch::Create(geo, GrTest::TestMatrix(random)); | 378 return GrAAStrokeRectBatch::Create(geo, GrTest::TestMatrix(random)); |
378 } | 379 } |
379 | 380 |
380 #endif | 381 #endif |
OLD | NEW |