| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 "base/logging.h" | 5 #include "base/logging.h" |
| 6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
| 7 #include "ui/gfx/color_space.h" | 7 #include "ui/gfx/color_space.h" |
| 8 #include "ui/gfx/color_transform.h" | 8 #include "ui/gfx/color_transform.h" |
| 9 #include "ui/gfx/icc_profile.h" | 9 #include "ui/gfx/icc_profile.h" |
| 10 #include "ui/gfx/transform.h" | 10 #include "ui/gfx/transform.h" |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x2d, 0x74, 0x65, 0x78, 0x74, | 329 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x2d, 0x74, 0x65, 0x78, 0x74, |
| 330 0x00, 0x00, 0x00, 0x00, 0x43, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, | 330 0x00, 0x00, 0x00, 0x00, 0x43, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, |
| 331 0x74, 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x6f, | 331 0x74, 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x6f, |
| 332 0x6e, 0x61, 0x6c, 0x20, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x43, 0x6f, | 332 0x6e, 0x61, 0x6c, 0x20, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x43, 0x6f, |
| 333 0x6e, 0x73, 0x6f, 0x72, 0x74, 0x69, 0x75, 0x6d, 0x2c, 0x20, 0x32, 0x30, | 333 0x6e, 0x73, 0x6f, 0x72, 0x74, 0x69, 0x75, 0x6d, 0x2c, 0x20, 0x32, 0x30, |
| 334 0x30, 0x39, 0x00, 0x00, 0x73, 0x66, 0x33, 0x32, 0x00, 0x00, 0x00, 0x00, | 334 0x30, 0x39, 0x00, 0x00, 0x73, 0x66, 0x33, 0x32, 0x00, 0x00, 0x00, 0x00, |
| 335 0x00, 0x01, 0x0c, 0x44, 0x00, 0x00, 0x05, 0xdf, 0xff, 0xff, 0xf3, 0x26, | 335 0x00, 0x01, 0x0c, 0x44, 0x00, 0x00, 0x05, 0xdf, 0xff, 0xff, 0xf3, 0x26, |
| 336 0x00, 0x00, 0x07, 0x94, 0x00, 0x00, 0xfd, 0x8f, 0xff, 0xff, 0xfb, 0xa1, | 336 0x00, 0x00, 0x07, 0x94, 0x00, 0x00, 0xfd, 0x8f, 0xff, 0xff, 0xfb, 0xa1, |
| 337 0xff, 0xff, 0xfd, 0xa2, 0x00, 0x00, 0x03, 0xdb, 0x00, 0x00, 0xc0, 0x75}; | 337 0xff, 0xff, 0xfd, 0xa2, 0x00, 0x00, 0x03, 0xdb, 0x00, 0x00, 0xc0, 0x75}; |
| 338 | 338 |
| 339 TEST(SimpleColorSpace, BT709toSRGBICC) { | 339 // MSan detects an uninitialized read in QCMS. https://crbug.com/635042 |
| 340 #if defined(MEMORY_SANITIZER) |
| 341 #define MAYBE_BT709toSRGBICC DISABLED_BT709toSRGBICC |
| 342 #else |
| 343 #define MAYBE_BT709toSRGBICC BT709toSRGBICC |
| 344 #endif |
| 345 TEST(SimpleColorSpace, MAYBE_BT709toSRGBICC) { |
| 340 ICCProfile srgb_icc = ICCProfile::FromData( | 346 ICCProfile srgb_icc = ICCProfile::FromData( |
| 341 reinterpret_cast<char*>(srgb_icc_data), arraysize(srgb_icc_data)); | 347 reinterpret_cast<char*>(srgb_icc_data), arraysize(srgb_icc_data)); |
| 342 | 348 |
| 343 ColorSpace bt709 = ColorSpace::CreateREC709(); | 349 ColorSpace bt709 = ColorSpace::CreateREC709(); |
| 344 ColorSpace sRGB = srgb_icc.GetColorSpace(); | 350 ColorSpace sRGB = srgb_icc.GetColorSpace(); |
| 345 std::unique_ptr<ColorTransform> t(ColorTransform::NewColorTransform( | 351 std::unique_ptr<ColorTransform> t(ColorTransform::NewColorTransform( |
| 346 bt709, sRGB, ColorTransform::Intent::ABSOLUTE)); | 352 bt709, sRGB, ColorTransform::Intent::ABSOLUTE)); |
| 347 | 353 |
| 348 ColorTransform::TriStim tmp(16.0f / 255.0f, 0.5f, 0.5f); | 354 ColorTransform::TriStim tmp(16.0f / 255.0f, 0.5f, 0.5f); |
| 349 t->transform(&tmp, 1); | 355 t->transform(&tmp, 1); |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 testing::ValuesIn(all_ranges))); | 493 testing::ValuesIn(all_ranges))); |
| 488 | 494 |
| 489 INSTANTIATE_TEST_CASE_P( | 495 INSTANTIATE_TEST_CASE_P( |
| 490 C, | 496 C, |
| 491 ColorSpaceTest, | 497 ColorSpaceTest, |
| 492 testing::Combine(testing::ValuesIn(all_primaries), | 498 testing::Combine(testing::ValuesIn(all_primaries), |
| 493 testing::Values(ColorSpace::TransferID::BT709), | 499 testing::Values(ColorSpace::TransferID::BT709), |
| 494 testing::ValuesIn(all_matrices), | 500 testing::ValuesIn(all_matrices), |
| 495 testing::ValuesIn(all_ranges))); | 501 testing::ValuesIn(all_ranges))); |
| 496 } // namespace | 502 } // namespace |
| OLD | NEW |