OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2008 The Android Open Source Project | 3 * Copyright 2008 The Android Open Source Project |
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 | 9 |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 1563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1574 if (paint.canComputeFastBounds()) { | 1574 if (paint.canComputeFastBounds()) { |
1575 SkRect storage; | 1575 SkRect storage; |
1576 if (this->quickReject(paint.computeFastBounds(rrect.getBounds(), &storag
e))) { | 1576 if (this->quickReject(paint.computeFastBounds(rrect.getBounds(), &storag
e))) { |
1577 return; | 1577 return; |
1578 } | 1578 } |
1579 } | 1579 } |
1580 | 1580 |
1581 if (rrect.isRect()) { | 1581 if (rrect.isRect()) { |
1582 // call the non-virtual version | 1582 // call the non-virtual version |
1583 this->SkCanvas::drawRect(rrect.getBounds(), paint); | 1583 this->SkCanvas::drawRect(rrect.getBounds(), paint); |
1584 } else { | 1584 return; |
1585 SkPath path; | 1585 } else if (rrect.isOval()) { |
1586 path.addRRect(rrect); | |
1587 // call the non-virtual version | 1586 // call the non-virtual version |
1588 this->SkCanvas::drawPath(path, paint); | 1587 this->SkCanvas::drawOval(rrect.getBounds(), paint); |
| 1588 return; |
1589 } | 1589 } |
| 1590 |
| 1591 LOOPER_BEGIN(paint, SkDrawFilter::kRRect_Type) |
| 1592 |
| 1593 while (iter.next()) { |
| 1594 iter.fDevice->drawRRect(iter, rrect, looper.paint()); |
| 1595 } |
| 1596 |
| 1597 LOOPER_END |
1590 } | 1598 } |
1591 | 1599 |
1592 | 1600 |
1593 void SkCanvas::drawPath(const SkPath& path, const SkPaint& paint) { | 1601 void SkCanvas::drawPath(const SkPath& path, const SkPaint& paint) { |
1594 CHECK_SHADER_NOSETCONTEXT(paint); | 1602 CHECK_SHADER_NOSETCONTEXT(paint); |
1595 | 1603 |
1596 if (!path.isFinite()) { | 1604 if (!path.isFinite()) { |
1597 return; | 1605 return; |
1598 } | 1606 } |
1599 | 1607 |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2128 return *paint; | 2136 return *paint; |
2129 } | 2137 } |
2130 | 2138 |
2131 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); } | 2139 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); } |
2132 int SkCanvas::LayerIter::x() const { return fImpl->getX(); } | 2140 int SkCanvas::LayerIter::x() const { return fImpl->getX(); } |
2133 int SkCanvas::LayerIter::y() const { return fImpl->getY(); } | 2141 int SkCanvas::LayerIter::y() const { return fImpl->getY(); } |
2134 | 2142 |
2135 /////////////////////////////////////////////////////////////////////////////// | 2143 /////////////////////////////////////////////////////////////////////////////// |
2136 | 2144 |
2137 SkCanvas::ClipVisitor::~ClipVisitor() { } | 2145 SkCanvas::ClipVisitor::~ClipVisitor() { } |
OLD | NEW |