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 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 } | 1117 } |
1118 #endif | 1118 #endif |
1119 | 1119 |
1120 AutoValidateClip avc(this); | 1120 AutoValidateClip avc(this); |
1121 | 1121 |
1122 fDeviceCMDirty = true; | 1122 fDeviceCMDirty = true; |
1123 fLocalBoundsCompareTypeDirty = true; | 1123 fLocalBoundsCompareTypeDirty = true; |
1124 doAA &= fAllowSoftClip; | 1124 doAA &= fAllowSoftClip; |
1125 | 1125 |
1126 if (fMCRec->fMatrix->rectStaysRect()) { | 1126 if (fMCRec->fMatrix->rectStaysRect()) { |
1127 // for these simpler matrices, we can stay a rect ever after applying | 1127 // for these simpler matrices, we can stay a rect even after applying |
1128 // the matrix. This means we don't have to a) make a path, and b) tell | 1128 // the matrix. This means we don't have to a) make a path, and b) tell |
1129 // the region code to scan-convert the path, only to discover that it | 1129 // the region code to scan-convert the path, only to discover that it |
1130 // is really just a rect. | 1130 // is really just a rect. |
1131 SkRect r; | 1131 SkRect r; |
1132 | 1132 |
1133 fMCRec->fMatrix->mapRect(&r, rect); | 1133 fMCRec->fMatrix->mapRect(&r, rect); |
1134 fClipStack.clipDevRect(r, op, doAA); | 1134 fClipStack.clipDevRect(r, op, doAA); |
1135 return fMCRec->fRasterClip->op(r, op, doAA); | 1135 return fMCRec->fRasterClip->op(r, op, doAA); |
1136 } else { | 1136 } else { |
1137 // since we're rotate or some such thing, we convert the rect to a path | 1137 // since we're rotated or some such thing, we convert the rect to a path |
1138 // and clip against that, since it can handle any matrix. However, to | 1138 // and clip against that, since it can handle any matrix. However, to |
1139 // avoid recursion in the case where we are subclassed (e.g. Pictures) | 1139 // avoid recursion in the case where we are subclassed (e.g. Pictures) |
1140 // we explicitly call "our" version of clipPath. | 1140 // we explicitly call "our" version of clipPath. |
1141 SkPath path; | 1141 SkPath path; |
1142 | 1142 |
1143 path.addRect(rect); | 1143 path.addRect(rect); |
1144 return this->SkCanvas::clipPath(path, op, doAA); | 1144 return this->SkCanvas::clipPath(path, op, doAA); |
1145 } | 1145 } |
1146 } | 1146 } |
1147 | 1147 |
(...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2222 return *paint; | 2222 return *paint; |
2223 } | 2223 } |
2224 | 2224 |
2225 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); } | 2225 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); } |
2226 int SkCanvas::LayerIter::x() const { return fImpl->getX(); } | 2226 int SkCanvas::LayerIter::x() const { return fImpl->getX(); } |
2227 int SkCanvas::LayerIter::y() const { return fImpl->getY(); } | 2227 int SkCanvas::LayerIter::y() const { return fImpl->getY(); } |
2228 | 2228 |
2229 /////////////////////////////////////////////////////////////////////////////// | 2229 /////////////////////////////////////////////////////////////////////////////// |
2230 | 2230 |
2231 SkCanvas::ClipVisitor::~ClipVisitor() { } | 2231 SkCanvas::ClipVisitor::~ClipVisitor() { } |
OLD | NEW |