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 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1229 clip.setPath(devPath, base, doAA); | 1229 clip.setPath(devPath, base, doAA); |
1230 return currClip->op(clip, op); | 1230 return currClip->op(clip, op); |
1231 } | 1231 } |
1232 } | 1232 } |
1233 } | 1233 } |
1234 | 1234 |
1235 bool SkCanvas::clipRRect(const SkRRect& rrect, SkRegion::Op op, bool doAA) { | 1235 bool SkCanvas::clipRRect(const SkRRect& rrect, SkRegion::Op op, bool doAA) { |
1236 if (rrect.isRect()) { | 1236 if (rrect.isRect()) { |
1237 // call the non-virtual version | 1237 // call the non-virtual version |
1238 return this->SkCanvas::clipRect(rrect.getBounds(), op, doAA); | 1238 return this->SkCanvas::clipRect(rrect.getBounds(), op, doAA); |
1239 } else { | |
1240 SkPath path; | |
1241 path.addRRect(rrect); | |
1242 // call the non-virtual version | |
1243 return this->SkCanvas::clipPath(path, op, doAA); | |
1244 } | 1239 } |
| 1240 |
| 1241 SkRRect transformedRRect; |
| 1242 if (rrect.transform(*fMCRec->fMatrix, &transformedRRect)) { |
| 1243 AutoValidateClip avc(this); |
| 1244 |
| 1245 fDeviceCMDirty = true; |
| 1246 fCachedLocalClipBoundsDirty = true; |
| 1247 doAA &= fAllowSoftClip; |
| 1248 |
| 1249 fClipStack.clipDevRRect(transformedRRect, op, doAA); |
| 1250 |
| 1251 SkPath devPath; |
| 1252 devPath.addRRect(transformedRRect); |
| 1253 |
| 1254 return clipPathHelper(this, fMCRec->fRasterClip, devPath, op, doAA); |
| 1255 } |
| 1256 |
| 1257 SkPath path; |
| 1258 path.addRRect(rrect); |
| 1259 // call the non-virtual version |
| 1260 return this->SkCanvas::clipPath(path, op, doAA); |
1245 } | 1261 } |
1246 | 1262 |
1247 bool SkCanvas::clipPath(const SkPath& path, SkRegion::Op op, bool doAA) { | 1263 bool SkCanvas::clipPath(const SkPath& path, SkRegion::Op op, bool doAA) { |
1248 #ifdef SK_ENABLE_CLIP_QUICKREJECT | 1264 #ifdef SK_ENABLE_CLIP_QUICKREJECT |
1249 if (SkRegion::kIntersect_Op == op && !path.isInverseFillType()) { | 1265 if (SkRegion::kIntersect_Op == op && !path.isInverseFillType()) { |
1250 if (fMCRec->fRasterClip->isEmpty()) { | 1266 if (fMCRec->fRasterClip->isEmpty()) { |
1251 return false; | 1267 return false; |
1252 } | 1268 } |
1253 | 1269 |
1254 if (this->quickReject(path.getBounds())) { | 1270 if (this->quickReject(path.getBounds())) { |
(...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2227 return *paint; | 2243 return *paint; |
2228 } | 2244 } |
2229 | 2245 |
2230 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); } | 2246 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); } |
2231 int SkCanvas::LayerIter::x() const { return fImpl->getX(); } | 2247 int SkCanvas::LayerIter::x() const { return fImpl->getX(); } |
2232 int SkCanvas::LayerIter::y() const { return fImpl->getY(); } | 2248 int SkCanvas::LayerIter::y() const { return fImpl->getY(); } |
2233 | 2249 |
2234 /////////////////////////////////////////////////////////////////////////////// | 2250 /////////////////////////////////////////////////////////////////////////////// |
2235 | 2251 |
2236 SkCanvas::ClipVisitor::~ClipVisitor() { } | 2252 SkCanvas::ClipVisitor::~ClipVisitor() { } |
OLD | NEW |