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

Side by Side Diff: src/gpu/batches/GrAALinearizingConvexPathRenderer.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 /* 2 /*
3 * Copyright 2015 Google Inc. 3 * Copyright 2015 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrAALinearizingConvexPathRenderer.h" 9 #include "GrAALinearizingConvexPathRenderer.h"
10 10
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 public: 121 public:
122 struct Geometry { 122 struct Geometry {
123 GrColor fColor; 123 GrColor fColor;
124 SkMatrix fViewMatrix; 124 SkMatrix fViewMatrix;
125 SkPath fPath; 125 SkPath fPath;
126 SkScalar fStrokeWidth; 126 SkScalar fStrokeWidth;
127 SkPaint::Join fJoin; 127 SkPaint::Join fJoin;
128 SkScalar fMiterLimit; 128 SkScalar fMiterLimit;
129 }; 129 };
130 130
131 BATCH_CLASS_ID
132
131 static GrDrawBatch* Create(const Geometry& geometry) { 133 static GrDrawBatch* Create(const Geometry& geometry) {
132 return new AAFlatteningConvexPathBatch(geometry); 134 return new AAFlatteningConvexPathBatch(geometry);
133 } 135 }
134 136
135 const char* name() const override { return "AAConvexBatch"; } 137 const char* name() const override { return "AAConvexBatch"; }
136 138
137 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { 139 void getInvariantOutputColor(GrInitInvariantOutput* out) const override {
138 // When this is called on a batch, there is only one geometry bundle 140 // When this is called on a batch, there is only one geometry bundle
139 out->setKnownFourComponents(fGeoData[0].fColor); 141 out->setKnownFourComponents(fGeoData[0].fColor);
140 } 142 }
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 DRAW_BATCH_TEST_DEFINE(AAFlatteningConvexPathBatch) { 338 DRAW_BATCH_TEST_DEFINE(AAFlatteningConvexPathBatch) {
337 AAFlatteningConvexPathBatch::Geometry geometry; 339 AAFlatteningConvexPathBatch::Geometry geometry;
338 geometry.fColor = GrRandomColor(random); 340 geometry.fColor = GrRandomColor(random);
339 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); 341 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random);
340 geometry.fPath = GrTest::TestPathConvex(random); 342 geometry.fPath = GrTest::TestPathConvex(random);
341 343
342 return AAFlatteningConvexPathBatch::Create(geometry); 344 return AAFlatteningConvexPathBatch::Create(geometry);
343 } 345 }
344 346
345 #endif 347 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698