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

Side by Side Diff: include/core/SkClipStack.h

Issue 2241273003: Attempt to throw away rrect clips of rrects. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: fix int to scalar warnings Created 4 years, 4 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 | « no previous file | include/core/SkRRect.h » ('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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
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 #ifndef SkClipStack_DEFINED 8 #ifndef SkClipStack_DEFINED
9 #define SkClipStack_DEFINED 9 #define SkClipStack_DEFINED
10 10
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 case kPath_Type: 151 case kPath_Type:
152 return fPath.get()->conservativelyContainsRect(rect); 152 return fPath.get()->conservativelyContainsRect(rect);
153 case kEmpty_Type: 153 case kEmpty_Type:
154 return false; 154 return false;
155 default: 155 default:
156 SkDEBUGFAIL("Unexpected type."); 156 SkDEBUGFAIL("Unexpected type.");
157 return false; 157 return false;
158 } 158 }
159 } 159 }
160 160
161 bool contains(const SkRRect& rrect) const {
162 switch (fType) {
163 case kRect_Type:
164 return this->getRect().contains(rrect.getBounds());
165 case kRRect_Type:
166 // We don't currently have a generalized rrect-rrect contain ment.
167 return fRRect.contains(rrect.getBounds()) || rrect == fRRect ;
168 case kPath_Type:
169 return fPath.get()->conservativelyContainsRect(rrect.getBoun ds());
170 case kEmpty_Type:
171 return false;
172 default:
173 SkDEBUGFAIL("Unexpected type.");
174 return false;
175 }
176 }
177
161 /** 178 /**
162 * Is the clip shape inverse filled. 179 * Is the clip shape inverse filled.
163 */ 180 */
164 bool isInverseFilled() const { 181 bool isInverseFilled() const {
165 return kPath_Type == fType && fPath.get()->isInverseFillType(); 182 return kPath_Type == fType && fPath.get()->isInverseFillType();
166 } 183 }
167 184
168 /** 185 /**
169 * Replay this clip into the visitor. 186 * Replay this clip into the visitor.
170 */ 187 */
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 * pixels. If 'canvFiniteBound' is an inside out bounding box then it 322 * pixels. If 'canvFiniteBound' is an inside out bounding box then it
306 * encloses all the un-writeable pixels and the true/normal bound is the 323 * encloses all the un-writeable pixels and the true/normal bound is the
307 * infinite plane. isIntersectionOfRects is an optional parameter 324 * infinite plane. isIntersectionOfRects is an optional parameter
308 * that is true if 'canvFiniteBound' resulted from an intersection of rects. 325 * that is true if 'canvFiniteBound' resulted from an intersection of rects.
309 */ 326 */
310 void getBounds(SkRect* canvFiniteBound, 327 void getBounds(SkRect* canvFiniteBound,
311 BoundsType* boundType, 328 BoundsType* boundType,
312 bool* isIntersectionOfRects = NULL) const; 329 bool* isIntersectionOfRects = NULL) const;
313 330
314 /** 331 /**
315 * Returns true if the input rect in device space is entirely contained 332 * Returns true if the input (r)rect in device space is entirely contained
316 * by the clip. A return value of false does not guarantee that the rect 333 * by the clip. A return value of false does not guarantee that the (r)rect
317 * is not contained by the clip. 334 * is not contained by the clip.
318 */ 335 */
319 bool quickContains(const SkRect& devRect) const; 336 bool quickContains(const SkRect& devRect) const;
337 bool quickContains(const SkRRect& devRRect) const;
320 338
321 /** 339 /**
322 * Flattens the clip stack into a single SkPath. Returns true if any of 340 * Flattens the clip stack into a single SkPath. Returns true if any of
323 * the clip stack components requires anti-aliasing. 341 * the clip stack components requires anti-aliasing.
324 */ 342 */
325 bool asPath(SkPath* path) const; 343 bool asPath(SkPath* path) const;
326 344
327 void clipDevRect(const SkIRect& ir, SkRegion::Op op) { 345 void clipDevRect(const SkIRect& ir, SkRegion::Op op) {
328 SkRect r; 346 SkRect r;
329 r.set(ir); 347 r.set(ir);
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 */ 489 */
472 void restoreTo(int saveCount); 490 void restoreTo(int saveCount);
473 491
474 /** 492 /**
475 * Return the next unique generation ID. 493 * Return the next unique generation ID.
476 */ 494 */
477 static int32_t GetNextGenID(); 495 static int32_t GetNextGenID();
478 }; 496 };
479 497
480 #endif 498 #endif
OLDNEW
« no previous file with comments | « no previous file | include/core/SkRRect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698