OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 #ifndef GrClip_DEFINED | 8 #ifndef GrClip_DEFINED |
9 #define GrClip_DEFINED | 9 #define GrClip_DEFINED |
10 | 10 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 typedef SkNoncopyable INHERITED; | 59 typedef SkNoncopyable INHERITED; |
60 }; | 60 }; |
61 | 61 |
62 /** | 62 /** |
63 * GrClip is an abstract base class for applying a clip. It constructs a clip ma
sk if necessary, and | 63 * GrClip is an abstract base class for applying a clip. It constructs a clip ma
sk if necessary, and |
64 * fills out a GrAppliedClip instructing the caller on how to set up the draw st
ate. | 64 * fills out a GrAppliedClip instructing the caller on how to set up the draw st
ate. |
65 */ | 65 */ |
66 class GrClip { | 66 class GrClip { |
67 public: | 67 public: |
68 virtual bool quickContains(const SkRect&) const = 0; | 68 virtual bool quickContains(const SkRect&) const = 0; |
| 69 virtual bool quickContains(const SkRRect& rrect) const { |
| 70 return this->quickContains(rrect.getBounds()); |
| 71 } |
69 virtual void getConservativeBounds(int width, int height, SkIRect* devResult
, | 72 virtual void getConservativeBounds(int width, int height, SkIRect* devResult
, |
70 bool* isIntersectionOfRects = nullptr) co
nst = 0; | 73 bool* isIntersectionOfRects = nullptr) co
nst = 0; |
71 virtual bool apply(GrContext*, GrDrawContext*, bool useHWAA, bool hasUserSte
ncilSettings, | 74 virtual bool apply(GrContext*, GrDrawContext*, bool useHWAA, bool hasUserSte
ncilSettings, |
72 GrAppliedClip* out) const = 0; | 75 GrAppliedClip* out) const = 0; |
73 | 76 |
74 virtual ~GrClip() {} | 77 virtual ~GrClip() {} |
75 | 78 |
76 /** | 79 /** |
77 * This is the maximum distance that a draw may extend beyond a clip's bound
ary and still count | 80 * This is the maximum distance that a draw may extend beyond a clip's bound
ary and still count |
78 * count as "on the other side". We leave some slack because floating point
rounding error is | 81 * count as "on the other side". We leave some slack because floating point
rounding error is |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 | 189 |
187 private: | 190 private: |
188 bool apply(GrContext*, GrDrawContext*, bool useHWAA, bool hasUserStencilSett
ings, | 191 bool apply(GrContext*, GrDrawContext*, bool useHWAA, bool hasUserStencilSett
ings, |
189 GrAppliedClip* out) const final; | 192 GrAppliedClip* out) const final; |
190 | 193 |
191 GrScissorState fScissorState; | 194 GrScissorState fScissorState; |
192 bool fHasStencilClip; | 195 bool fHasStencilClip; |
193 }; | 196 }; |
194 | 197 |
195 #endif | 198 #endif |
OLD | NEW |