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

Unified Diff: cc/surfaces/surface_aggregator_unittest.cc

Issue 2728173004: HDR: Do nonlinear blending in the compositor (Closed)
Patch Set: Roll in sRGB-extended Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: cc/surfaces/surface_aggregator_unittest.cc
diff --git a/cc/surfaces/surface_aggregator_unittest.cc b/cc/surfaces/surface_aggregator_unittest.cc
index 5173b9d61b6ec0e2ff3209cf75741752adce2b78..46229bbd92d336183728435ee03971bb5bd7a938 100644
--- a/cc/surfaces/surface_aggregator_unittest.cc
+++ b/cc/surfaces/surface_aggregator_unittest.cc
@@ -2181,6 +2181,7 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, ColorSpaceTest) {
test::Pass(quads[1], arraysize(quads[1]), 1)};
gfx::ColorSpace color_space1 = gfx::ColorSpace::CreateXYZD50();
gfx::ColorSpace color_space2 = gfx::ColorSpace::CreateSRGB();
+ gfx::ColorSpace color_space3 = gfx::ColorSpace::CreateSCRGBLinear();
SubmitCompositorFrame(&factory_, passes, arraysize(passes),
root_local_surface_id_);
@@ -2188,17 +2189,24 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, ColorSpaceTest) {
SurfaceId surface_id(factory_.frame_sink_id(), root_local_surface_id_);
CompositorFrame aggregated_frame;
- aggregator_.SetOutputColorSpace(color_space1);
+ aggregator_.SetOutputColorSpace(color_space1, color_space1);
aggregated_frame = aggregator_.Aggregate(surface_id);
EXPECT_EQ(2u, aggregated_frame.render_pass_list.size());
EXPECT_EQ(color_space1, aggregated_frame.render_pass_list[0]->color_space);
EXPECT_EQ(color_space1, aggregated_frame.render_pass_list[1]->color_space);
- aggregator_.SetOutputColorSpace(color_space2);
+ aggregator_.SetOutputColorSpace(color_space2, color_space2);
aggregated_frame = aggregator_.Aggregate(surface_id);
EXPECT_EQ(2u, aggregated_frame.render_pass_list.size());
EXPECT_EQ(color_space2, aggregated_frame.render_pass_list[0]->color_space);
EXPECT_EQ(color_space2, aggregated_frame.render_pass_list[1]->color_space);
+
+ aggregator_.SetOutputColorSpace(color_space1, color_space3);
+ aggregated_frame = aggregator_.Aggregate(surface_id);
+ EXPECT_EQ(3u, aggregated_frame.render_pass_list.size());
+ EXPECT_EQ(color_space1, aggregated_frame.render_pass_list[0]->color_space);
+ EXPECT_EQ(color_space1, aggregated_frame.render_pass_list[1]->color_space);
+ EXPECT_EQ(color_space3, aggregated_frame.render_pass_list[2]->color_space);
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698