| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 SkIRect* devResult, | 140 SkIRect* devResult, |
| 141 bool* isIntersectionOfRects = NULL) const { | 141 bool* isIntersectionOfRects = NULL) const { |
| 142 this->getConservativeBounds(surface->width(), surface->height(), | 142 this->getConservativeBounds(surface->width(), surface->height(), |
| 143 devResult, isIntersectionOfRects); | 143 devResult, isIntersectionOfRects); |
| 144 } | 144 } |
| 145 | 145 |
| 146 void getConservativeBounds(int width, int height, | 146 void getConservativeBounds(int width, int height, |
| 147 SkIRect* devResult, | 147 SkIRect* devResult, |
| 148 bool* isIntersectionOfRects = NULL) const; | 148 bool* isIntersectionOfRects = NULL) const; |
| 149 | 149 |
| 150 static const GrClip& WideOpen() { | 150 static const GrClip& WideOpen(); |
| 151 static GrClip clip; | |
| 152 return clip; | |
| 153 } | |
| 154 | 151 |
| 155 enum ClipType { | 152 enum ClipType { |
| 156 kClipStack_ClipType, | 153 kClipStack_ClipType, |
| 157 kWideOpen_ClipType, | 154 kWideOpen_ClipType, |
| 158 kIRect_ClipType, | 155 kIRect_ClipType, |
| 159 }; | 156 }; |
| 160 | 157 |
| 161 ClipType clipType() const { return fClipType; } | 158 ClipType clipType() const { return fClipType; } |
| 162 | 159 |
| 163 private: | 160 private: |
| 164 union Clip { | 161 union Clip { |
| 165 struct ClipStack { | 162 struct ClipStack { |
| 166 const SkClipStack* fStack; | 163 const SkClipStack* fStack; |
| 167 SkIPoint fOrigin; | 164 SkIPoint fOrigin; |
| 168 } fClipStack; | 165 } fClipStack; |
| 169 SkIRect fIRect; | 166 SkIRect fIRect; |
| 170 } fClip; | 167 } fClip; |
| 171 | 168 |
| 172 ClipType fClipType; | 169 ClipType fClipType; |
| 173 }; | 170 }; |
| 174 | 171 |
| 175 #endif | 172 #endif |
| OLD | NEW |