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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 const GrGLSLCaps&) const ov
erride { | 176 const GrGLSLCaps&) const ov
erride { |
177 return SkNEW_ARGS(GLProcessor, (*this, bt)); | 177 return SkNEW_ARGS(GLProcessor, (*this, bt)); |
178 } | 178 } |
179 | 179 |
180 private: | 180 private: |
181 CircleEdgeEffect(GrColor color, bool stroke, const SkMatrix& localMatrix, bo
ol usesLocalCoords) | 181 CircleEdgeEffect(GrColor color, bool stroke, const SkMatrix& localMatrix, bo
ol usesLocalCoords) |
182 : fColor(color) | 182 : fColor(color) |
183 , fLocalMatrix(localMatrix) | 183 , fLocalMatrix(localMatrix) |
184 , fUsesLocalCoords(usesLocalCoords) { | 184 , fUsesLocalCoords(usesLocalCoords) { |
185 this->initClassID<CircleEdgeEffect>(); | 185 this->initClassID<CircleEdgeEffect>(); |
186 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVe
rtexAttribType)); | 186 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVe
rtexAttribType, |
| 187 kHigh_GrSLPrecision)); |
187 fInCircleEdge = &this->addVertexAttrib(Attribute("inCircleEdge", | 188 fInCircleEdge = &this->addVertexAttrib(Attribute("inCircleEdge", |
188 kVec4f_GrVertexAttrib
Type)); | 189 kVec4f_GrVertexAttrib
Type)); |
189 fStroke = stroke; | 190 fStroke = stroke; |
190 } | 191 } |
191 | 192 |
192 GrColor fColor; | 193 GrColor fColor; |
193 SkMatrix fLocalMatrix; | 194 SkMatrix fLocalMatrix; |
194 const Attribute* fInPosition; | 195 const Attribute* fInPosition; |
195 const Attribute* fInCircleEdge; | 196 const Attribute* fInCircleEdge; |
196 bool fStroke; | 197 bool fStroke; |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 return SkNEW_ARGS(GLProcessor, (*this, bt)); | 550 return SkNEW_ARGS(GLProcessor, (*this, bt)); |
550 } | 551 } |
551 | 552 |
552 private: | 553 private: |
553 DIEllipseEdgeEffect(GrColor color, const SkMatrix& viewMatrix, Mode mode, | 554 DIEllipseEdgeEffect(GrColor color, const SkMatrix& viewMatrix, Mode mode, |
554 bool usesLocalCoords) | 555 bool usesLocalCoords) |
555 : fColor(color) | 556 : fColor(color) |
556 , fViewMatrix(viewMatrix) | 557 , fViewMatrix(viewMatrix) |
557 , fUsesLocalCoords(usesLocalCoords) { | 558 , fUsesLocalCoords(usesLocalCoords) { |
558 this->initClassID<DIEllipseEdgeEffect>(); | 559 this->initClassID<DIEllipseEdgeEffect>(); |
559 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVe
rtexAttribType)); | 560 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVe
rtexAttribType, |
| 561 kHigh_GrSLPrecision)); |
560 fInEllipseOffsets0 = &this->addVertexAttrib(Attribute("inEllipseOffsets0
", | 562 fInEllipseOffsets0 = &this->addVertexAttrib(Attribute("inEllipseOffsets0
", |
561 kVec2f_GrVertexAtt
ribType)); | 563 kVec2f_GrVertexAtt
ribType)); |
562 fInEllipseOffsets1 = &this->addVertexAttrib(Attribute("inEllipseOffsets1
", | 564 fInEllipseOffsets1 = &this->addVertexAttrib(Attribute("inEllipseOffsets1
", |
563 kVec2f_GrVertexAtt
ribType)); | 565 kVec2f_GrVertexAtt
ribType)); |
564 fMode = mode; | 566 fMode = mode; |
565 } | 567 } |
566 | 568 |
567 const Attribute* fInPosition; | 569 const Attribute* fInPosition; |
568 const Attribute* fInEllipseOffsets0; | 570 const Attribute* fInEllipseOffsets0; |
569 const Attribute* fInEllipseOffsets1; | 571 const Attribute* fInEllipseOffsets1; |
(...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2018 } | 2020 } |
2019 | 2021 |
2020 BATCH_TEST_DEFINE(RRectBatch) { | 2022 BATCH_TEST_DEFINE(RRectBatch) { |
2021 SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random); | 2023 SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random); |
2022 GrColor color = GrRandomColor(random); | 2024 GrColor color = GrRandomColor(random); |
2023 const SkRRect& rrect = GrTest::TestRRectSimple(random); | 2025 const SkRRect& rrect = GrTest::TestRRectSimple(random); |
2024 return create_rrect_batch(color, viewMatrix, rrect, GrTest::TestStrokeRec(ra
ndom)); | 2026 return create_rrect_batch(color, viewMatrix, rrect, GrTest::TestStrokeRec(ra
ndom)); |
2025 } | 2027 } |
2026 | 2028 |
2027 #endif | 2029 #endif |
OLD | NEW |