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 "SkMatrixConvolutionImageFilter.h" | 8 #include "SkMatrixConvolutionImageFilter.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 SkMatrixConvolutionImageFilter::SkMatrixConvolutionImageFilter( | 36 SkMatrixConvolutionImageFilter::SkMatrixConvolutionImageFilter( |
37 const SkISize& kernelSize, | 37 const SkISize& kernelSize, |
38 const SkScalar* kernel, | 38 const SkScalar* kernel, |
39 SkScalar gain, | 39 SkScalar gain, |
40 SkScalar bias, | 40 SkScalar bias, |
41 const SkIPoint& kernelOffset, | 41 const SkIPoint& kernelOffset, |
42 TileMode tileMode, | 42 TileMode tileMode, |
43 bool convolveAlpha, | 43 bool convolveAlpha, |
44 SkImageFilter* input, | 44 SkImageFilter* input, |
45 const CropRect* cropRect) | 45 const CropRect* cropRect) |
46 : INHERITED(input, cropRect), | 46 : INHERITED(1, &input, cropRect), |
47 fKernelSize(kernelSize), | 47 fKernelSize(kernelSize), |
48 fGain(gain), | 48 fGain(gain), |
49 fBias(bias), | 49 fBias(bias), |
50 fKernelOffset(kernelOffset), | 50 fKernelOffset(kernelOffset), |
51 fTileMode(tileMode), | 51 fTileMode(tileMode), |
52 fConvolveAlpha(convolveAlpha) { | 52 fConvolveAlpha(convolveAlpha) { |
53 uint32_t size = fKernelSize.fWidth * fKernelSize.fHeight; | 53 uint32_t size = fKernelSize.fWidth * fKernelSize.fHeight; |
54 fKernel = SkNEW_ARRAY(SkScalar, size); | 54 fKernel = SkNEW_ARRAY(SkScalar, size); |
55 memcpy(fKernel, kernel, size * sizeof(SkScalar)); | 55 memcpy(fKernel, kernel, size * sizeof(SkScalar)); |
56 SkASSERT(kernelSize.fWidth >= 1 && kernelSize.fHeight >= 1); | 56 SkASSERT(kernelSize.fWidth >= 1 && kernelSize.fHeight >= 1); |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 fBias, | 677 fBias, |
678 fKernelOffset, | 678 fKernelOffset, |
679 fTileMode, | 679 fTileMode, |
680 fConvolveAlpha); | 680 fConvolveAlpha); |
681 return true; | 681 return true; |
682 } | 682 } |
683 | 683 |
684 /////////////////////////////////////////////////////////////////////////////// | 684 /////////////////////////////////////////////////////////////////////////////// |
685 | 685 |
686 #endif | 686 #endif |
OLD | NEW |