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 // This test only works with the GPU backend. | 8 // This test only works with the GPU backend. |
9 | 9 |
10 #include "gm.h" | 10 #include "gm.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 | 181 |
182 SkRect bounds; | 182 SkRect bounds; |
183 bounds.set(pts, 4); | 183 bounds.set(pts, 4); |
184 | 184 |
185 SkPaint boundsPaint; | 185 SkPaint boundsPaint; |
186 boundsPaint.setColor(0xff808080); | 186 boundsPaint.setColor(0xff808080); |
187 boundsPaint.setStrokeWidth(0); | 187 boundsPaint.setStrokeWidth(0); |
188 boundsPaint.setStyle(SkPaint::kStroke_Style); | 188 boundsPaint.setStyle(SkPaint::kStroke_Style); |
189 canvas->drawRect(bounds, boundsPaint); | 189 canvas->drawRect(bounds, boundsPaint); |
190 | 190 |
191 GrPipelineBuilder pipelineBuilder; | 191 GrPaint grPaint; |
192 pipelineBuilder.setXPFactory( | 192 grPaint.setXPFactory(GrPorterDuffXPFactory::Make(SkXfermode:
:kSrc_Mode)); |
193 GrPorterDuffXPFactory::Make(SkXfermode::kSrc_Mode)); | |
194 | 193 |
195 SkAutoTUnref<GrDrawBatch> batch( | 194 SkAutoTUnref<GrDrawBatch> batch( |
196 new BezierCubicOrConicTestBatch(gp, bounds, color, klmEq
s, klmSigns[c])); | 195 new BezierCubicOrConicTestBatch(gp, bounds, color, klmEq
s, klmSigns[c])); |
197 | 196 |
198 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin
eBuilder, batch); | 197 drawContext->drawContextPriv().testingOnly_drawBatch(grPaint
, batch); |
199 } | 198 } |
200 ++col; | 199 ++col; |
201 if (numCols == col) { | 200 if (numCols == col) { |
202 col = 0; | 201 col = 0; |
203 ++row; | 202 ++row; |
204 } | 203 } |
205 } | 204 } |
206 } | 205 } |
207 } | 206 } |
208 | 207 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 //SkPoint bPts[] = {{0.f, 0.f}, {800.f, 800.f}}; | 312 //SkPoint bPts[] = {{0.f, 0.f}, {800.f, 800.f}}; |
314 //bounds.set(bPts, 2); | 313 //bounds.set(bPts, 2); |
315 bounds.set(pts, 3); | 314 bounds.set(pts, 3); |
316 | 315 |
317 SkPaint boundsPaint; | 316 SkPaint boundsPaint; |
318 boundsPaint.setColor(0xff808080); | 317 boundsPaint.setColor(0xff808080); |
319 boundsPaint.setStrokeWidth(0); | 318 boundsPaint.setStrokeWidth(0); |
320 boundsPaint.setStyle(SkPaint::kStroke_Style); | 319 boundsPaint.setStyle(SkPaint::kStroke_Style); |
321 canvas->drawRect(bounds, boundsPaint); | 320 canvas->drawRect(bounds, boundsPaint); |
322 | 321 |
323 GrPipelineBuilder pipelineBuilder; | 322 GrPaint grPaint; |
324 pipelineBuilder.setXPFactory( | 323 grPaint.setXPFactory(GrPorterDuffXPFactory::Make(SkXfermode:
:kSrc_Mode)); |
325 GrPorterDuffXPFactory::Make(SkXfermode::kSrc_Mode)); | |
326 | 324 |
327 SkAutoTUnref<GrDrawBatch> batch( | 325 SkAutoTUnref<GrDrawBatch> batch( |
328 new BezierCubicOrConicTestBatch(gp, bounds, color, klmEq
s, 1.f)); | 326 new BezierCubicOrConicTestBatch(gp, bounds, color, klmEq
s, 1.f)); |
329 | 327 |
330 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin
eBuilder, batch); | 328 drawContext->drawContextPriv().testingOnly_drawBatch(grPaint
, batch); |
331 } | 329 } |
332 ++col; | 330 ++col; |
333 if (numCols == col) { | 331 if (numCols == col) { |
334 col = 0; | 332 col = 0; |
335 ++row; | 333 ++row; |
336 } | 334 } |
337 } | 335 } |
338 } | 336 } |
339 } | 337 } |
340 | 338 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 | 518 |
521 SkRect bounds; | 519 SkRect bounds; |
522 bounds.set(pts, 3); | 520 bounds.set(pts, 3); |
523 | 521 |
524 SkPaint boundsPaint; | 522 SkPaint boundsPaint; |
525 boundsPaint.setColor(0xff808080); | 523 boundsPaint.setColor(0xff808080); |
526 boundsPaint.setStrokeWidth(0); | 524 boundsPaint.setStrokeWidth(0); |
527 boundsPaint.setStyle(SkPaint::kStroke_Style); | 525 boundsPaint.setStyle(SkPaint::kStroke_Style); |
528 canvas->drawRect(bounds, boundsPaint); | 526 canvas->drawRect(bounds, boundsPaint); |
529 | 527 |
530 GrPipelineBuilder pipelineBuilder; | 528 GrPaint grPaint; |
531 pipelineBuilder.setXPFactory( | 529 grPaint.setXPFactory(GrPorterDuffXPFactory::Make(SkXfermode:
:kSrc_Mode)); |
532 GrPorterDuffXPFactory::Make(SkXfermode::kSrc_Mode)); | |
533 | 530 |
534 GrPathUtils::QuadUVMatrix DevToUV(pts); | 531 GrPathUtils::QuadUVMatrix DevToUV(pts); |
535 | 532 |
536 SkAutoTUnref<GrDrawBatch> batch( | 533 SkAutoTUnref<GrDrawBatch> batch( |
537 new BezierQuadTestBatch(gp, bounds, color, DevToUV)); | 534 new BezierQuadTestBatch(gp, bounds, color, DevToUV)); |
538 | 535 |
539 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin
eBuilder, batch); | 536 drawContext->drawContextPriv().testingOnly_drawBatch(grPaint
, batch); |
540 } | 537 } |
541 ++col; | 538 ++col; |
542 if (numCols == col) { | 539 if (numCols == col) { |
543 col = 0; | 540 col = 0; |
544 ++row; | 541 ++row; |
545 } | 542 } |
546 } | 543 } |
547 } | 544 } |
548 } | 545 } |
549 | 546 |
550 private: | 547 private: |
551 typedef GM INHERITED; | 548 typedef GM INHERITED; |
552 }; | 549 }; |
553 | 550 |
554 DEF_GM(return new BezierCubicEffects;) | 551 DEF_GM(return new BezierCubicEffects;) |
555 DEF_GM(return new BezierConicEffects;) | 552 DEF_GM(return new BezierConicEffects;) |
556 DEF_GM(return new BezierQuadEffects;) | 553 DEF_GM(return new BezierQuadEffects;) |
557 } | 554 } |
558 | 555 |
559 #endif | 556 #endif |
OLD | NEW |