| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 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 #include "GrAtlasTextContext.h" | 9 #include "GrAtlasTextContext.h" |
| 10 #include "GrBatchTest.h" | 10 #include "GrBatchTest.h" |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 const SkMatrix& viewMatrix, | 457 const SkMatrix& viewMatrix, |
| 458 const SkRRect& rrect, | 458 const SkRRect& rrect, |
| 459 const GrStrokeInfo& strokeInfo) { | 459 const GrStrokeInfo& strokeInfo) { |
| 460 RETURN_IF_ABANDONED | 460 RETURN_IF_ABANDONED |
| 461 SkDEBUGCODE(this->validate();) | 461 SkDEBUGCODE(this->validate();) |
| 462 | 462 |
| 463 if (rrect.isEmpty()) { | 463 if (rrect.isEmpty()) { |
| 464 return; | 464 return; |
| 465 } | 465 } |
| 466 | 466 |
| 467 if (strokeInfo.isDashed()) { | 467 SkASSERT(!strokeInfo.isDashed()); // this should've been devolved to a path
in SkGpuDevice |
| 468 SkPath path; | |
| 469 path.setIsVolatile(true); | |
| 470 path.addRRect(rrect); | |
| 471 this->drawPath(clip, paint, viewMatrix, path, strokeInfo); | |
| 472 return; | |
| 473 } | |
| 474 | 468 |
| 475 AutoCheckFlush acf(fDrawingManager); | 469 AutoCheckFlush acf(fDrawingManager); |
| 476 | 470 |
| 477 GrPipelineBuilder pipelineBuilder(paint, fRenderTarget, clip); | 471 GrPipelineBuilder pipelineBuilder(paint, fRenderTarget, clip); |
| 478 GrColor color = paint.getColor(); | 472 GrColor color = paint.getColor(); |
| 479 | 473 |
| 480 if (!GrOvalRenderer::DrawRRect(this->getDrawTarget(), | 474 if (!GrOvalRenderer::DrawRRect(this->getDrawTarget(), |
| 481 pipelineBuilder, | 475 pipelineBuilder, |
| 482 color, | 476 color, |
| 483 viewMatrix, | 477 viewMatrix, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 const SkMatrix& viewMatrix, | 530 const SkMatrix& viewMatrix, |
| 537 const SkRect& oval, | 531 const SkRect& oval, |
| 538 const GrStrokeInfo& strokeInfo) { | 532 const GrStrokeInfo& strokeInfo) { |
| 539 RETURN_IF_ABANDONED | 533 RETURN_IF_ABANDONED |
| 540 SkDEBUGCODE(this->validate();) | 534 SkDEBUGCODE(this->validate();) |
| 541 | 535 |
| 542 if (oval.isEmpty()) { | 536 if (oval.isEmpty()) { |
| 543 return; | 537 return; |
| 544 } | 538 } |
| 545 | 539 |
| 546 if (strokeInfo.isDashed()) { | 540 SkASSERT(!strokeInfo.isDashed()); // this should've been devolved to a path
in SkGpuDevice |
| 547 SkPath path; | |
| 548 path.setIsVolatile(true); | |
| 549 path.addOval(oval); | |
| 550 this->drawPath(clip, paint, viewMatrix, path, strokeInfo); | |
| 551 return; | |
| 552 } | |
| 553 | 541 |
| 554 AutoCheckFlush acf(fDrawingManager); | 542 AutoCheckFlush acf(fDrawingManager); |
| 555 | 543 |
| 556 GrPipelineBuilder pipelineBuilder(paint, fRenderTarget, clip); | 544 GrPipelineBuilder pipelineBuilder(paint, fRenderTarget, clip); |
| 557 GrColor color = paint.getColor(); | 545 GrColor color = paint.getColor(); |
| 558 | 546 |
| 559 if (!GrOvalRenderer::DrawOval(this->getDrawTarget(), | 547 if (!GrOvalRenderer::DrawOval(this->getDrawTarget(), |
| 560 pipelineBuilder, | 548 pipelineBuilder, |
| 561 color, | 549 color, |
| 562 viewMatrix, | 550 viewMatrix, |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 args.fAntiAlias = useCoverageAA; | 799 args.fAntiAlias = useCoverageAA; |
| 812 pr->drawPath(args); | 800 pr->drawPath(args); |
| 813 } | 801 } |
| 814 | 802 |
| 815 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b
atch) { | 803 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b
atch) { |
| 816 RETURN_IF_ABANDONED | 804 RETURN_IF_ABANDONED |
| 817 SkDEBUGCODE(this->validate();) | 805 SkDEBUGCODE(this->validate();) |
| 818 | 806 |
| 819 this->getDrawTarget()->drawBatch(*pipelineBuilder, batch); | 807 this->getDrawTarget()->drawBatch(*pipelineBuilder, batch); |
| 820 } | 808 } |
| OLD | NEW |