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

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

Issue 1293583002: Introduce GrBatch subclasses GrDrawBatch and GrVertexBatch to prepare for non-drawing batches (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove duplicated fields in GrVertexBatch 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/batches/GrStrokeRectBatch.h ('k') | src/gpu/batches/GrTestBatch.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 "SkRandom.h" 10 #include "SkRandom.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 vertex[4].set(args.fRect.fLeft, args.fRect.fTop); 121 vertex[4].set(args.fRect.fLeft, args.fRect.fTop);
122 } 122 }
123 123
124 GrVertices vertices; 124 GrVertices vertices;
125 vertices.init(primType, vertexBuffer, firstVertex, vertexCount); 125 vertices.init(primType, vertexBuffer, firstVertex, vertexCount);
126 batchTarget->draw(vertices); 126 batchTarget->draw(vertices);
127 } 127 }
128 128
129 #ifdef GR_TEST_UTILS 129 #ifdef GR_TEST_UTILS
130 130
131 BATCH_TEST_DEFINE(GrStrokeRectBatch) { 131 DRAW_BATCH_TEST_DEFINE(GrStrokeRectBatch) {
132 GrStrokeRectBatch::Geometry geometry; 132 GrStrokeRectBatch::Geometry geometry;
133 geometry.fViewMatrix = GrTest::TestMatrix(random); 133 geometry.fViewMatrix = GrTest::TestMatrix(random);
134 geometry.fColor = GrRandomColor(random); 134 geometry.fColor = GrRandomColor(random);
135 geometry.fRect = GrTest::TestRect(random); 135 geometry.fRect = GrTest::TestRect(random);
136 geometry.fStrokeWidth = random->nextBool() ? 0.0f : 1.0f; 136 geometry.fStrokeWidth = random->nextBool() ? 0.0f : 1.0f;
137 137
138 return GrStrokeRectBatch::Create(geometry, random->nextBool()); 138 return GrStrokeRectBatch::Create(geometry, random->nextBool());
139 } 139 }
140 140
141 #endif 141 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrStrokeRectBatch.h ('k') | src/gpu/batches/GrTestBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698