| 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 "GrDrawAtlasBatch.h" | 8 #include "GrDrawAtlasBatch.h" |
| 9 #include "GrBatchTest.h" | 9 #include "GrBatchTest.h" |
| 10 #include "SkGr.h" | 10 #include "SkGr.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 colors->push_back(GrRandomColor(random)); | 229 colors->push_back(GrRandomColor(random)); |
| 230 } | 230 } |
| 231 } | 231 } |
| 232 } | 232 } |
| 233 | 233 |
| 234 BATCH_TEST_DEFINE(GrDrawAtlasBatch) { | 234 BATCH_TEST_DEFINE(GrDrawAtlasBatch) { |
| 235 uint32_t spriteCount = random->nextRangeU(1, 100); | 235 uint32_t spriteCount = random->nextRangeU(1, 100); |
| 236 | 236 |
| 237 SkTArray<SkRSXform> xforms(spriteCount); | 237 SkTArray<SkRSXform> xforms(spriteCount); |
| 238 SkTArray<SkRect> texRects(spriteCount); | 238 SkTArray<SkRect> texRects(spriteCount); |
| 239 SkTArray<GrColor> colors(spriteCount); | 239 SkTArray<GrColor> colors; |
| 240 | 240 |
| 241 bool hasColors = random->nextBool(); | 241 bool hasColors = random->nextBool(); |
| 242 | 242 |
| 243 randomize_params(spriteCount, | 243 randomize_params(spriteCount, |
| 244 random, | 244 random, |
| 245 &xforms, | 245 &xforms, |
| 246 &texRects, | 246 &texRects, |
| 247 &colors, hasColors); | 247 &colors, hasColors); |
| 248 | 248 |
| 249 SkMatrix viewMatrix = GrTest::TestMatrix(random); | 249 SkMatrix viewMatrix = GrTest::TestMatrix(random); |
| 250 | 250 |
| 251 GrDrawAtlasBatch::Geometry geometry; | 251 GrDrawAtlasBatch::Geometry geometry; |
| 252 geometry.fColor = GrRandomColor(random); | 252 geometry.fColor = GrRandomColor(random); |
| 253 return GrDrawAtlasBatch::Create(geometry, viewMatrix, spriteCount, xforms.be
gin(), | 253 return GrDrawAtlasBatch::Create(geometry, viewMatrix, spriteCount, xforms.be
gin(), |
| 254 texRects.begin(), colors.begin()); | 254 texRects.begin(), colors.begin()); |
| 255 } | 255 } |
| 256 | 256 |
| 257 #endif | 257 #endif |
| OLD | NEW |