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

Side by Side Diff: src/core/SkAAClip.h

Issue 445233006: add isRect() check to AAClip, to detect if a soft-clip is really just an irect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add comment Created 6 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 | src/core/SkAAClip.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 /* 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 8
9 #ifndef SkAAClip_DEFINED 9 #ifndef SkAAClip_DEFINED
10 #define SkAAClip_DEFINED 10 #define SkAAClip_DEFINED
(...skipping 11 matching lines...) Expand all
22 friend bool operator==(const SkAAClip&, const SkAAClip&); 22 friend bool operator==(const SkAAClip&, const SkAAClip&);
23 friend bool operator!=(const SkAAClip& a, const SkAAClip& b) { 23 friend bool operator!=(const SkAAClip& a, const SkAAClip& b) {
24 return !(a == b); 24 return !(a == b);
25 } 25 }
26 26
27 void swap(SkAAClip&); 27 void swap(SkAAClip&);
28 28
29 bool isEmpty() const { return NULL == fRunHead; } 29 bool isEmpty() const { return NULL == fRunHead; }
30 const SkIRect& getBounds() const { return fBounds; } 30 const SkIRect& getBounds() const { return fBounds; }
31 31
32 // Returns true iff the clip is not empty, and is just a hard-edged rect (no partial alpha).
33 // If true, getBounds() can be used in place of this clip.
34 bool isRect() const;
35
32 bool setEmpty(); 36 bool setEmpty();
33 bool setRect(const SkIRect&); 37 bool setRect(const SkIRect&);
34 bool setRect(const SkRect&, bool doAA = true); 38 bool setRect(const SkRect&, bool doAA = true);
35 bool setPath(const SkPath&, const SkRegion* clip = NULL, bool doAA = true); 39 bool setPath(const SkPath&, const SkRegion* clip = NULL, bool doAA = true);
36 bool setRegion(const SkRegion&); 40 bool setRegion(const SkRegion&);
37 bool set(const SkAAClip&); 41 bool set(const SkAAClip&);
38 42
39 bool op(const SkAAClip&, const SkAAClip&, SkRegion::Op); 43 bool op(const SkAAClip&, const SkAAClip&, SkRegion::Op);
40 44
41 // Helpers for op() 45 // Helpers for op()
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 enum { 127 enum {
124 kSize = 32 * 32 128 kSize = 32 * 32
125 }; 129 };
126 SkAutoSMalloc<kSize> fGrayMaskScratch; // used for blitMask 130 SkAutoSMalloc<kSize> fGrayMaskScratch; // used for blitMask
127 void* fScanlineScratch; // enough for a mask at 32bit, or runs+aa 131 void* fScanlineScratch; // enough for a mask at 32bit, or runs+aa
128 132
129 void ensureRunsAndAA(); 133 void ensureRunsAndAA();
130 }; 134 };
131 135
132 #endif 136 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkAAClip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698