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 1719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1730 | 1730 |
1731 SkRect storage; | 1731 SkRect storage; |
1732 const SkRect* bounds = NULL; | 1732 const SkRect* bounds = NULL; |
1733 if (!path.isInverseFillType() && paint.canComputeFastBounds()) { | 1733 if (!path.isInverseFillType() && paint.canComputeFastBounds()) { |
1734 const SkRect& pathBounds = path.getBounds(); | 1734 const SkRect& pathBounds = path.getBounds(); |
1735 bounds = &paint.computeFastBounds(pathBounds, &storage); | 1735 bounds = &paint.computeFastBounds(pathBounds, &storage); |
1736 if (this->quickReject(*bounds)) { | 1736 if (this->quickReject(*bounds)) { |
1737 return; | 1737 return; |
1738 } | 1738 } |
1739 } | 1739 } |
1740 if (path.isEmpty()) { | 1740 |
1741 SkRect r = path.getBounds(); | |
bsalomon
2014/02/18 17:58:11
const SkRect& ?
yunchao
2014/02/19 01:36:59
Done.
| |
1742 if (r.width() <= 0 && r.height() <= 0) { | |
1741 if (path.isInverseFillType()) { | 1743 if (path.isInverseFillType()) { |
1742 this->internalDrawPaint(paint); | 1744 this->internalDrawPaint(paint); |
1743 } | 1745 } |
1744 return; | 1746 return; |
1745 } | 1747 } |
1746 | 1748 |
1747 LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, bounds) | 1749 LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, bounds) |
1748 | 1750 |
1749 while (iter.next()) { | 1751 while (iter.next()) { |
1750 iter.fDevice->drawPath(iter, path, looper.paint()); | 1752 iter.fDevice->drawPath(iter, path, looper.paint()); |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2232 return *paint; | 2234 return *paint; |
2233 } | 2235 } |
2234 | 2236 |
2235 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); } | 2237 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); } |
2236 int SkCanvas::LayerIter::x() const { return fImpl->getX(); } | 2238 int SkCanvas::LayerIter::x() const { return fImpl->getX(); } |
2237 int SkCanvas::LayerIter::y() const { return fImpl->getY(); } | 2239 int SkCanvas::LayerIter::y() const { return fImpl->getY(); } |
2238 | 2240 |
2239 /////////////////////////////////////////////////////////////////////////////// | 2241 /////////////////////////////////////////////////////////////////////////////// |
2240 | 2242 |
2241 SkCanvas::ClipVisitor::~ClipVisitor() { } | 2243 SkCanvas::ClipVisitor::~ClipVisitor() { } |
OLD | NEW |