OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "GrAAConvexPathRenderer.h" | 9 #include "GrAAConvexPathRenderer.h" |
10 | 10 |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 } | 425 } |
426 } | 426 } |
427 } | 427 } |
428 | 428 |
429 } | 429 } |
430 | 430 |
431 bool GrAAConvexPathRenderer::canDrawPath(const SkPath& path, | 431 bool GrAAConvexPathRenderer::canDrawPath(const SkPath& path, |
432 const SkStrokeRec& stroke, | 432 const SkStrokeRec& stroke, |
433 const GrDrawTarget* target, | 433 const GrDrawTarget* target, |
434 bool antiAlias) const { | 434 bool antiAlias) const { |
435 return (target->getCaps().shaderDerivativeSupport() && antiAlias && | 435 return (target->caps()->shaderDerivativeSupport() && antiAlias && |
436 stroke.isFillStyle() && !path.isInverseFillType() && path.isConvex()
); | 436 stroke.isFillStyle() && !path.isInverseFillType() && path.isConvex()
); |
437 } | 437 } |
438 | 438 |
439 bool GrAAConvexPathRenderer::onDrawPath(const SkPath& origPath, | 439 bool GrAAConvexPathRenderer::onDrawPath(const SkPath& origPath, |
440 const SkStrokeRec&, | 440 const SkStrokeRec&, |
441 GrDrawTarget* target, | 441 GrDrawTarget* target, |
442 bool antiAlias) { | 442 bool antiAlias) { |
443 | 443 |
444 const SkPath* path = &origPath; | 444 const SkPath* path = &origPath; |
445 if (path->isEmpty()) { | 445 if (path->isEmpty()) { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 drawState->setVertexEdgeType(GrDrawState::kQuad_EdgeType); | 503 drawState->setVertexEdgeType(GrDrawState::kQuad_EdgeType); |
504 target->drawIndexed(kTriangles_GrPrimitiveType, | 504 target->drawIndexed(kTriangles_GrPrimitiveType, |
505 0, // start vertex | 505 0, // start vertex |
506 0, // start index | 506 0, // start index |
507 vCount, | 507 vCount, |
508 iCount); | 508 iCount); |
509 drawState->setVertexEdgeType(oldEdgeType); | 509 drawState->setVertexEdgeType(oldEdgeType); |
510 | 510 |
511 return true; | 511 return true; |
512 } | 512 } |
OLD | NEW |