OLD | NEW |
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 Loading... |
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 GrVertexBuffer* vertexBuffer; | 133 const GrBuffer* 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 Loading... |
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 |
OLD | NEW |