Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: src/core/SkCanvas.cpp

Issue 167283004: Make canvas pass rrects along to clip stack (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: update comment Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/core/SkRRect.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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() { }
OLDNEW
« no previous file with comments | « include/core/SkRRect.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698