chromium/skia/ext/convolver_unittest.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "skia/ext/convolver.h"

#include <stdint.h>
#include <string.h>
#include <time.h>

#include <algorithm>
#include <numeric>
#include <vector>

#include "base/logging.h"
#include "base/rand_util.h"
#include "base/time/time.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkColorPriv.h"
#include "third_party/skia/include/core/SkRect.h"
#include "third_party/skia/include/core/SkTypes.h"

namespace skia {

namespace {

// Fills the given filter with impulse functions for the range 0->num_entries.
void FillImpulseFilter(int num_entries, ConvolutionFilter1D* filter) {}

// Filters the given input with the impulse function, and verifies that it
// does not change.
void TestImpulseConvolution(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, ConvolutionFilter1D* filter) {}

}  // namespace

// Tests that each pixel, when set and run through the impulse filter, does
// not change.
TEST(Convolver, Impulse) {}

// Tests that using a box filter to halve an image results in every square of 4
// pixels in the original get averaged to a pixel in the output.
TEST(Convolver, Halve) {}

// Tests the optimization in Convolver1D::AddFilter that avoids storing
// leading/trailing zeroes.
TEST(Convolver, AddFilter) {}

void VerifySIMD(unsigned int source_width,
                unsigned int source_height,
                unsigned int dest_width,
                unsigned int dest_height) {}

TEST(Convolver, VerifySIMDEdgeCases) {}

// Verify that lage upscales/downscales produce the same result
// with and without SIMD.
TEST(Convolver, VerifySIMDPrecision) {}

TEST(Convolver, SeparableSingleConvolution) {}

TEST(Convolver, SeparableSingleConvolutionEdges) {}

TEST(Convolver, SetUpGaussianConvolutionFilter) {}

}  // namespace skia