| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "cc/surfaces/surface_aggregator.h" | 5 #include "cc/surfaces/surface_aggregator.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 2163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2174 // Ensure that the render passes have correct color spaces. | 2174 // Ensure that the render passes have correct color spaces. |
| 2175 TEST_F(SurfaceAggregatorValidSurfaceTest, ColorSpaceTest) { | 2175 TEST_F(SurfaceAggregatorValidSurfaceTest, ColorSpaceTest) { |
| 2176 test::Quad quads[][2] = {{test::Quad::SolidColorQuad(SK_ColorWHITE), | 2176 test::Quad quads[][2] = {{test::Quad::SolidColorQuad(SK_ColorWHITE), |
| 2177 test::Quad::SolidColorQuad(SK_ColorLTGRAY)}, | 2177 test::Quad::SolidColorQuad(SK_ColorLTGRAY)}, |
| 2178 {test::Quad::SolidColorQuad(SK_ColorGRAY), | 2178 {test::Quad::SolidColorQuad(SK_ColorGRAY), |
| 2179 test::Quad::SolidColorQuad(SK_ColorDKGRAY)}}; | 2179 test::Quad::SolidColorQuad(SK_ColorDKGRAY)}}; |
| 2180 test::Pass passes[] = {test::Pass(quads[0], arraysize(quads[0]), 2), | 2180 test::Pass passes[] = {test::Pass(quads[0], arraysize(quads[0]), 2), |
| 2181 test::Pass(quads[1], arraysize(quads[1]), 1)}; | 2181 test::Pass(quads[1], arraysize(quads[1]), 1)}; |
| 2182 gfx::ColorSpace color_space1 = gfx::ColorSpace::CreateXYZD50(); | 2182 gfx::ColorSpace color_space1 = gfx::ColorSpace::CreateXYZD50(); |
| 2183 gfx::ColorSpace color_space2 = gfx::ColorSpace::CreateSRGB(); | 2183 gfx::ColorSpace color_space2 = gfx::ColorSpace::CreateSRGB(); |
| 2184 gfx::ColorSpace color_space3 = gfx::ColorSpace::CreateSCRGBLinear(); |
| 2184 | 2185 |
| 2185 SubmitCompositorFrame(&factory_, passes, arraysize(passes), | 2186 SubmitCompositorFrame(&factory_, passes, arraysize(passes), |
| 2186 root_local_surface_id_); | 2187 root_local_surface_id_); |
| 2187 | 2188 |
| 2188 SurfaceId surface_id(factory_.frame_sink_id(), root_local_surface_id_); | 2189 SurfaceId surface_id(factory_.frame_sink_id(), root_local_surface_id_); |
| 2189 | 2190 |
| 2190 CompositorFrame aggregated_frame; | 2191 CompositorFrame aggregated_frame; |
| 2191 aggregator_.SetOutputColorSpace(color_space1); | 2192 aggregator_.SetOutputColorSpace(color_space1, color_space1); |
| 2192 aggregated_frame = aggregator_.Aggregate(surface_id); | 2193 aggregated_frame = aggregator_.Aggregate(surface_id); |
| 2193 EXPECT_EQ(2u, aggregated_frame.render_pass_list.size()); | 2194 EXPECT_EQ(2u, aggregated_frame.render_pass_list.size()); |
| 2194 EXPECT_EQ(color_space1, aggregated_frame.render_pass_list[0]->color_space); | 2195 EXPECT_EQ(color_space1, aggregated_frame.render_pass_list[0]->color_space); |
| 2195 EXPECT_EQ(color_space1, aggregated_frame.render_pass_list[1]->color_space); | 2196 EXPECT_EQ(color_space1, aggregated_frame.render_pass_list[1]->color_space); |
| 2196 | 2197 |
| 2197 aggregator_.SetOutputColorSpace(color_space2); | 2198 aggregator_.SetOutputColorSpace(color_space2, color_space2); |
| 2198 aggregated_frame = aggregator_.Aggregate(surface_id); | 2199 aggregated_frame = aggregator_.Aggregate(surface_id); |
| 2199 EXPECT_EQ(2u, aggregated_frame.render_pass_list.size()); | 2200 EXPECT_EQ(2u, aggregated_frame.render_pass_list.size()); |
| 2200 EXPECT_EQ(color_space2, aggregated_frame.render_pass_list[0]->color_space); | 2201 EXPECT_EQ(color_space2, aggregated_frame.render_pass_list[0]->color_space); |
| 2201 EXPECT_EQ(color_space2, aggregated_frame.render_pass_list[1]->color_space); | 2202 EXPECT_EQ(color_space2, aggregated_frame.render_pass_list[1]->color_space); |
| 2203 |
| 2204 aggregator_.SetOutputColorSpace(color_space1, color_space3); |
| 2205 aggregated_frame = aggregator_.Aggregate(surface_id); |
| 2206 EXPECT_EQ(3u, aggregated_frame.render_pass_list.size()); |
| 2207 EXPECT_EQ(color_space1, aggregated_frame.render_pass_list[0]->color_space); |
| 2208 EXPECT_EQ(color_space1, aggregated_frame.render_pass_list[1]->color_space); |
| 2209 EXPECT_EQ(color_space3, aggregated_frame.render_pass_list[2]->color_space); |
| 2202 } | 2210 } |
| 2203 | 2211 |
| 2204 } // namespace | 2212 } // namespace |
| 2205 } // namespace cc | 2213 } // namespace cc |
| 2206 | 2214 |
| OLD | NEW |