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

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

Issue 164203002: Don't modify the clipstack in saveLayer() if the kClipToLayer_SaveFlag is (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Use allocN32Pixels() shortcut. 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
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 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 if (!ir.intersect(clipBounds)) { 813 if (!ir.intersect(clipBounds)) {
814 if (bounds_affects_clip(flags)) { 814 if (bounds_affects_clip(flags)) {
815 fMCRec->fRasterClip->setEmpty(); 815 fMCRec->fRasterClip->setEmpty();
816 } 816 }
817 return false; 817 return false;
818 } 818 }
819 } else { // no user bounds, so just use the clip 819 } else { // no user bounds, so just use the clip
820 ir = clipBounds; 820 ir = clipBounds;
821 } 821 }
822 822
823 fClipStack.clipDevRect(ir, op); 823 if (bounds_affects_clip(flags)) {
824 824 fClipStack.clipDevRect(ir, op);
825 // early exit if the clip is now empty 825 // early exit if the clip is now empty
826 if (bounds_affects_clip(flags) && 826 if (!fMCRec->fRasterClip->op(ir, op)) {
827 !fMCRec->fRasterClip->op(ir, op)) { 827 return false;
828 return false; 828 }
829 } 829 }
830 830
831 if (intersection) { 831 if (intersection) {
832 *intersection = ir; 832 *intersection = ir;
833 } 833 }
834 return true; 834 return true;
835 } 835 }
836 836
837 int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint, 837 int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint,
838 SaveFlags flags) { 838 SaveFlags flags) {
(...skipping 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after
2232 return *paint; 2232 return *paint;
2233 } 2233 }
2234 2234
2235 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); } 2235 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); }
2236 int SkCanvas::LayerIter::x() const { return fImpl->getX(); } 2236 int SkCanvas::LayerIter::x() const { return fImpl->getX(); }
2237 int SkCanvas::LayerIter::y() const { return fImpl->getY(); } 2237 int SkCanvas::LayerIter::y() const { return fImpl->getY(); }
2238 2238
2239 /////////////////////////////////////////////////////////////////////////////// 2239 ///////////////////////////////////////////////////////////////////////////////
2240 2240
2241 SkCanvas::ClipVisitor::~ClipVisitor() { } 2241 SkCanvas::ClipVisitor::~ClipVisitor() { }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698