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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 uint32_t flags() const { return fFlags; } | 44 uint32_t flags() const { return fFlags; } |
45 const SkRect& rect() const { return fRect; } | 45 const SkRect& rect() const { return fRect; } |
46 private: | 46 private: |
47 SkRect fRect; | 47 SkRect fRect; |
48 uint32_t fFlags; | 48 uint32_t fFlags; |
49 }; | 49 }; |
50 | 50 |
51 class SK_API Cache : public SkRefCnt { | 51 class SK_API Cache : public SkRefCnt { |
52 public: | 52 public: |
53 // By default, we cache only image filters with 2 or more children. | 53 // By default, we cache only image filters with 2 or more children. |
| 54 // Values less than 2 mean always cache; values greater than 2 are not s
upported. |
54 static Cache* Create(int minChildren = 2); | 55 static Cache* Create(int minChildren = 2); |
55 virtual ~Cache() {} | 56 virtual ~Cache() {} |
56 virtual bool get(const SkImageFilter* key, SkBitmap* result, SkIPoint* o
ffset) = 0; | 57 virtual bool get(const SkImageFilter* key, SkBitmap* result, SkIPoint* o
ffset) = 0; |
57 virtual void set(const SkImageFilter* key, | 58 virtual void set(const SkImageFilter* key, |
58 const SkBitmap& result, const SkIPoint& offset) = 0; | 59 const SkBitmap& result, const SkIPoint& offset) = 0; |
59 virtual void remove(const SkImageFilter* key) = 0; | 60 virtual void remove(const SkImageFilter* key) = 0; |
60 }; | 61 }; |
61 | 62 |
62 class Context { | 63 class Context { |
63 public: | 64 public: |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 const SkIRect& bounds) const; | 282 const SkIRect& bounds) const; |
282 | 283 |
283 private: | 284 private: |
284 typedef SkFlattenable INHERITED; | 285 typedef SkFlattenable INHERITED; |
285 int fInputCount; | 286 int fInputCount; |
286 SkImageFilter** fInputs; | 287 SkImageFilter** fInputs; |
287 CropRect fCropRect; | 288 CropRect fCropRect; |
288 }; | 289 }; |
289 | 290 |
290 #endif | 291 #endif |
OLD | NEW |