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

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

Issue 177073006: add isClipEmpty() -- encourage clients to call this rather than checking clipFoo() results (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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/SkCanvas.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 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after
1477 break; 1477 break;
1478 case SkClipStack::Element::kEmpty_Type: 1478 case SkClipStack::Element::kEmpty_Type:
1479 visitor->clipRect(kEmpty, SkRegion::kIntersect_Op, false); 1479 visitor->clipRect(kEmpty, SkRegion::kIntersect_Op, false);
1480 break; 1480 break;
1481 } 1481 }
1482 } 1482 }
1483 } 1483 }
1484 1484
1485 /////////////////////////////////////////////////////////////////////////////// 1485 ///////////////////////////////////////////////////////////////////////////////
1486 1486
1487 bool SkCanvas::isClipEmpty() const {
1488 return fMCRec->fRasterClip->isEmpty();
1489 }
1490
1487 bool SkCanvas::quickReject(const SkRect& rect) const { 1491 bool SkCanvas::quickReject(const SkRect& rect) const {
1488 1492
1489 if (!rect.isFinite()) 1493 if (!rect.isFinite())
1490 return true; 1494 return true;
1491 1495
1492 if (fMCRec->fRasterClip->isEmpty()) { 1496 if (fMCRec->fRasterClip->isEmpty()) {
1493 return true; 1497 return true;
1494 } 1498 }
1495 1499
1496 if (fMCRec->fMatrix->hasPerspective()) { 1500 if (fMCRec->fMatrix->hasPerspective()) {
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
2284 return *paint; 2288 return *paint;
2285 } 2289 }
2286 2290
2287 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); } 2291 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); }
2288 int SkCanvas::LayerIter::x() const { return fImpl->getX(); } 2292 int SkCanvas::LayerIter::x() const { return fImpl->getX(); }
2289 int SkCanvas::LayerIter::y() const { return fImpl->getY(); } 2293 int SkCanvas::LayerIter::y() const { return fImpl->getY(); }
2290 2294
2291 /////////////////////////////////////////////////////////////////////////////// 2295 ///////////////////////////////////////////////////////////////////////////////
2292 2296
2293 SkCanvas::ClipVisitor::~ClipVisitor() { } 2297 SkCanvas::ClipVisitor::~ClipVisitor() { }
OLDNEW
« no previous file with comments | « include/core/SkCanvas.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698