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

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

Issue 833193002: Remove SkPath::asRect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « include/core/SkPath.h ('k') | src/core/SkPath.cpp » ('j') | 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 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkClipStack.h" 9 #include "SkClipStack.h"
10 #include "SkPath.h" 10 #include "SkPath.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 break; 105 break;
106 case kEmpty_Type: 106 case kEmpty_Type:
107 // Should this set to an empty, inverse filled path? 107 // Should this set to an empty, inverse filled path?
108 break; 108 break;
109 } 109 }
110 } 110 }
111 111
112 void SkClipStack::Element::initPath(int saveCount, const SkPath& path, SkRegion: :Op op, 112 void SkClipStack::Element::initPath(int saveCount, const SkPath& path, SkRegion: :Op op,
113 bool doAA) { 113 bool doAA) {
114 if (!path.isInverseFillType()) { 114 if (!path.isInverseFillType()) {
115 if (SkPath::kNone_PathAsRect != path.asRect()) { 115 SkRect r;
116 this->initRect(saveCount, path.getBounds(), op, doAA); 116 if (path.isRect(&r)) {
117 this->initRect(saveCount, r, op, doAA);
117 return; 118 return;
118 } 119 }
119 SkRect ovalRect; 120 SkRect ovalRect;
120 if (path.isOval(&ovalRect)) { 121 if (path.isOval(&ovalRect)) {
121 SkRRect rrect; 122 SkRRect rrect;
122 rrect.setOval(ovalRect); 123 rrect.setOval(ovalRect);
123 this->initRRect(saveCount, rrect, op, doAA); 124 this->initRRect(saveCount, rrect, op, doAA);
124 return; 125 return;
125 } 126 }
126 } 127 }
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 901
901 void SkClipStack::dump() const { 902 void SkClipStack::dump() const {
902 B2TIter iter(*this); 903 B2TIter iter(*this);
903 const Element* e; 904 const Element* e;
904 while ((e = iter.next())) { 905 while ((e = iter.next())) {
905 e->dump(); 906 e->dump();
906 SkDebugf("\n"); 907 SkDebugf("\n");
907 } 908 }
908 } 909 }
909 #endif 910 #endif
OLDNEW
« no previous file with comments | « include/core/SkPath.h ('k') | src/core/SkPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698