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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 class GrMorphologyEffect : public Gr1DKernelEffect { | 272 class GrMorphologyEffect : public Gr1DKernelEffect { |
273 | 273 |
274 public: | 274 public: |
275 | 275 |
276 enum MorphologyType { | 276 enum MorphologyType { |
277 kErode_MorphologyType, | 277 kErode_MorphologyType, |
278 kDilate_MorphologyType, | 278 kDilate_MorphologyType, |
279 }; | 279 }; |
280 | 280 |
281 static GrEffectRef* Create(GrTexture* tex, Direction dir, int radius, Morpho
logyType type) { | 281 static GrEffectRef* Create(GrTexture* tex, Direction dir, int radius, Morpho
logyType type) { |
282 AutoEffectUnref effect(SkNEW_ARGS(GrMorphologyEffect, (tex, dir, radius,
type))); | 282 return SkNEW_ARGS(GrMorphologyEffect, (tex, dir, radius, type)); |
283 return CreateEffectRef(effect); | |
284 } | 283 } |
285 | 284 |
286 virtual ~GrMorphologyEffect(); | 285 virtual ~GrMorphologyEffect(); |
287 | 286 |
288 MorphologyType type() const { return fType; } | 287 MorphologyType type() const { return fType; } |
289 | 288 |
290 static const char* Name() { return "Morphology"; } | 289 static const char* Name() { return "Morphology"; } |
291 | 290 |
292 typedef GrGLMorphologyEffect GLEffect; | 291 typedef GrGLMorphologyEffect GLEffect; |
293 | 292 |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 SkBitmap* result, SkIPoint* offset) con
st { | 577 SkBitmap* result, SkIPoint* offset) con
st { |
579 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); | 578 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); |
580 } | 579 } |
581 | 580 |
582 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, | 581 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, |
583 SkBitmap* result, SkIPoint* offset) cons
t { | 582 SkBitmap* result, SkIPoint* offset) cons
t { |
584 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); | 583 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); |
585 } | 584 } |
586 | 585 |
587 #endif | 586 #endif |
OLD | NEW |