Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Side by Side Diff: cc/output/renderer_pixeltest.cc

Issue 2799603006: cc: Fix VideoResourceUpdater color conversion (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "cc/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 3402 matching lines...) Expand 10 before | Expand all | Expand 10 after
3413 } 3413 }
3414 gfx::ColorSpace src_color_space_; 3414 gfx::ColorSpace src_color_space_;
3415 gfx::ColorSpace dst_color_space_; 3415 gfx::ColorSpace dst_color_space_;
3416 }; 3416 };
3417 3417
3418 TEST_P(ColorTransformPixelTest, Basic) { 3418 TEST_P(ColorTransformPixelTest, Basic) {
3419 gfx::Rect rect(this->device_viewport_size_); 3419 gfx::Rect rect(this->device_viewport_size_);
3420 std::vector<uint8_t> input_colors(4 * rect.width() * rect.height(), 0); 3420 std::vector<uint8_t> input_colors(4 * rect.width() * rect.height(), 0);
3421 std::vector<SkColor> expected_output_colors(rect.width() * rect.height()); 3421 std::vector<SkColor> expected_output_colors(rect.width() * rect.height());
3422 3422
3423 renderer_->DisableColorChecksForTesting();
3424
3423 // Set the input data to be: 3425 // Set the input data to be:
3424 // Row 0: Gradient of red from 0 to 255 3426 // Row 0: Gradient of red from 0 to 255
3425 // Row 1: Gradient of green from 0 to 255 3427 // Row 1: Gradient of green from 0 to 255
3426 // Row 2: Gradient of blue from 0 to 255 3428 // Row 2: Gradient of blue from 0 to 255
3427 // Row 3: Gradient of grey from 0 to 255 3429 // Row 3: Gradient of grey from 0 to 255
3428 for (int x = 0; x < rect.width(); ++x) { 3430 for (int x = 0; x < rect.width(); ++x) {
3429 int v = (x * 255) / (rect.width() - 1); 3431 int v = (x * 255) / (rect.width() - 1);
3430 for (int y = 0; y < rect.height(); ++y) { 3432 for (int y = 0; y < rect.height(); ++y) {
3431 for (int c = 0; c < 3; ++c) { 3433 for (int c = 0; c < 3; ++c) {
3432 if (y == c || y == rect.height() - 1) { 3434 if (y == c || y == rect.height() - 1) {
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
3572 INSTANTIATE_TEST_CASE_P( 3574 INSTANTIATE_TEST_CASE_P(
3573 ToColorSpace, 3575 ToColorSpace,
3574 ColorTransformPixelTest, 3576 ColorTransformPixelTest,
3575 testing::Combine(testing::ValuesIn(intermediate_color_spaces), 3577 testing::Combine(testing::ValuesIn(intermediate_color_spaces),
3576 testing::ValuesIn(dst_color_spaces))); 3578 testing::ValuesIn(dst_color_spaces)));
3577 3579
3578 #endif // !defined(OS_ANDROID) 3580 #endif // !defined(OS_ANDROID)
3579 3581
3580 } // namespace 3582 } // namespace
3581 } // namespace cc 3583 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698