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

Unified Diff: cc/surfaces/surface_aggregator_unittest.cc

Issue 2693723002: cc: Move output color space from DrawingFrame to RenderPass (Closed)
Patch Set: Fix typo Created 3 years, 10 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 788e52eb6390d27084c1c468ff9cb4b5808d8587..e8364105b4ea15fbdb0ceb7687f3b2c6c09f392f 100644
--- a/cc/surfaces/surface_aggregator_unittest.cc
+++ b/cc/surfaces/surface_aggregator_unittest.cc
@@ -2086,6 +2086,36 @@ TEST_F(SurfaceAggregatorWithResourcesTest, SecureOutputTexture) {
factory2.EvictSurface();
}
+// Ensure that the render passes have correct color spaces.
+TEST_F(SurfaceAggregatorValidSurfaceTest, ColorSpaceTest) {
+ test::Quad quads[][2] = {{test::Quad::SolidColorQuad(SK_ColorWHITE),
+ test::Quad::SolidColorQuad(SK_ColorLTGRAY)},
+ {test::Quad::SolidColorQuad(SK_ColorGRAY),
+ test::Quad::SolidColorQuad(SK_ColorDKGRAY)}};
+ test::Pass passes[] = {test::Pass(quads[0], arraysize(quads[0]), 2),
+ test::Pass(quads[1], arraysize(quads[1]), 1)};
+ gfx::ColorSpace color_space1 = gfx::ColorSpace::CreateXYZD50();
+ gfx::ColorSpace color_space2 = gfx::ColorSpace::CreateSRGB();
+
+ SubmitCompositorFrame(&factory_, passes, arraysize(passes),
+ root_local_surface_id_);
+
+ SurfaceId surface_id(factory_.frame_sink_id(), root_local_surface_id_);
+
+ CompositorFrame aggregated_frame;
+ aggregator_.SetOutputColorSpace(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);
+ 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);
+}
+
} // namespace
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698