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

Side by Side Diff: src/gpu/batches/GrDefaultPathRenderer.cpp

Issue 1352813003: add a ClassID function to GrBatch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 3 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 2011 Google Inc. 2 * Copyright 2011 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 "GrDefaultPathRenderer.h" 8 #include "GrDefaultPathRenderer.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 } 210 }
211 211
212 class DefaultPathBatch : public GrVertexBatch { 212 class DefaultPathBatch : public GrVertexBatch {
213 public: 213 public:
214 struct Geometry { 214 struct Geometry {
215 GrColor fColor; 215 GrColor fColor;
216 SkPath fPath; 216 SkPath fPath;
217 SkScalar fTolerance; 217 SkScalar fTolerance;
218 }; 218 };
219 219
220 BATCH_CLASS_ID
221
220 static GrDrawBatch* Create(const Geometry& geometry, uint8_t coverage, 222 static GrDrawBatch* Create(const Geometry& geometry, uint8_t coverage,
221 const SkMatrix& viewMatrix, bool isHairline, 223 const SkMatrix& viewMatrix, bool isHairline,
222 const SkRect& devBounds) { 224 const SkRect& devBounds) {
223 return new DefaultPathBatch(geometry, coverage, viewMatrix, isHairline, devBounds); 225 return new DefaultPathBatch(geometry, coverage, viewMatrix, isHairline, devBounds);
224 } 226 }
225 227
226 const char* name() const override { return "DefaultPathBatch"; } 228 const char* name() const override { return "DefaultPathBatch"; }
227 229
228 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { 230 void getInvariantOutputColor(GrInitInvariantOutput* out) const override {
229 // When this is called on a batch, there is only one geometry bundle 231 // When this is called on a batch, there is only one geometry bundle
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 geometry.fColor = color; 754 geometry.fColor = color;
753 geometry.fPath = path; 755 geometry.fPath = path;
754 geometry.fTolerance = srcSpaceTol; 756 geometry.fTolerance = srcSpaceTol;
755 757
756 viewMatrix.mapRect(&bounds); 758 viewMatrix.mapRect(&bounds);
757 uint8_t coverage = GrRandomCoverage(random); 759 uint8_t coverage = GrRandomCoverage(random);
758 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds ); 760 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds );
759 } 761 }
760 762
761 #endif 763 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698