OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 SkImageFilter_DEFINED | 8 #ifndef SkImageFilter_DEFINED |
9 #define SkImageFilter_DEFINED | 9 #define SkImageFilter_DEFINED |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 kHasLeft_CropEdge = 0x01, | 39 kHasLeft_CropEdge = 0x01, |
40 kHasTop_CropEdge = 0x02, | 40 kHasTop_CropEdge = 0x02, |
41 kHasRight_CropEdge = 0x04, | 41 kHasRight_CropEdge = 0x04, |
42 kHasBottom_CropEdge = 0x08, | 42 kHasBottom_CropEdge = 0x08, |
43 kHasAll_CropEdge = 0x0F, | 43 kHasAll_CropEdge = 0x0F, |
44 }; | 44 }; |
45 CropRect() {} | 45 CropRect() {} |
46 explicit CropRect(const SkRect& rect, uint32_t flags = kHasAll_CropEdge)
: fRect(rect), fFlags(flags) {} | 46 explicit CropRect(const SkRect& rect, uint32_t flags = kHasAll_CropEdge)
: fRect(rect), fFlags(flags) {} |
47 uint32_t flags() const { return fFlags; } | 47 uint32_t flags() const { return fFlags; } |
48 const SkRect& rect() const { return fRect; } | 48 const SkRect& rect() const { return fRect; } |
| 49 #ifndef SK_IGNORE_TO_STRING |
| 50 void toString(SkString* str) const; |
| 51 #endif |
49 private: | 52 private: |
50 SkRect fRect; | 53 SkRect fRect; |
51 uint32_t fFlags; | 54 uint32_t fFlags; |
52 }; | 55 }; |
53 | 56 |
54 // This cache maps from (filter's unique ID + CTM + clipBounds + src bitmap
generation ID) to | 57 // This cache maps from (filter's unique ID + CTM + clipBounds + src bitmap
generation ID) to |
55 // (result, offset). | 58 // (result, offset). |
56 class Cache : public SkRefCnt { | 59 class Cache : public SkRefCnt { |
57 public: | 60 public: |
58 struct Key; | 61 struct Key; |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 */ | 367 */ |
365 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ | 368 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ |
366 Common localVar; \ | 369 Common localVar; \ |
367 do { \ | 370 do { \ |
368 if (!localVar.unflatten(buffer, expectedCount)) { \ | 371 if (!localVar.unflatten(buffer, expectedCount)) { \ |
369 return NULL; \ | 372 return NULL; \ |
370 } \ | 373 } \ |
371 } while (0) | 374 } while (0) |
372 | 375 |
373 #endif | 376 #endif |
OLD | NEW |