OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 // This test only works with the GPU backend. | 9 // This test only works with the GPU backend. |
10 | 10 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 boundsPaint.setColor(0xff808080); | 214 boundsPaint.setColor(0xff808080); |
215 boundsPaint.setStrokeWidth(0); | 215 boundsPaint.setStrokeWidth(0); |
216 boundsPaint.setStyle(SkPaint::kStroke_Style); | 216 boundsPaint.setStyle(SkPaint::kStroke_Style); |
217 canvas->drawRect(bounds, boundsPaint); | 217 canvas->drawRect(bounds, boundsPaint); |
218 | 218 |
219 GrTestTarget tt; | 219 GrTestTarget tt; |
220 context->getTestTarget(&tt, rt); | 220 context->getTestTarget(&tt, rt); |
221 SkASSERT(tt.target()); | 221 SkASSERT(tt.target()); |
222 | 222 |
223 GrPipelineBuilder pipelineBuilder; | 223 GrPipelineBuilder pipelineBuilder; |
| 224 pipelineBuilder.setXPFactory( |
| 225 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->u
nref(); |
224 pipelineBuilder.setRenderTarget(rt); | 226 pipelineBuilder.setRenderTarget(rt); |
225 | 227 |
226 BezierCubicOrConicTestBatch::Geometry geometry; | 228 BezierCubicOrConicTestBatch::Geometry geometry; |
227 geometry.fColor = color; | 229 geometry.fColor = color; |
228 geometry.fBounds = bounds; | 230 geometry.fBounds = bounds; |
229 | 231 |
230 SkAutoTUnref<GrDrawBatch> batch( | 232 SkAutoTUnref<GrDrawBatch> batch( |
231 BezierCubicOrConicTestBatch::Create(gp, geometry, kl
mEqs, klmSigns[c])); | 233 BezierCubicOrConicTestBatch::Create(gp, geometry, kl
mEqs, klmSigns[c])); |
232 | 234 |
233 tt.target()->drawBatch(pipelineBuilder, batch); | 235 tt.target()->drawBatch(pipelineBuilder, batch); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 boundsPaint.setColor(0xff808080); | 361 boundsPaint.setColor(0xff808080); |
360 boundsPaint.setStrokeWidth(0); | 362 boundsPaint.setStrokeWidth(0); |
361 boundsPaint.setStyle(SkPaint::kStroke_Style); | 363 boundsPaint.setStyle(SkPaint::kStroke_Style); |
362 canvas->drawRect(bounds, boundsPaint); | 364 canvas->drawRect(bounds, boundsPaint); |
363 | 365 |
364 GrTestTarget tt; | 366 GrTestTarget tt; |
365 context->getTestTarget(&tt, rt); | 367 context->getTestTarget(&tt, rt); |
366 SkASSERT(tt.target()); | 368 SkASSERT(tt.target()); |
367 | 369 |
368 GrPipelineBuilder pipelineBuilder; | 370 GrPipelineBuilder pipelineBuilder; |
| 371 pipelineBuilder.setXPFactory( |
| 372 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->u
nref(); |
369 pipelineBuilder.setRenderTarget(rt); | 373 pipelineBuilder.setRenderTarget(rt); |
370 | 374 |
371 BezierCubicOrConicTestBatch::Geometry geometry; | 375 BezierCubicOrConicTestBatch::Geometry geometry; |
372 geometry.fColor = color; | 376 geometry.fColor = color; |
373 geometry.fBounds = bounds; | 377 geometry.fBounds = bounds; |
374 | 378 |
375 SkAutoTUnref<GrDrawBatch> batch( | 379 SkAutoTUnref<GrDrawBatch> batch( |
376 BezierCubicOrConicTestBatch::Create(gp, geometry, kl
mEqs, 1.f)); | 380 BezierCubicOrConicTestBatch::Create(gp, geometry, kl
mEqs, 1.f)); |
377 | 381 |
378 tt.target()->drawBatch(pipelineBuilder, batch); | 382 tt.target()->drawBatch(pipelineBuilder, batch); |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 boundsPaint.setColor(0xff808080); | 601 boundsPaint.setColor(0xff808080); |
598 boundsPaint.setStrokeWidth(0); | 602 boundsPaint.setStrokeWidth(0); |
599 boundsPaint.setStyle(SkPaint::kStroke_Style); | 603 boundsPaint.setStyle(SkPaint::kStroke_Style); |
600 canvas->drawRect(bounds, boundsPaint); | 604 canvas->drawRect(bounds, boundsPaint); |
601 | 605 |
602 GrTestTarget tt; | 606 GrTestTarget tt; |
603 context->getTestTarget(&tt, rt); | 607 context->getTestTarget(&tt, rt); |
604 SkASSERT(tt.target()); | 608 SkASSERT(tt.target()); |
605 | 609 |
606 GrPipelineBuilder pipelineBuilder; | 610 GrPipelineBuilder pipelineBuilder; |
| 611 pipelineBuilder.setXPFactory( |
| 612 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->u
nref(); |
607 pipelineBuilder.setRenderTarget(rt); | 613 pipelineBuilder.setRenderTarget(rt); |
608 | 614 |
609 GrPathUtils::QuadUVMatrix DevToUV(pts); | 615 GrPathUtils::QuadUVMatrix DevToUV(pts); |
610 | 616 |
611 BezierQuadTestBatch::Geometry geometry; | 617 BezierQuadTestBatch::Geometry geometry; |
612 geometry.fColor = color; | 618 geometry.fColor = color; |
613 geometry.fBounds = bounds; | 619 geometry.fBounds = bounds; |
614 | 620 |
615 SkAutoTUnref<GrDrawBatch> batch(BezierQuadTestBatch::Create(
gp, geometry, | 621 SkAutoTUnref<GrDrawBatch> batch(BezierQuadTestBatch::Create(
gp, geometry, |
616
DevToUV)); | 622
DevToUV)); |
(...skipping 12 matching lines...) Expand all Loading... |
629 private: | 635 private: |
630 typedef GM INHERITED; | 636 typedef GM INHERITED; |
631 }; | 637 }; |
632 | 638 |
633 DEF_GM(return new BezierCubicEffects;) | 639 DEF_GM(return new BezierCubicEffects;) |
634 DEF_GM(return new BezierConicEffects;) | 640 DEF_GM(return new BezierConicEffects;) |
635 DEF_GM(return new BezierQuadEffects;) | 641 DEF_GM(return new BezierQuadEffects;) |
636 } | 642 } |
637 | 643 |
638 #endif | 644 #endif |
OLD | NEW |