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" |
11 #include "SkReadBuffer.h" | 11 #include "SkReadBuffer.h" |
12 #include "SkWriteBuffer.h" | 12 #include "SkWriteBuffer.h" |
13 #include "SkRect.h" | 13 #include "SkRect.h" |
14 #include "SkMorphology_opts.h" | 14 #include "SkMorphology_opts.h" |
15 #if SK_SUPPORT_GPU | 15 #if SK_SUPPORT_GPU |
16 #include "GrContext.h" | 16 #include "GrContext.h" |
17 #include "GrInvariantOutput.h" | 17 #include "GrInvariantOutput.h" |
18 #include "GrTexture.h" | 18 #include "GrTexture.h" |
19 #include "GrTBackendProcessorFactory.h" | 19 #include "GrTBackendProcessorFactory.h" |
20 #include "gl/GrGLProcessor.h" | 20 #include "gl/GrGLProcessor.h" |
21 #include "gl/builders/GrGLProgramBuilder.h" | 21 #include "gl/builders/GrGLProgramBuilder.h" |
22 #include "effects/Gr1DKernelEffect.h" | 22 #include "effects/Gr1DKernelEffect.h" |
23 #endif | 23 #endif |
24 | 24 |
25 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING | |
26 SkMorphologyImageFilter::SkMorphologyImageFilter(SkReadBuffer& buffer) | |
27 : INHERITED(1, buffer) { | |
28 fRadius.fWidth = buffer.readInt(); | |
29 fRadius.fHeight = buffer.readInt(); | |
30 buffer.validate((fRadius.fWidth >= 0) && | |
31 (fRadius.fHeight >= 0)); | |
32 } | |
33 #endif | |
34 | |
35 SkMorphologyImageFilter::SkMorphologyImageFilter(int radiusX, | 25 SkMorphologyImageFilter::SkMorphologyImageFilter(int radiusX, |
36 int radiusY, | 26 int radiusY, |
37 SkImageFilter* input, | 27 SkImageFilter* input, |
38 const CropRect* cropRect, | 28 const CropRect* cropRect, |
39 uint32_t uniqueID) | 29 uint32_t uniqueID) |
40 : INHERITED(1, &input, cropRect, uniqueID), fRadius(SkISize::Make(radiusX, r
adiusY)) { | 30 : INHERITED(1, &input, cropRect, uniqueID), fRadius(SkISize::Make(radiusX, r
adiusY)) { |
41 } | 31 } |
42 | 32 |
43 void SkMorphologyImageFilter::flatten(SkWriteBuffer& buffer) const { | 33 void SkMorphologyImageFilter::flatten(SkWriteBuffer& buffer) const { |
44 this->INHERITED::flatten(buffer); | 34 this->INHERITED::flatten(buffer); |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 SkBitmap* result, SkIPoint* offset) con
st { | 590 SkBitmap* result, SkIPoint* offset) con
st { |
601 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); | 591 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); |
602 } | 592 } |
603 | 593 |
604 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, | 594 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, |
605 SkBitmap* result, SkIPoint* offset) cons
t { | 595 SkBitmap* result, SkIPoint* offset) cons
t { |
606 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); | 596 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); |
607 } | 597 } |
608 | 598 |
609 #endif | 599 #endif |
OLD | NEW |