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 |
11 #include "../private/SkTArray.h" | 11 #include "../private/SkTArray.h" |
12 #include "../private/SkTemplates.h" | 12 #include "../private/SkTemplates.h" |
13 #include "../private/SkMutex.h" | 13 #include "../private/SkMutex.h" |
| 14 #include "SkColorSpace.h" |
14 #include "SkFilterQuality.h" | 15 #include "SkFilterQuality.h" |
15 #include "SkFlattenable.h" | 16 #include "SkFlattenable.h" |
16 #include "SkMatrix.h" | 17 #include "SkMatrix.h" |
17 #include "SkRect.h" | 18 #include "SkRect.h" |
18 | 19 |
19 class GrContext; | 20 class GrContext; |
20 class GrFragmentProcessor; | 21 class GrFragmentProcessor; |
21 class SkColorFilter; | 22 class SkColorFilter; |
22 struct SkIPoint; | 23 struct SkIPoint; |
23 class SkSpecialImage; | 24 class SkSpecialImage; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 * be exact, but should never be smaller than the real answer. The default | 125 * be exact, but should never be smaller than the real answer. The default |
125 * implementation recursively unions all input bounds, or returns the | 126 * implementation recursively unions all input bounds, or returns the |
126 * source rect if no inputs. | 127 * source rect if no inputs. |
127 */ | 128 */ |
128 SkIRect filterBounds(const SkIRect& src, const SkMatrix& ctm, | 129 SkIRect filterBounds(const SkIRect& src, const SkMatrix& ctm, |
129 MapDirection = kReverse_MapDirection) const; | 130 MapDirection = kReverse_MapDirection) const; |
130 | 131 |
131 #if SK_SUPPORT_GPU | 132 #if SK_SUPPORT_GPU |
132 static sk_sp<SkSpecialImage> DrawWithFP(GrContext* context, | 133 static sk_sp<SkSpecialImage> DrawWithFP(GrContext* context, |
133 sk_sp<GrFragmentProcessor> fp, | 134 sk_sp<GrFragmentProcessor> fp, |
134 const SkIRect& bounds); | 135 const SkIRect& bounds, |
| 136 sk_sp<SkColorSpace> colorSpace); |
135 #endif | 137 #endif |
136 | 138 |
137 /** | 139 /** |
138 * Returns whether this image filter is a color filter and puts the color f
ilter into the | 140 * Returns whether this image filter is a color filter and puts the color f
ilter into the |
139 * "filterPtr" parameter if it can. Does nothing otherwise. | 141 * "filterPtr" parameter if it can. Does nothing otherwise. |
140 * If this returns false, then the filterPtr is unchanged. | 142 * If this returns false, then the filterPtr is unchanged. |
141 * If this returns true, then if filterPtr is not null, it must be set to a
ref'd colorfitler | 143 * If this returns true, then if filterPtr is not null, it must be set to a
ref'd colorfitler |
142 * (i.e. it may not be set to NULL). | 144 * (i.e. it may not be set to NULL). |
143 */ | 145 */ |
144 bool isColorFilterNode(SkColorFilter** filterPtr) const { | 146 bool isColorFilterNode(SkColorFilter** filterPtr) const { |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 */ | 399 */ |
398 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ | 400 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ |
399 Common localVar; \ | 401 Common localVar; \ |
400 do { \ | 402 do { \ |
401 if (!localVar.unflatten(buffer, expectedCount)) { \ | 403 if (!localVar.unflatten(buffer, expectedCount)) { \ |
402 return NULL; \ | 404 return NULL; \ |
403 } \ | 405 } \ |
404 } while (0) | 406 } while (0) |
405 | 407 |
406 #endif | 408 #endif |
OLD | NEW |