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

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

Issue 1831133004: Revert of Consolidate GPU buffer implementations (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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/GrNonAAFillRectBatch.cpp ('k') | src/gpu/batches/GrPLSPathRenderer.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 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 "GrNonAAStrokeRectBatch.h" 8 #include "GrNonAAStrokeRectBatch.h"
9 9
10 #include "GrBatchTest.h" 10 #include "GrBatchTest.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 SkASSERT(vertexStride == sizeof(GrDefaultGeoProcFactory::PositionAttr)); 124 SkASSERT(vertexStride == sizeof(GrDefaultGeoProcFactory::PositionAttr));
125 125
126 const Geometry& args = fGeoData[0]; 126 const Geometry& args = fGeoData[0];
127 127
128 int vertexCount = kVertsPerHairlineRect; 128 int vertexCount = kVertsPerHairlineRect;
129 if (args.fStrokeWidth > 0) { 129 if (args.fStrokeWidth > 0) {
130 vertexCount = kVertsPerStrokeRect; 130 vertexCount = kVertsPerStrokeRect;
131 } 131 }
132 132
133 const GrBuffer* vertexBuffer; 133 const GrVertexBuffer* vertexBuffer;
134 int firstVertex; 134 int firstVertex;
135 135
136 void* verts = target->makeVertexSpace(vertexStride, vertexCount, &vertex Buffer, 136 void* verts = target->makeVertexSpace(vertexStride, vertexCount, &vertex Buffer,
137 &firstVertex); 137 &firstVertex);
138 138
139 if (!verts) { 139 if (!verts) {
140 SkDebugf("Could not allocate vertices\n"); 140 SkDebugf("Could not allocate vertices\n");
141 return; 141 return;
142 } 142 }
143 143
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 DRAW_BATCH_TEST_DEFINE(NonAAStrokeRectBatch) { 244 DRAW_BATCH_TEST_DEFINE(NonAAStrokeRectBatch) {
245 SkMatrix viewMatrix = GrTest::TestMatrix(random); 245 SkMatrix viewMatrix = GrTest::TestMatrix(random);
246 GrColor color = GrRandomColor(random); 246 GrColor color = GrRandomColor(random);
247 SkRect rect = GrTest::TestRect(random); 247 SkRect rect = GrTest::TestRect(random);
248 SkScalar strokeWidth = random->nextBool() ? 0.0f : 1.0f; 248 SkScalar strokeWidth = random->nextBool() ? 0.0f : 1.0f;
249 249
250 return GrNonAAStrokeRectBatch::Create(color, viewMatrix, rect, strokeWidth, random->nextBool()); 250 return GrNonAAStrokeRectBatch::Create(color, viewMatrix, rect, strokeWidth, random->nextBool());
251 } 251 }
252 252
253 #endif 253 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrNonAAFillRectBatch.cpp ('k') | src/gpu/batches/GrPLSPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698