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/batches/GrStrokeRectBatch.cpp

Issue 1353043002: Revert of add a ClassID function to GrBatch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
« no previous file with comments | « src/gpu/batches/GrStrokeRectBatch.h ('k') | src/gpu/batches/GrTInstanceBatch.h » ('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 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 "GrStrokeRectBatch.h" 8 #include "GrStrokeRectBatch.h"
9 #include "GrBatchTest.h" 9 #include "GrBatchTest.h"
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
11 #include "SkRandom.h" 11 #include "SkRandom.h"
12 12
13 GrStrokeRectBatch::GrStrokeRectBatch(const Geometry& geometry, bool snapToPixelC enters) 13 GrStrokeRectBatch::GrStrokeRectBatch(const Geometry& geometry, bool snapToPixelC enters) {
14 : INHERITED(ClassID()) { 14 this->initClassID<GrStrokeRectBatch>();
15
15 fBatch.fHairline = geometry.fStrokeWidth == 0; 16 fBatch.fHairline = geometry.fStrokeWidth == 0;
16 17
17 fGeoData.push_back(geometry); 18 fGeoData.push_back(geometry);
18 19
19 // setup bounds 20 // setup bounds
20 fBounds = geometry.fRect; 21 fBounds = geometry.fRect;
21 SkScalar rad = SkScalarHalf(geometry.fStrokeWidth); 22 SkScalar rad = SkScalarHalf(geometry.fStrokeWidth);
22 fBounds.outset(rad, rad); 23 fBounds.outset(rad, rad);
23 geometry.fViewMatrix.mapRect(&fBounds); 24 geometry.fViewMatrix.mapRect(&fBounds);
24 25
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 GrStrokeRectBatch::Geometry geometry; 131 GrStrokeRectBatch::Geometry geometry;
131 geometry.fViewMatrix = GrTest::TestMatrix(random); 132 geometry.fViewMatrix = GrTest::TestMatrix(random);
132 geometry.fColor = GrRandomColor(random); 133 geometry.fColor = GrRandomColor(random);
133 geometry.fRect = GrTest::TestRect(random); 134 geometry.fRect = GrTest::TestRect(random);
134 geometry.fStrokeWidth = random->nextBool() ? 0.0f : 1.0f; 135 geometry.fStrokeWidth = random->nextBool() ? 0.0f : 1.0f;
135 136
136 return GrStrokeRectBatch::Create(geometry, random->nextBool()); 137 return GrStrokeRectBatch::Create(geometry, random->nextBool());
137 } 138 }
138 139
139 #endif 140 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrStrokeRectBatch.h ('k') | src/gpu/batches/GrTInstanceBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698