| 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 |
| 25 SkMorphologyImageFilter::SkMorphologyImageFilter(int radiusX, | 35 SkMorphologyImageFilter::SkMorphologyImageFilter(int radiusX, |
| 26 int radiusY, | 36 int radiusY, |
| 27 SkImageFilter* input, | 37 SkImageFilter* input, |
| 28 const CropRect* cropRect, | 38 const CropRect* cropRect, |
| 29 uint32_t uniqueID) | 39 uint32_t uniqueID) |
| 30 : INHERITED(1, &input, cropRect, uniqueID), fRadius(SkISize::Make(radiusX, r
adiusY)) { | 40 : INHERITED(1, &input, cropRect, uniqueID), fRadius(SkISize::Make(radiusX, r
adiusY)) { |
| 31 } | 41 } |
| 32 | 42 |
| 33 void SkMorphologyImageFilter::flatten(SkWriteBuffer& buffer) const { | 43 void SkMorphologyImageFilter::flatten(SkWriteBuffer& buffer) const { |
| 34 this->INHERITED::flatten(buffer); | 44 this->INHERITED::flatten(buffer); |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 SkBitmap* result, SkIPoint* offset) con
st { | 600 SkBitmap* result, SkIPoint* offset) con
st { |
| 591 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); | 601 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); |
| 592 } | 602 } |
| 593 | 603 |
| 594 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, | 604 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, |
| 595 SkBitmap* result, SkIPoint* offset) cons
t { | 605 SkBitmap* result, SkIPoint* offset) cons
t { |
| 596 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); | 606 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); |
| 597 } | 607 } |
| 598 | 608 |
| 599 #endif | 609 #endif |
| OLD | NEW |