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

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

Issue 1253393002: Cleanup Default Geo Proc API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks 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.h ('k') | src/gpu/GrRectBatch.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 2014 Google Inc. 2 * Copyright 2014 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 "GrDefaultGeoProcFactory.h" 8 #include "GrDefaultGeoProcFactory.h"
9 9
10 #include "GrInvariantOutput.h" 10 #include "GrInvariantOutput.h"
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 const SkMatrix& local Matrix, 268 const SkMatrix& local Matrix,
269 uint8_t coverage) { 269 uint8_t coverage) {
270 return DefaultGeoProc::Create(gpTypeFlags, 270 return DefaultGeoProc::Create(gpTypeFlags,
271 color, 271 color,
272 viewMatrix, 272 viewMatrix,
273 localMatrix, 273 localMatrix,
274 localCoordsWillBeRead, 274 localCoordsWillBeRead,
275 coverageWillBeIgnored, 275 coverageWillBeIgnored,
276 coverage); 276 coverage);
277 } 277 }
278
279 const GrGeometryProcessor* GrDefaultGeoProcFactory::Create(const Color& color,
280 const Coverage& cover age,
281 LocalCoords::Type loc alCoords,
282 const SkMatrix& viewM atrix,
283 const SkMatrix& local Matrix) {
284 uint32_t flags = 0;
285 flags |= color.fType == Color::kAttribute_Type ? kColor_GPType : 0;
286 flags |= coverage.fType == Coverage::kAttribute_Type ? kCoverage_GPType : 0;
287 flags |= localCoords == LocalCoords::kHasExplicit_Type ? kLocalCoord_GPType : 0;
288
289 uint8_t inCoverage = coverage.fCoverage;
290 bool coverageWillBeIgnored = coverage.fType == Coverage::kNone_Type;
291 bool localCoordsWillBeRead = localCoords != LocalCoords::kNone_Type;
292
293 GrColor inColor = color.fColor;
294 return DefaultGeoProc::Create(flags,
295 inColor,
296 viewMatrix,
297 localMatrix,
298 localCoordsWillBeRead,
299 coverageWillBeIgnored,
300 inCoverage);
301 }
OLDNEW
« no previous file with comments | « src/gpu/GrDefaultGeoProcFactory.h ('k') | src/gpu/GrRectBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698