summaryrefslogtreecommitdiffstats
path: root/skia/ext/convolver_unittest.cc
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-24 01:14:52 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-24 01:14:52 +0000
commitcab34d6a13d3044c59cd5dccdf4b04725a395aac (patch)
treed9c05fd2e59a12cedf72f97d8cb4c420ff4793bb /skia/ext/convolver_unittest.cc
parent37cc1a1eaaa0c425a1ba889cf619f464227f9906 (diff)
downloadchromium_src-cab34d6a13d3044c59cd5dccdf4b04725a395aac.zip
chromium_src-cab34d6a13d3044c59cd5dccdf4b04725a395aac.tar.gz
chromium_src-cab34d6a13d3044c59cd5dccdf4b04725a395aac.tar.bz2
Move functions from skia/ext to app/gfx where possible: most of skia_utils.* and image_operations.* can be moved because they are not used by WebKit code.
This also fixes the spelling of "Convolusion" to "Convolution" and updates some copyrights. This is a re-do of r26975, this time with WebKit update and some fixes to compile on Mac and Linux. BUG=none TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27031 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/convolver_unittest.cc')
-rw-r--r--skia/ext/convolver_unittest.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/skia/ext/convolver_unittest.cc b/skia/ext/convolver_unittest.cc
index 10db76c..a25de6e 100644
--- a/skia/ext/convolver_unittest.cc
+++ b/skia/ext/convolver_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -14,7 +14,7 @@ namespace skia {
namespace {
// Fills the given filter with impulse functions for the range 0->num_entries.
-void FillImpulseFilter(int num_entries, ConvolusionFilter1D* filter) {
+void FillImpulseFilter(int num_entries, ConvolutionFilter1D* filter) {
float one = 1.0f;
for (int i = 0; i < num_entries; i++)
filter->AddFilter(i, &one, 1);
@@ -22,13 +22,13 @@ void FillImpulseFilter(int num_entries, ConvolusionFilter1D* filter) {
// Filters the given input with the impulse function, and verifies that it
// does not change.
-void TestImpulseConvolusion(const unsigned char* data, int width, int height) {
+void TestImpulseConvolution(const unsigned char* data, int width, int height) {
int byte_count = width * height * 4;
- ConvolusionFilter1D filter_x;
+ ConvolutionFilter1D filter_x;
FillImpulseFilter(width, &filter_x);
- ConvolusionFilter1D filter_y;
+ ConvolutionFilter1D filter_y;
FillImpulseFilter(height, &filter_y);
std::vector<unsigned char> output;
@@ -41,7 +41,7 @@ void TestImpulseConvolusion(const unsigned char* data, int width, int height) {
// Fills the destination filter with a box filter averaging every two pixels
// to produce the output.
-void FillBoxFilter(int size, ConvolusionFilter1D* filter) {
+void FillBoxFilter(int size, ConvolutionFilter1D* filter) {
const float box[2] = { 0.5, 0.5 };
for (int i = 0; i < size; i++)
filter->AddFilter(i * 2, box, 2);
@@ -68,7 +68,7 @@ TEST(Convolver, Impulse) {
input_ptr[(y * width + x) * 4 + channel] = 0xff;
// Always set the alpha channel or it will attempt to "fix" it for us.
input_ptr[(y * width + x) * 4 + 3] = 0xff;
- TestImpulseConvolusion(input_ptr, width, height);
+ TestImpulseConvolution(input_ptr, width, height);
}
}
}
@@ -98,11 +98,11 @@ TEST(Convolver, Halve) {
input[i] = rand() * 255 / RAND_MAX;
// Compute the filters.
- ConvolusionFilter1D filter_x, filter_y;
+ ConvolutionFilter1D filter_x, filter_y;
FillBoxFilter(dest_width, &filter_x);
FillBoxFilter(dest_height, &filter_y);
- // Do the convolusion.
+ // Do the convolution.
BGRAConvolve2D(&input[0], src_width, true, filter_x, filter_y, &output[0]);
// Compute the expected results and check, allowing for a small difference