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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 SkMatrix fCTM; | 76 SkMatrix fCTM; |
77 SkIRect fClipBounds; | 77 SkIRect fClipBounds; |
78 Cache* fCache; | 78 Cache* fCache; |
79 }; | 79 }; |
80 | 80 |
81 class Proxy { | 81 class Proxy { |
82 public: | 82 public: |
83 virtual ~Proxy() {}; | 83 virtual ~Proxy() {}; |
84 | 84 |
85 virtual SkBaseDevice* createDevice(int width, int height) = 0; | 85 virtual SkBaseDevice* createDevice(int width, int height) = 0; |
86 // returns true if the proxy can handle this filter natively | |
87 virtual bool canHandleImageFilter(const SkImageFilter*) = 0; | |
88 // returns true if the proxy handled the filter itself. if this returns | 86 // returns true if the proxy handled the filter itself. if this returns |
89 // false then the filter's code will be called. | 87 // false then the filter's code will be called. |
90 virtual bool filterImage(const SkImageFilter*, const SkBitmap& src, | 88 virtual bool filterImage(const SkImageFilter*, const SkBitmap& src, |
91 const Context&, | 89 const Context&, |
92 SkBitmap* result, SkIPoint* offset) = 0; | 90 SkBitmap* result, SkIPoint* offset) = 0; |
93 virtual const SkSurfaceProps* surfaceProps() const = 0; | 91 virtual const SkSurfaceProps* surfaceProps() const = 0; |
94 }; | 92 }; |
95 | 93 |
96 /** | 94 /** |
97 * Request a new (result) image to be created from the src image. | 95 * Request a new (result) image to be created from the src image. |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 */ | 359 */ |
362 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ | 360 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ |
363 Common localVar; \ | 361 Common localVar; \ |
364 do { \ | 362 do { \ |
365 if (!localVar.unflatten(buffer, expectedCount)) { \ | 363 if (!localVar.unflatten(buffer, expectedCount)) { \ |
366 return NULL; \ | 364 return NULL; \ |
367 } \ | 365 } \ |
368 } while (0) | 366 } while (0) |
369 | 367 |
370 #endif | 368 #endif |
OLD | NEW |