| 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 24 matching lines...) Expand all Loading... |
| 35 // (result, offset). | 35 // (result, offset). |
| 36 class Cache : public SkRefCnt { | 36 class Cache : public SkRefCnt { |
| 37 public: | 37 public: |
| 38 struct Key; | 38 struct Key; |
| 39 virtual ~Cache() {} | 39 virtual ~Cache() {} |
| 40 static Cache* Create(size_t maxBytes); | 40 static Cache* Create(size_t maxBytes); |
| 41 static Cache* Get(); | 41 static Cache* Get(); |
| 42 virtual bool get(const Key& key, SkBitmap* result, SkIPoint* offset) con
st = 0; | 42 virtual bool get(const Key& key, SkBitmap* result, SkIPoint* offset) con
st = 0; |
| 43 virtual void set(const Key& key, const SkBitmap& result, const SkIPoint&
offset) = 0; | 43 virtual void set(const Key& key, const SkBitmap& result, const SkIPoint&
offset) = 0; |
| 44 virtual void purge() {} | 44 virtual void purge() {} |
| 45 virtual void purgeByImageFilterId(uint32_t) {} |
| 45 }; | 46 }; |
| 46 | 47 |
| 47 enum SizeConstraint { | 48 enum SizeConstraint { |
| 48 kExact_SizeConstraint, | 49 kExact_SizeConstraint, |
| 49 kApprox_SizeConstraint, | 50 kApprox_SizeConstraint, |
| 50 }; | 51 }; |
| 51 | 52 |
| 52 class Context { | 53 class Context { |
| 53 public: | 54 public: |
| 54 Context(const SkMatrix& ctm, const SkIRect& clipBounds, Cache* cache, | 55 Context(const SkMatrix& ctm, const SkIRect& clipBounds, Cache* cache, |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 */ | 452 */ |
| 452 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ | 453 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ |
| 453 Common localVar; \ | 454 Common localVar; \ |
| 454 do { \ | 455 do { \ |
| 455 if (!localVar.unflatten(buffer, expectedCount)) { \ | 456 if (!localVar.unflatten(buffer, expectedCount)) { \ |
| 456 return NULL; \ | 457 return NULL; \ |
| 457 } \ | 458 } \ |
| 458 } while (0) | 459 } while (0) |
| 459 | 460 |
| 460 #endif | 461 #endif |
| OLD | NEW |