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 "GrAAFillRectBatch.h" | 8 #include "GrAAFillRectBatch.h" |
9 | 9 |
10 #include "GrColor.h" | 10 #include "GrColor.h" |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 | 434 |
435 }; | 435 }; |
436 | 436 |
437 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 437 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
438 | 438 |
439 #ifdef GR_TEST_UTILS | 439 #ifdef GR_TEST_UTILS |
440 | 440 |
441 #include "GrBatchTest.h" | 441 #include "GrBatchTest.h" |
442 | 442 |
443 DRAW_BATCH_TEST_DEFINE(AAFillRectBatch) { | 443 DRAW_BATCH_TEST_DEFINE(AAFillRectBatch) { |
444 AAFillRectBatchNoLocalMatrix* batch = AAFillRectBatchNoLocalMatrix::Create()
; | 444 GrColor color = GrRandomColor(random); |
445 AAFillRectBatchNoLocalMatrix::Geometry& geo = *batch->geometry(); | 445 SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random); |
446 geo.fColor = GrRandomColor(random); | 446 SkRect rect = GrTest::TestRect(random); |
447 geo.fViewMatrix = GrTest::TestMatrix(random); | 447 SkRect devRect = GrTest::TestRect(random); |
448 geo.fDevRect = GrTest::TestRect(random); | 448 return GrAAFillRectBatch::Create(color, viewMatrix, rect, devRect); |
449 batch->init(); | |
450 return batch; | |
451 } | 449 } |
452 | 450 |
453 DRAW_BATCH_TEST_DEFINE(AAFillRectBatchLocalMatrix) { | 451 DRAW_BATCH_TEST_DEFINE(AAFillRectBatchLocalMatrix) { |
454 AAFillRectBatchLocalMatrix* batch = AAFillRectBatchLocalMatrix::Create(); | 452 GrColor color = GrRandomColor(random); |
455 AAFillRectBatchLocalMatrix::Geometry& geo = *batch->geometry(); | 453 SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random); |
456 geo.fColor = GrRandomColor(random); | 454 SkMatrix localMatrix = GrTest::TestMatrix(random); |
457 geo.fViewMatrix = GrTest::TestMatrix(random); | 455 SkRect rect = GrTest::TestRect(random); |
458 geo.fLocalMatrix = GrTest::TestMatrix(random); | 456 SkRect devRect = GrTest::TestRect(random); |
459 geo.fDevRect = GrTest::TestRect(random); | 457 return GrAAFillRectBatch::Create(color, viewMatrix, localMatrix, rect, devRe
ct); |
460 batch->init(); | |
461 return batch; | |
462 } | 458 } |
463 | 459 |
464 #endif | 460 #endif |
OLD | NEW |