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 | |
52 private: | 49 private: |
53 SkRect fRect; | 50 SkRect fRect; |
54 uint32_t fFlags; | 51 uint32_t fFlags; |
55 }; | 52 }; |
56 | 53 |
57 // This cache maps from (filter's unique ID + CTM + clipBounds + src bitmap
generation ID) to | 54 // This cache maps from (filter's unique ID + CTM + clipBounds + src bitmap
generation ID) to |
58 // (result, offset). | 55 // (result, offset). |
59 class Cache : public SkRefCnt { | 56 class Cache : public SkRefCnt { |
60 public: | 57 public: |
61 struct Key; | 58 struct Key; |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 */ | 364 */ |
368 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ | 365 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ |
369 Common localVar; \ | 366 Common localVar; \ |
370 do { \ | 367 do { \ |
371 if (!localVar.unflatten(buffer, expectedCount)) { \ | 368 if (!localVar.unflatten(buffer, expectedCount)) { \ |
372 return NULL; \ | 369 return NULL; \ |
373 } \ | 370 } \ |
374 } while (0) | 371 } while (0) |
375 | 372 |
376 #endif | 373 #endif |
OLD | NEW |