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

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

Issue 1289003002: Fix for VALGRIND DrawAtlas test issue. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « no previous file | no next file » | 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 "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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698