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 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1739 | 1739 |
1740 SkRect storage; | 1740 SkRect storage; |
1741 const SkRect* bounds = NULL; | 1741 const SkRect* bounds = NULL; |
1742 if (!path.isInverseFillType() && paint.canComputeFastBounds()) { | 1742 if (!path.isInverseFillType() && paint.canComputeFastBounds()) { |
1743 const SkRect& pathBounds = path.getBounds(); | 1743 const SkRect& pathBounds = path.getBounds(); |
1744 bounds = &paint.computeFastBounds(pathBounds, &storage); | 1744 bounds = &paint.computeFastBounds(pathBounds, &storage); |
1745 if (this->quickReject(*bounds)) { | 1745 if (this->quickReject(*bounds)) { |
1746 return; | 1746 return; |
1747 } | 1747 } |
1748 } | 1748 } |
1749 if (path.isEmpty()) { | 1749 |
1750 const SkRect& r = path.getBounds(); | |
1751 if (r.width() <= 0 && r.height() <= 0) { | |
reed2
2014/02/21 10:48:49
Do we have unit-tests added to exercise this?
Does
yunchao
2014/02/24 03:07:20
Hi Mike,
Do you think we need to add a unit-tests
| |
1750 if (path.isInverseFillType()) { | 1752 if (path.isInverseFillType()) { |
1751 this->internalDrawPaint(paint); | 1753 this->internalDrawPaint(paint); |
1752 } | 1754 } |
1753 return; | 1755 return; |
1754 } | 1756 } |
1755 | 1757 |
1756 LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, bounds) | 1758 LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, bounds) |
1757 | 1759 |
1758 while (iter.next()) { | 1760 while (iter.next()) { |
1759 iter.fDevice->drawPath(iter, path, looper.paint()); | 1761 iter.fDevice->drawPath(iter, path, looper.paint()); |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2241 return *paint; | 2243 return *paint; |
2242 } | 2244 } |
2243 | 2245 |
2244 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); } | 2246 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); } |
2245 int SkCanvas::LayerIter::x() const { return fImpl->getX(); } | 2247 int SkCanvas::LayerIter::x() const { return fImpl->getX(); } |
2246 int SkCanvas::LayerIter::y() const { return fImpl->getY(); } | 2248 int SkCanvas::LayerIter::y() const { return fImpl->getY(); } |
2247 | 2249 |
2248 /////////////////////////////////////////////////////////////////////////////// | 2250 /////////////////////////////////////////////////////////////////////////////// |
2249 | 2251 |
2250 SkCanvas::ClipVisitor::~ClipVisitor() { } | 2252 SkCanvas::ClipVisitor::~ClipVisitor() { } |
OLD | NEW |