OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "GrOvalRenderer.h" | 8 #include "GrOvalRenderer.h" |
9 | 9 |
10 #include "GrBatch.h" | 10 #include "GrBatch.h" |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 !pipelineBuilder->getRenderTarget()->isMultisampled(); | 662 !pipelineBuilder->getRenderTarget()->isMultisampled(); |
663 | 663 |
664 if (!useCoverageAA) { | 664 if (!useCoverageAA) { |
665 return false; | 665 return false; |
666 } | 666 } |
667 | 667 |
668 // we can draw circles | 668 // we can draw circles |
669 if (SkScalarNearlyEqual(oval.width(), oval.height()) && circle_stays_circle(
viewMatrix)) { | 669 if (SkScalarNearlyEqual(oval.width(), oval.height()) && circle_stays_circle(
viewMatrix)) { |
670 this->drawCircle(target, pipelineBuilder, color, viewMatrix, useCoverage
AA, oval, stroke); | 670 this->drawCircle(target, pipelineBuilder, color, viewMatrix, useCoverage
AA, oval, stroke); |
671 // if we have shader derivative support, render as device-independent | 671 // if we have shader derivative support, render as device-independent |
672 } else if (target->caps()->shaderDerivativeSupport()) { | 672 } else if (target->caps()->shaderCaps()->shaderDerivativeSupport()) { |
673 return this->drawDIEllipse(target, pipelineBuilder, color, viewMatrix, u
seCoverageAA, oval, | 673 return this->drawDIEllipse(target, pipelineBuilder, color, viewMatrix, u
seCoverageAA, oval, |
674 stroke); | 674 stroke); |
675 // otherwise axis-aligned ellipses only | 675 // otherwise axis-aligned ellipses only |
676 } else if (viewMatrix.rectStaysRect()) { | 676 } else if (viewMatrix.rectStaysRect()) { |
677 return this->drawEllipse(target, pipelineBuilder, color, viewMatrix, use
CoverageAA, oval, | 677 return this->drawEllipse(target, pipelineBuilder, color, viewMatrix, use
CoverageAA, oval, |
678 stroke); | 678 stroke); |
679 } else { | 679 } else { |
680 return false; | 680 return false; |
681 } | 681 } |
682 | 682 |
(...skipping 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2223 geometry.fInnerXRadius = innerXRadius; | 2223 geometry.fInnerXRadius = innerXRadius; |
2224 geometry.fInnerYRadius = innerYRadius; | 2224 geometry.fInnerYRadius = innerYRadius; |
2225 geometry.fStroke = isStrokeOnly; | 2225 geometry.fStroke = isStrokeOnly; |
2226 geometry.fDevBounds = bounds; | 2226 geometry.fDevBounds = bounds; |
2227 | 2227 |
2228 SkAutoTUnref<GrBatch> batch(RRectEllipseRendererBatch::Create(geometry,
indexBuffer)); | 2228 SkAutoTUnref<GrBatch> batch(RRectEllipseRendererBatch::Create(geometry,
indexBuffer)); |
2229 target->drawBatch(pipelineBuilder, batch, &bounds); | 2229 target->drawBatch(pipelineBuilder, batch, &bounds); |
2230 } | 2230 } |
2231 return true; | 2231 return true; |
2232 } | 2232 } |
OLD | NEW |