OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The Android Open Source Project | 2 * Copyright 2012 The Android Open Source Project |
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 #include "SkMorphologyImageFilter.h" | 8 #include "SkMorphologyImageFilter.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 return Create(width, height, common.getInput(0), &common.cropRect(), common.
uniqueID()); | 257 return Create(width, height, common.getInput(0), &common.cropRect(), common.
uniqueID()); |
258 } | 258 } |
259 | 259 |
260 SkFlattenable* SkDilateImageFilter::CreateProc(SkReadBuffer& buffer) { | 260 SkFlattenable* SkDilateImageFilter::CreateProc(SkReadBuffer& buffer) { |
261 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); | 261 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); |
262 const int width = buffer.readInt(); | 262 const int width = buffer.readInt(); |
263 const int height = buffer.readInt(); | 263 const int height = buffer.readInt(); |
264 return Create(width, height, common.getInput(0), &common.cropRect(), common.
uniqueID()); | 264 return Create(width, height, common.getInput(0), &common.cropRect(), common.
uniqueID()); |
265 } | 265 } |
266 | 266 |
| 267 #ifndef SK_IGNORE_TO_STRING |
| 268 void SkErodeImageFilter::toString(SkString* str) const { |
| 269 str->appendf("SkErodeImageFilter: ("); |
| 270 str->appendf("radius: (%d,%d)", this->radius().fWidth, this->radius().fHeigh
t); |
| 271 str->append(")"); |
| 272 } |
| 273 #endif |
| 274 |
| 275 #ifndef SK_IGNORE_TO_STRING |
| 276 void SkDilateImageFilter::toString(SkString* str) const { |
| 277 str->appendf("SkDilateImageFilter: ("); |
| 278 str->appendf("radius: (%d,%d)", this->radius().fWidth, this->radius().fHeigh
t); |
| 279 str->append(")"); |
| 280 } |
| 281 #endif |
| 282 |
267 #if SK_SUPPORT_GPU | 283 #if SK_SUPPORT_GPU |
268 | 284 |
269 /////////////////////////////////////////////////////////////////////////////// | 285 /////////////////////////////////////////////////////////////////////////////// |
270 /** | 286 /** |
271 * Morphology effects. Depending upon the type of morphology, either the | 287 * Morphology effects. Depending upon the type of morphology, either the |
272 * component-wise min (Erode_Type) or max (Dilate_Type) of all pixels in the | 288 * component-wise min (Erode_Type) or max (Dilate_Type) of all pixels in the |
273 * kernel is selected as the new color. The new color is modulated by the input | 289 * kernel is selected as the new color. The new color is modulated by the input |
274 * color. | 290 * color. |
275 */ | 291 */ |
276 class GrMorphologyEffect : public Gr1DKernelEffect { | 292 class GrMorphologyEffect : public Gr1DKernelEffect { |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 SkBitmap* result, SkIPoint* offset) con
st { | 603 SkBitmap* result, SkIPoint* offset) con
st { |
588 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); | 604 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); |
589 } | 605 } |
590 | 606 |
591 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, | 607 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, |
592 SkBitmap* result, SkIPoint* offset) cons
t { | 608 SkBitmap* result, SkIPoint* offset) cons
t { |
593 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); | 609 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); |
594 } | 610 } |
595 | 611 |
596 #endif | 612 #endif |
OLD | NEW |