chromium/ui/gfx/color_transform_unittest.cc

// Copyright 2016 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/354829279): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include <tuple>
#include <vector>

#include "base/logging.h"
#include "base/test/scoped_feature_list.h"
#include "skia/ext/skcolorspace_trfn.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/effects/SkRuntimeEffect.h"
#include "ui/gfx/color_space.h"
#include "ui/gfx/color_transform.h"
#include "ui/gfx/geometry/transform.h"
#include "ui/gfx/gfx_export.h"
#include "ui/gfx/icc_profile.h"
#include "ui/gfx/skia_color_space_util.h"
#include "ui/gfx/test/icc_profiles.h"

namespace gfx {

// Allowed math error.
constexpr float kMathEpsilon =;
constexpr float kMathLargeEpsilon =;

// Internal functions, exposted for testing.
GFX_EXPORT Transform GetTransferMatrix(ColorSpace::MatrixID id);

ColorSpace::PrimaryID all_primaries[] =;

ColorSpace::TransferID simple_transfers[] =;

ColorSpace::TransferID extended_transfers[] =;

ColorSpace::MatrixID all_matrices[] =;

ColorSpace::RangeID all_ranges[] =;

bool optimizations[] =;

TEST(SimpleColorSpace, BT709toSRGB) {}

TEST(SimpleColorSpace, YCOCGLimitedToSRGB) {}

TEST(SimpleColorSpace, TransferFnCancel) {}

TEST(SimpleColorSpace, SRGBFromICCAndNotICC) {}

TEST(SimpleColorSpace, BT709toSRGBICC) {}

TEST(SimpleColorSpace, ICCProfileOnlyXYZ) {}

TEST(SimpleColorSpace, ICCProfileOnlyColorSpin) {}

TEST(SimpleColorSpace, GetColorSpace) {}

TEST(SimpleColorSpace, Scale) {}

TEST(SimpleColorSpace, ToUndefined) {}

TEST(SimpleColorSpace, DefaultToSRGB) {}

// Checks that the generated SkSL fragment shaders can be parsed by
// SkSL::Compiler.
TEST(SimpleColorSpace, CanParseSkShaderSource) {}

class TransferTest : public testing::TestWithParam<ColorSpace::TransferID> {};

TEST_P(TransferTest, BasicTest) {}

INSTANTIATE_TEST_SUITE_P();

class ExtendedTransferTest
    : public testing::TestWithParam<ColorSpace::TransferID> {};

TEST_P(ExtendedTransferTest, extendedTest) {}

INSTANTIATE_TEST_SUITE_P();

ColorSpaceTestData;

class ColorSpaceTestBase : public testing::TestWithParam<ColorSpaceTestData> {};

TEST_P(ColorSpaceTestBase, testNullTransform) {}

TEST_P(ColorSpaceTestBase, toXYZandBack) {}

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

TEST(ColorSpaceTest, ExtendedSRGBScale) {}

TEST(ColorSpaceTest, ScrgbLinear80Nits) {}

TEST(ColorSpaceTest, HLGTonemap) {}

TEST(ColorSpaceTest, HLGNoTonemap) {}

TEST(ColorSpaceTest, HLGTonemapSdrRelative) {}

TEST(ColorSpaceTest, HLGNoTonemapSdrRelative) {}

TEST(ColorSpaceTest, PQTonemapSdrRelative) {}

TEST(ColorSpaceTest, PQSDRWhiteLevel) {}

TEST(ColorSpaceTest, HLGSDRWhiteLevel) {}

TEST(ColorSpaceTest, PiecewiseHDR) {}

}  // namespace gfx