Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(236)

Side by Side Diff: src/gpu/GrOvalRenderer.cpp

Issue 1145273002: Use high precision vertex attributes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Change other inPosition * fViewMatrix users to highp Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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, kHigh_GrSLPrecision));
joshualitt 2015/05/20 20:36:10 newline
Stephen White 2015/05/20 20:47:43 Done.
187 fInCircleEdge = &this->addVertexAttrib(Attribute("inCircleEdge", 187 fInCircleEdge = &this->addVertexAttrib(Attribute("inCircleEdge",
188 kVec4f_GrVertexAttrib Type)); 188 kVec4f_GrVertexAttrib Type));
189 fStroke = stroke; 189 fStroke = stroke;
190 } 190 }
191 191
192 GrColor fColor; 192 GrColor fColor;
193 SkMatrix fLocalMatrix; 193 SkMatrix fLocalMatrix;
194 const Attribute* fInPosition; 194 const Attribute* fInPosition;
195 const Attribute* fInCircleEdge; 195 const Attribute* fInCircleEdge;
196 bool fStroke; 196 bool fStroke;
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 return SkNEW_ARGS(GLProcessor, (*this, bt)); 549 return SkNEW_ARGS(GLProcessor, (*this, bt));
550 } 550 }
551 551
552 private: 552 private:
553 DIEllipseEdgeEffect(GrColor color, const SkMatrix& viewMatrix, Mode mode, 553 DIEllipseEdgeEffect(GrColor color, const SkMatrix& viewMatrix, Mode mode,
554 bool usesLocalCoords) 554 bool usesLocalCoords)
555 : fColor(color) 555 : fColor(color)
556 , fViewMatrix(viewMatrix) 556 , fViewMatrix(viewMatrix)
557 , fUsesLocalCoords(usesLocalCoords) { 557 , fUsesLocalCoords(usesLocalCoords) {
558 this->initClassID<DIEllipseEdgeEffect>(); 558 this->initClassID<DIEllipseEdgeEffect>();
559 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVe rtexAttribType)); 559 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVe rtexAttribType, kHigh_GrSLPrecision));
joshualitt 2015/05/20 20:36:10 newline
Stephen White 2015/05/20 20:47:43 Done.
560 fInEllipseOffsets0 = &this->addVertexAttrib(Attribute("inEllipseOffsets0 ", 560 fInEllipseOffsets0 = &this->addVertexAttrib(Attribute("inEllipseOffsets0 ",
561 kVec2f_GrVertexAtt ribType)); 561 kVec2f_GrVertexAtt ribType));
562 fInEllipseOffsets1 = &this->addVertexAttrib(Attribute("inEllipseOffsets1 ", 562 fInEllipseOffsets1 = &this->addVertexAttrib(Attribute("inEllipseOffsets1 ",
563 kVec2f_GrVertexAtt ribType)); 563 kVec2f_GrVertexAtt ribType));
564 fMode = mode; 564 fMode = mode;
565 } 565 }
566 566
567 const Attribute* fInPosition; 567 const Attribute* fInPosition;
568 const Attribute* fInEllipseOffsets0; 568 const Attribute* fInEllipseOffsets0;
569 const Attribute* fInEllipseOffsets1; 569 const Attribute* fInEllipseOffsets1;
(...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after
2018 } 2018 }
2019 2019
2020 BATCH_TEST_DEFINE(RRectBatch) { 2020 BATCH_TEST_DEFINE(RRectBatch) {
2021 SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random); 2021 SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random);
2022 GrColor color = GrRandomColor(random); 2022 GrColor color = GrRandomColor(random);
2023 const SkRRect& rrect = GrTest::TestRRectSimple(random); 2023 const SkRRect& rrect = GrTest::TestRRectSimple(random);
2024 return create_rrect_batch(color, viewMatrix, rrect, GrTest::TestStrokeRec(ra ndom)); 2024 return create_rrect_batch(color, viewMatrix, rrect, GrTest::TestStrokeRec(ra ndom));
2025 } 2025 }
2026 2026
2027 #endif 2027 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698