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 "GrTessellatingPathRenderer.h" | 8 #include "GrTessellatingPathRenderer.h" |
9 | 9 |
10 #include "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 } | 224 } |
225 this->draw(target, gp.get()); | 225 this->draw(target, gp.get()); |
226 } | 226 } |
227 | 227 |
228 void drawVertices(Target* target, const GrGeometryProcessor* gp, const GrBuf
fer* vb, | 228 void drawVertices(Target* target, const GrGeometryProcessor* gp, const GrBuf
fer* vb, |
229 int firstVertex, int count) const { | 229 int firstVertex, int count) const { |
230 SkASSERT(gp->getVertexStride() == sizeof(SkPoint)); | 230 SkASSERT(gp->getVertexStride() == sizeof(SkPoint)); |
231 | 231 |
232 GrPrimitiveType primitiveType = TESSELLATOR_WIREFRAME ? kLines_GrPrimiti
veType | 232 GrPrimitiveType primitiveType = TESSELLATOR_WIREFRAME ? kLines_GrPrimiti
veType |
233 : kTriangles_GrPri
mitiveType; | 233 : kTriangles_GrPri
mitiveType; |
234 target->initDraw(gp); | |
235 | |
236 GrMesh mesh; | 234 GrMesh mesh; |
237 mesh.init(primitiveType, vb, firstVertex, count); | 235 mesh.init(primitiveType, vb, firstVertex, count); |
238 target->draw(mesh); | 236 target->draw(gp, mesh); |
239 } | 237 } |
240 | 238 |
241 bool onCombineIfPossible(GrBatch*, const GrCaps&) override { return false; } | 239 bool onCombineIfPossible(GrBatch*, const GrCaps&) override { return false; } |
242 | 240 |
243 TessellatingPathBatch(const GrColor& color, | 241 TessellatingPathBatch(const GrColor& color, |
244 const SkPath& path, | 242 const SkPath& path, |
245 const GrStrokeInfo& stroke, | 243 const GrStrokeInfo& stroke, |
246 const SkMatrix& viewMatrix, | 244 const SkMatrix& viewMatrix, |
247 const SkRect& clipBounds) | 245 const SkRect& clipBounds) |
248 : INHERITED(ClassID()) | 246 : INHERITED(ClassID()) |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 bool result = viewMatrix.invert(&vmi); | 319 bool result = viewMatrix.invert(&vmi); |
322 if (!result) { | 320 if (!result) { |
323 SkFAIL("Cannot invert matrix\n"); | 321 SkFAIL("Cannot invert matrix\n"); |
324 } | 322 } |
325 vmi.mapRect(&clipBounds); | 323 vmi.mapRect(&clipBounds); |
326 GrStrokeInfo strokeInfo = GrTest::TestStrokeInfo(random); | 324 GrStrokeInfo strokeInfo = GrTest::TestStrokeInfo(random); |
327 return TessellatingPathBatch::Create(color, path, strokeInfo, viewMatrix, cl
ipBounds); | 325 return TessellatingPathBatch::Create(color, path, strokeInfo, viewMatrix, cl
ipBounds); |
328 } | 326 } |
329 | 327 |
330 #endif | 328 #endif |
OLD | NEW |