OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "skia/ext/convolver.h" | 7 #include "skia/ext/convolver.h" |
8 #include "third_party/skia/include/core/SkTypes.h" | 8 #include "third_party/skia/include/core/SkTypes.h" |
9 | 9 |
10 namespace skia { | 10 namespace skia { |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 // No alpha channel, the image is opaque. | 216 // No alpha channel, the image is opaque. |
217 out_row[byte_offset + 3] = 0xff; | 217 out_row[byte_offset + 3] = 0xff; |
218 } | 218 } |
219 } | 219 } |
220 } | 220 } |
221 | 221 |
222 } // namespace | 222 } // namespace |
223 | 223 |
224 // ConvolutionFilter1D --------------------------------------------------------- | 224 // ConvolutionFilter1D --------------------------------------------------------- |
225 | 225 |
| 226 ConvolutionFilter1D::ConvolutionFilter1D() |
| 227 : max_filter_(0) { |
| 228 } |
| 229 |
| 230 ConvolutionFilter1D::~ConvolutionFilter1D() { |
| 231 } |
| 232 |
226 void ConvolutionFilter1D::AddFilter(int filter_offset, | 233 void ConvolutionFilter1D::AddFilter(int filter_offset, |
227 const float* filter_values, | 234 const float* filter_values, |
228 int filter_length) { | 235 int filter_length) { |
229 FilterInstance instance; | 236 FilterInstance instance; |
230 instance.data_location = static_cast<int>(filter_values_.size()); | 237 instance.data_location = static_cast<int>(filter_values_.size()); |
231 instance.offset = filter_offset; | 238 instance.offset = filter_offset; |
232 instance.length = filter_length; | 239 instance.length = filter_length; |
233 filters_.push_back(instance); | 240 filters_.push_back(instance); |
234 | 241 |
235 SkASSERT(filter_length > 0); | 242 SkASSERT(filter_length > 0); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 } else { | 332 } else { |
326 ConvolveVertically<false>(filter_values, filter_length, | 333 ConvolveVertically<false>(filter_values, filter_length, |
327 first_row_for_filter, | 334 first_row_for_filter, |
328 filter_x.num_values(), cur_output_row); | 335 filter_x.num_values(), cur_output_row); |
329 } | 336 } |
330 } | 337 } |
331 } | 338 } |
332 | 339 |
333 } // namespace skia | 340 } // namespace skia |
334 | 341 |
OLD | NEW |