OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "GrOvalRenderer.h" | 8 #include "GrOvalRenderer.h" |
9 | 9 |
10 #include "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 bool fStroke; | 196 bool fStroke; |
197 bool fUsesLocalCoords; | 197 bool fUsesLocalCoords; |
198 | 198 |
199 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; | 199 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; |
200 | 200 |
201 typedef GrGeometryProcessor INHERITED; | 201 typedef GrGeometryProcessor INHERITED; |
202 }; | 202 }; |
203 | 203 |
204 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(CircleEdgeEffect); | 204 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(CircleEdgeEffect); |
205 | 205 |
206 GrGeometryProcessor* CircleEdgeEffect::TestCreate(GrProcessorTestData* d) { | 206 const GrGeometryProcessor* CircleEdgeEffect::TestCreate(GrProcessorTestData* d)
{ |
207 return CircleEdgeEffect::Create(GrRandomColor(d->fRandom), | 207 return CircleEdgeEffect::Create(GrRandomColor(d->fRandom), |
208 d->fRandom->nextBool(), | 208 d->fRandom->nextBool(), |
209 GrTest::TestMatrix(d->fRandom), | 209 GrTest::TestMatrix(d->fRandom), |
210 d->fRandom->nextBool()); | 210 d->fRandom->nextBool()); |
211 } | 211 } |
212 | 212 |
213 /////////////////////////////////////////////////////////////////////////////// | 213 /////////////////////////////////////////////////////////////////////////////// |
214 | 214 |
215 /** | 215 /** |
216 * The output of this effect is a modulation of the input color and coverage for
an axis-aligned | 216 * The output of this effect is a modulation of the input color and coverage for
an axis-aligned |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 bool fStroke; | 375 bool fStroke; |
376 bool fUsesLocalCoords; | 376 bool fUsesLocalCoords; |
377 | 377 |
378 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; | 378 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; |
379 | 379 |
380 typedef GrGeometryProcessor INHERITED; | 380 typedef GrGeometryProcessor INHERITED; |
381 }; | 381 }; |
382 | 382 |
383 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(EllipseEdgeEffect); | 383 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(EllipseEdgeEffect); |
384 | 384 |
385 GrGeometryProcessor* EllipseEdgeEffect::TestCreate(GrProcessorTestData* d) { | 385 const GrGeometryProcessor* EllipseEdgeEffect::TestCreate(GrProcessorTestData* d)
{ |
386 return EllipseEdgeEffect::Create(GrRandomColor(d->fRandom), | 386 return EllipseEdgeEffect::Create(GrRandomColor(d->fRandom), |
387 d->fRandom->nextBool(), | 387 d->fRandom->nextBool(), |
388 GrTest::TestMatrix(d->fRandom), | 388 GrTest::TestMatrix(d->fRandom), |
389 d->fRandom->nextBool()); | 389 d->fRandom->nextBool()); |
390 } | 390 } |
391 | 391 |
392 /////////////////////////////////////////////////////////////////////////////// | 392 /////////////////////////////////////////////////////////////////////////////// |
393 | 393 |
394 /** | 394 /** |
395 * The output of this effect is a modulation of the input color and coverage for
an ellipse, | 395 * The output of this effect is a modulation of the input color and coverage for
an ellipse, |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 Mode fMode; | 576 Mode fMode; |
577 bool fUsesLocalCoords; | 577 bool fUsesLocalCoords; |
578 | 578 |
579 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; | 579 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; |
580 | 580 |
581 typedef GrGeometryProcessor INHERITED; | 581 typedef GrGeometryProcessor INHERITED; |
582 }; | 582 }; |
583 | 583 |
584 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DIEllipseEdgeEffect); | 584 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DIEllipseEdgeEffect); |
585 | 585 |
586 GrGeometryProcessor* DIEllipseEdgeEffect::TestCreate(GrProcessorTestData* d) { | 586 const GrGeometryProcessor* DIEllipseEdgeEffect::TestCreate(GrProcessorTestData*
d) { |
587 return DIEllipseEdgeEffect::Create(GrRandomColor(d->fRandom), | 587 return DIEllipseEdgeEffect::Create(GrRandomColor(d->fRandom), |
588 GrTest::TestMatrix(d->fRandom), | 588 GrTest::TestMatrix(d->fRandom), |
589 (Mode)(d->fRandom->nextRangeU(0,2)), | 589 (Mode)(d->fRandom->nextRangeU(0,2)), |
590 d->fRandom->nextBool()); | 590 d->fRandom->nextBool()); |
591 } | 591 } |
592 | 592 |
593 /////////////////////////////////////////////////////////////////////////////// | 593 /////////////////////////////////////////////////////////////////////////////// |
594 | 594 |
595 bool GrOvalRenderer::DrawOval(GrDrawTarget* target, | 595 bool GrOvalRenderer::DrawOval(GrDrawTarget* target, |
596 const GrPipelineBuilder& pipelineBuilder, | 596 const GrPipelineBuilder& pipelineBuilder, |
(...skipping 1436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2033 } | 2033 } |
2034 | 2034 |
2035 DRAW_BATCH_TEST_DEFINE(RRectBatch) { | 2035 DRAW_BATCH_TEST_DEFINE(RRectBatch) { |
2036 SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random); | 2036 SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random); |
2037 GrColor color = GrRandomColor(random); | 2037 GrColor color = GrRandomColor(random); |
2038 const SkRRect& rrect = GrTest::TestRRectSimple(random); | 2038 const SkRRect& rrect = GrTest::TestRRectSimple(random); |
2039 return create_rrect_batch(color, viewMatrix, rrect, GrTest::TestStrokeRec(ra
ndom)); | 2039 return create_rrect_batch(color, viewMatrix, rrect, GrTest::TestStrokeRec(ra
ndom)); |
2040 } | 2040 } |
2041 | 2041 |
2042 #endif | 2042 #endif |
OLD | NEW |