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

Side by Side Diff: src/gpu/GrPrimitiveProcessor.h

Issue 1145273002: Use high precision vertex attributes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 100-col fixes 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
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | src/gpu/effects/GrBezierEffect.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef GrPrimitiveProcessor_DEFINED 8 #ifndef GrPrimitiveProcessor_DEFINED
9 #define GrPrimitiveProcessor_DEFINED 9 #define GrPrimitiveProcessor_DEFINED
10 10
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 * This is a safeguard to prevent GrPrimitiveProcessor's from going beyond p latform specific 119 * This is a safeguard to prevent GrPrimitiveProcessor's from going beyond p latform specific
120 * attribute limits. This number can almost certainly be raised if required. 120 * attribute limits. This number can almost certainly be raised if required.
121 */ 121 */
122 static const int kMaxVertexAttribs = 6; 122 static const int kMaxVertexAttribs = 6;
123 123
124 struct Attribute { 124 struct Attribute {
125 Attribute() 125 Attribute()
126 : fName(NULL) 126 : fName(NULL)
127 , fType(kFloat_GrVertexAttribType) 127 , fType(kFloat_GrVertexAttribType)
128 , fOffset(0) {} 128 , fOffset(0) {}
129 Attribute(const char* name, GrVertexAttribType type) 129 Attribute(const char* name, GrVertexAttribType type,
130 GrSLPrecision precision = kDefault_GrSLPrecision)
130 : fName(name) 131 : fName(name)
131 , fType(type) 132 , fType(type)
132 , fOffset(SkAlign4(GrVertexAttribTypeSize(type))) {} 133 , fOffset(SkAlign4(GrVertexAttribTypeSize(type)))
134 , fPrecision(precision) {}
133 const char* fName; 135 const char* fName;
134 GrVertexAttribType fType; 136 GrVertexAttribType fType;
135 size_t fOffset; 137 size_t fOffset;
138 GrSLPrecision fPrecision;
136 }; 139 };
137 140
138 int numAttribs() const { return fNumAttribs; } 141 int numAttribs() const { return fNumAttribs; }
139 const Attribute& getAttrib(int index) const { 142 const Attribute& getAttrib(int index) const {
140 SkASSERT(index < fNumAttribs); 143 SkASSERT(index < fNumAttribs);
141 return fAttribs[index]; 144 return fAttribs[index];
142 } 145 }
143 146
144 // Returns the vertex stride of the GP. A common use case is to request geo metry from a 147 // Returns the vertex stride of the GP. A common use case is to request geo metry from a
145 // drawtarget based off of the stride, and to populate this memory using an implicit array of 148 // drawtarget based off of the stride, and to populate this memory using an implicit array of
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 183
181 private: 184 private:
182 virtual bool hasExplicitLocalCoords() const = 0; 185 virtual bool hasExplicitLocalCoords() const = 0;
183 186
184 bool fIsPathRendering; 187 bool fIsPathRendering;
185 188
186 typedef GrProcessor INHERITED; 189 typedef GrProcessor INHERITED;
187 }; 190 };
188 191
189 #endif 192 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | src/gpu/effects/GrBezierEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698