OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkGpuDevice.h" | 8 #include "SkGpuDevice.h" |
9 | 9 |
10 #include "GrBlurUtils.h" | 10 #include "GrBlurUtils.h" |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 } | 547 } |
548 | 548 |
549 GrPaint grPaint; | 549 GrPaint grPaint; |
550 if (!SkPaintToGrPaint(this->context(), fDrawContext.get(), paint, *draw.fMat
rix, &grPaint)) { | 550 if (!SkPaintToGrPaint(this->context(), fDrawContext.get(), paint, *draw.fMat
rix, &grPaint)) { |
551 return; | 551 return; |
552 } | 552 } |
553 | 553 |
554 fDrawContext->drawOval(fClip, grPaint, *draw.fMatrix, oval, GrStyle(paint)); | 554 fDrawContext->drawOval(fClip, grPaint, *draw.fMatrix, oval, GrStyle(paint)); |
555 } | 555 } |
556 | 556 |
| 557 void SkGpuDevice::drawArc(const SkDraw& draw, const SkRect& oval, SkScalar start
Angle, |
| 558 SkScalar sweepAngle, bool useCenter, const SkPaint& pa
int) { |
| 559 ASSERT_SINGLE_OWNER |
| 560 GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawArc", fContext); |
| 561 CHECK_SHOULD_DRAW(draw); |
| 562 |
| 563 if (paint.getMaskFilter()) { |
| 564 this->INHERITED::drawArc(draw, oval, startAngle, sweepAngle, useCenter,
paint); |
| 565 return; |
| 566 } |
| 567 GrPaint grPaint; |
| 568 if (!SkPaintToGrPaint(this->context(), fDrawContext.get(), paint, *draw.fMat
rix, &grPaint)) { |
| 569 return; |
| 570 } |
| 571 |
| 572 fDrawContext->drawArc(fClip, grPaint, *draw.fMatrix, oval, startAngle, sweep
Angle, useCenter, |
| 573 GrStyle(paint)); |
| 574 } |
| 575 |
557 #include "SkMaskFilter.h" | 576 #include "SkMaskFilter.h" |
558 | 577 |
559 /////////////////////////////////////////////////////////////////////////////// | 578 /////////////////////////////////////////////////////////////////////////////// |
560 void SkGpuDevice::drawStrokedLine(const SkPoint points[2], | 579 void SkGpuDevice::drawStrokedLine(const SkPoint points[2], |
561 const SkDraw& draw, | 580 const SkDraw& draw, |
562 const SkPaint& origPaint) { | 581 const SkPaint& origPaint) { |
563 ASSERT_SINGLE_OWNER | 582 ASSERT_SINGLE_OWNER |
564 GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawStrokedLine", fContext); | 583 GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawStrokedLine", fContext); |
565 CHECK_SHOULD_DRAW(draw); | 584 CHECK_SHOULD_DRAW(draw); |
566 | 585 |
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1788 } | 1807 } |
1789 | 1808 |
1790 SkImageFilterCache* SkGpuDevice::getImageFilterCache() { | 1809 SkImageFilterCache* SkGpuDevice::getImageFilterCache() { |
1791 ASSERT_SINGLE_OWNER | 1810 ASSERT_SINGLE_OWNER |
1792 // We always return a transient cache, so it is freed after each | 1811 // We always return a transient cache, so it is freed after each |
1793 // filter traversal. | 1812 // filter traversal. |
1794 return SkImageFilterCache::Create(kDefaultImageFilterCacheSize); | 1813 return SkImageFilterCache::Create(kDefaultImageFilterCacheSize); |
1795 } | 1814 } |
1796 | 1815 |
1797 #endif | 1816 #endif |
OLD | NEW |