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 |
11 #include "SkClipStack.h" | 11 #include "SkClipStack.h" |
| 12 #include "GrSurface.h" |
12 | 13 |
13 class GrSurface; | |
14 struct SkIRect; | 14 struct SkIRect; |
15 | 15 |
16 /** | 16 /** |
17 * GrClipData encapsulates the information required to construct the clip | 17 * GrClipData encapsulates the information required to construct the clip |
18 * masks. 'fOrigin' is only non-zero when saveLayer has been called | 18 * masks. 'fOrigin' is only non-zero when saveLayer has been called |
19 * with an offset bounding box. The clips in 'fClipStack' are in | 19 * with an offset bounding box. The clips in 'fClipStack' are in |
20 * device coordinates (i.e., they have been translated by -fOrigin w.r.t. | 20 * device coordinates (i.e., they have been translated by -fOrigin w.r.t. |
21 * the canvas' device coordinates). | 21 * the canvas' device coordinates). |
22 */ | 22 */ |
23 class GrClipData : public SkNoncopyable { | 23 class GrClipData : public SkNoncopyable { |
(...skipping 17 matching lines...) Expand all Loading... |
41 | 41 |
42 return fClipStack == other.fClipStack; | 42 return fClipStack == other.fClipStack; |
43 } | 43 } |
44 | 44 |
45 bool operator!=(const GrClipData& other) const { | 45 bool operator!=(const GrClipData& other) const { |
46 return !(*this == other); | 46 return !(*this == other); |
47 } | 47 } |
48 | 48 |
49 void getConservativeBounds(const GrSurface* surface, | 49 void getConservativeBounds(const GrSurface* surface, |
50 SkIRect* devResult, | 50 SkIRect* devResult, |
| 51 bool* isIntersectionOfRects = NULL) const { |
| 52 this->getConservativeBounds(surface->width(), surface->height(), |
| 53 devResult, isIntersectionOfRects); |
| 54 } |
| 55 |
| 56 void getConservativeBounds(int width, int height, |
| 57 SkIRect* devResult, |
51 bool* isIntersectionOfRects = NULL) const; | 58 bool* isIntersectionOfRects = NULL) const; |
52 }; | 59 }; |
53 | 60 |
54 #endif | 61 #endif |
OLD | NEW |