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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 const SkIRect& clipBounds() const { return fClipBounds; } | 73 const SkIRect& clipBounds() const { return fClipBounds; } |
74 Cache* cache() const { return fCache; } | 74 Cache* cache() const { return fCache; } |
75 private: | 75 private: |
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 Proxy(SkBaseDevice* device, const SkSurfaceProps& props) | 83 Proxy(SkBaseDevice* device) : fDevice(device) { } |
84 : fDevice(device) | |
85 , fProps(props.flags(), kUnknown_SkPixelGeometry) | |
86 {} | |
87 | 84 |
88 SkBaseDevice* createDevice(int width, int height); | 85 SkBaseDevice* createDevice(int width, int height); |
89 // returns true if the proxy handled the filter itself. if this returns | 86 |
| 87 // Returns true if the proxy handled the filter itself. If this returns |
90 // false then the filter's code will be called. | 88 // false then the filter's code will be called. |
91 bool filterImage(const SkImageFilter*, const SkBitmap& src, const SkImag
eFilter::Context&, | 89 bool filterImage(const SkImageFilter*, const SkBitmap& src, const SkImag
eFilter::Context&, |
92 SkBitmap* result, SkIPoint* offset); | 90 SkBitmap* result, SkIPoint* offset); |
93 const SkSurfaceProps& surfaceProps() const { return fProps; } | 91 |
94 | |
95 private: | 92 private: |
96 SkBaseDevice* fDevice; | 93 SkBaseDevice* fDevice; |
97 const SkSurfaceProps fProps; | |
98 }; | 94 }; |
99 | 95 |
100 | 96 |
101 /** | 97 /** |
102 * Request a new (result) image to be created from the src image. | 98 * Request a new (result) image to be created from the src image. |
103 * If the src has no pixels (isNull()) then the request just wants to | 99 * If the src has no pixels (isNull()) then the request just wants to |
104 * receive the config and width/height of the result. | 100 * receive the config and width/height of the result. |
105 * | 101 * |
106 * The matrix is the current matrix on the canvas. | 102 * The matrix is the current matrix on the canvas. |
107 * | 103 * |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 */ | 362 */ |
367 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ | 363 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ |
368 Common localVar; \ | 364 Common localVar; \ |
369 do { \ | 365 do { \ |
370 if (!localVar.unflatten(buffer, expectedCount)) { \ | 366 if (!localVar.unflatten(buffer, expectedCount)) { \ |
371 return NULL; \ | 367 return NULL; \ |
372 } \ | 368 } \ |
373 } while (0) | 369 } while (0) |
374 | 370 |
375 #endif | 371 #endif |
OLD | NEW |