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

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

Issue 1257333002: Change GrDefaultGeoProcFactory to a namespace (Closed) Base URL: https://skia.googlesource.com/skia.git@localcoordscleanup
Patch Set: Created 5 years, 4 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/GrDefaultGeoProcFactory.cpp ('k') | no next file » | 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 2015 Google Inc. 2 * Copyright 2015 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 "GrRectBatch.h" 8 #include "GrRectBatch.h"
9 9
10 #include "GrBatch.h" 10 #include "GrBatch.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 coords and just duplicate the positions when the caller hasn't provided a local coord rect, 168 coords and just duplicate the positions when the caller hasn't provided a local coord rect,
169 but we haven't seen a use case which frequently switches between local r ect and no local 169 but we haven't seen a use case which frequently switches between local r ect and no local
170 rect draws. 170 rect draws.
171 171
172 The color param is used to determine whether the opaque hint can be set on the draw state. 172 The color param is used to determine whether the opaque hint can be set on the draw state.
173 The caller must populate the vertex colors itself. 173 The caller must populate the vertex colors itself.
174 174
175 The vertex attrib order is always pos, color, [local coords]. 175 The vertex attrib order is always pos, color, [local coords].
176 */ 176 */
177 const GrGeometryProcessor* createRectGP() { 177 const GrGeometryProcessor* createRectGP() {
178 typedef GrDefaultGeoProcFactory::Color Color; 178 using namespace GrDefaultGeoProcFactory;
179 typedef GrDefaultGeoProcFactory::Coverage Coverage;
180 typedef GrDefaultGeoProcFactory::LocalCoords LocalCoords;
181 Color color(Color::kAttribute_Type); 179 Color color(Color::kAttribute_Type);
182 Coverage coverage(this->coverageIgnored() ? Coverage::kNone_Type : Cover age::kSolid_Type); 180 Coverage coverage(this->coverageIgnored() ? Coverage::kNone_Type : Cover age::kSolid_Type);
183 181
184 // if we have a local rect, then we apply the localMatrix directly to th e localRect to 182 // if we have a local rect, then we apply the localMatrix directly to th e localRect to
185 // generate vertex local coords 183 // generate vertex local coords
186 if (this->hasLocalRect()) { 184 if (this->hasLocalRect()) {
187 LocalCoords localCoords(LocalCoords::kHasExplicit_Type); 185 LocalCoords localCoords(LocalCoords::kHasExplicit_Type);
188 return GrDefaultGeoProcFactory::Create(color, coverage, localCoords) ; 186 return GrDefaultGeoProcFactory::Create(color, coverage, localCoords) ;
189 } else { 187 } else {
190 LocalCoords localCoords(LocalCoords::kUsePosition_Type, 188 LocalCoords localCoords(LocalCoords::kUsePosition_Type,
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 if (hasLocalMatrix) { 259 if (hasLocalMatrix) {
262 localMatrix = GrTest::TestMatrix(random); 260 localMatrix = GrTest::TestMatrix(random);
263 } 261 }
264 262
265 return GrRectBatch::Create(color, viewMatrix, rect, 263 return GrRectBatch::Create(color, viewMatrix, rect,
266 hasLocalRect ? &localRect : NULL, 264 hasLocalRect ? &localRect : NULL,
267 hasLocalMatrix ? &localMatrix : NULL); 265 hasLocalMatrix ? &localMatrix : NULL);
268 } 266 }
269 267
270 #endif 268 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrDefaultGeoProcFactory.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698