Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/core/SkConvolver.h

Issue 2481733003: Make SSE2/Neon convolution functions not to read extra bytes (Closed)
Patch Set: Change macros to functions Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkBitmapScaler.cpp ('k') | src/core/SkConvolver.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SK_CONVOLVER_H 5 #ifndef SK_CONVOLVER_H
6 #define SK_CONVOLVER_H 6 #define SK_CONVOLVER_H
7 7
8 #include "SkSize.h" 8 #include "SkSize.h"
9 #include "SkTDArray.h" 9 #include "SkTDArray.h"
10 10
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 typedef void (*SkConvolve4RowsHorizontally_pointer)( 150 typedef void (*SkConvolve4RowsHorizontally_pointer)(
151 const unsigned char* srcData[4], 151 const unsigned char* srcData[4],
152 const SkConvolutionFilter1D& filter, 152 const SkConvolutionFilter1D& filter,
153 unsigned char* outRow[4], 153 unsigned char* outRow[4],
154 size_t outRowBytes); 154 size_t outRowBytes);
155 typedef void (*SkConvolveHorizontally_pointer)( 155 typedef void (*SkConvolveHorizontally_pointer)(
156 const unsigned char* srcData, 156 const unsigned char* srcData,
157 const SkConvolutionFilter1D& filter, 157 const SkConvolutionFilter1D& filter,
158 unsigned char* outRow, 158 unsigned char* outRow,
159 bool hasAlpha); 159 bool hasAlpha);
160 typedef void (*SkConvolveFilterPadding_pointer)(
161 SkConvolutionFilter1D* filter);
162 160
163 struct SkConvolutionProcs { 161 struct SkConvolutionProcs {
164 // This is how many extra pixels may be read by the
165 // conolve*horizontally functions.
166 int fExtraHorizontalReads;
167 SkConvolveVertically_pointer fConvolveVertically; 162 SkConvolveVertically_pointer fConvolveVertically;
168 SkConvolve4RowsHorizontally_pointer fConvolve4RowsHorizontally; 163 SkConvolve4RowsHorizontally_pointer fConvolve4RowsHorizontally;
169 SkConvolveHorizontally_pointer fConvolveHorizontally; 164 SkConvolveHorizontally_pointer fConvolveHorizontally;
170 SkConvolveFilterPadding_pointer fApplySIMDPadding;
171 }; 165 };
172 166
173 167
174 168
175 // Does a two-dimensional convolution on the given source image. 169 // Does a two-dimensional convolution on the given source image.
176 // 170 //
177 // It is assumed the source pixel offsets referenced in the input filters 171 // It is assumed the source pixel offsets referenced in the input filters
178 // reference only valid pixels, so the source image size is not required. Each 172 // reference only valid pixels, so the source image size is not required. Each
179 // row of the source image starts |sourceByteRowStride| after the previous 173 // row of the source image starts |sourceByteRowStride| after the previous
180 // one (this allows you to have rows with some padding at the end). 174 // one (this allows you to have rows with some padding at the end).
(...skipping 17 matching lines...) Expand all
198 int sourceByteRowStride, 192 int sourceByteRowStride,
199 bool sourceHasAlpha, 193 bool sourceHasAlpha,
200 const SkConvolutionFilter1D& xfilter, 194 const SkConvolutionFilter1D& xfilter,
201 const SkConvolutionFilter1D& yfilter, 195 const SkConvolutionFilter1D& yfilter,
202 int outputByteRowStride, 196 int outputByteRowStride,
203 unsigned char* output, 197 unsigned char* output,
204 const SkConvolutionProcs&, 198 const SkConvolutionProcs&,
205 bool useSimdIfPossible); 199 bool useSimdIfPossible);
206 200
207 #endif // SK_CONVOLVER_H 201 #endif // SK_CONVOLVER_H
OLDNEW
« no previous file with comments | « src/core/SkBitmapScaler.cpp ('k') | src/core/SkConvolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698