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

Side by Side 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 unified diff | Download patch
OLDNEW
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 2068 matching lines...) Expand 10 before | Expand all | Expand 10 after
2079 frame = aggregator_->Aggregate(surface2_id); 2079 frame = aggregator_->Aggregate(surface2_id);
2080 render_pass = frame.render_pass_list.back().get(); 2080 render_pass = frame.render_pass_list.back().get();
2081 2081
2082 // Output is insecure, so texture should be drawn. 2082 // Output is insecure, so texture should be drawn.
2083 EXPECT_EQ(DrawQuad::SOLID_COLOR, render_pass->quad_list.back()->material); 2083 EXPECT_EQ(DrawQuad::SOLID_COLOR, render_pass->quad_list.back()->material);
2084 2084
2085 factory1.EvictSurface(); 2085 factory1.EvictSurface();
2086 factory2.EvictSurface(); 2086 factory2.EvictSurface();
2087 } 2087 }
2088 2088
2089 // Ensure that the render passes have correct color spaces.
2090 TEST_F(SurfaceAggregatorValidSurfaceTest, ColorSpaceTest) {
2091 test::Quad quads[][2] = {{test::Quad::SolidColorQuad(SK_ColorWHITE),
2092 test::Quad::SolidColorQuad(SK_ColorLTGRAY)},
2093 {test::Quad::SolidColorQuad(SK_ColorGRAY),
2094 test::Quad::SolidColorQuad(SK_ColorDKGRAY)}};
2095 test::Pass passes[] = {test::Pass(quads[0], arraysize(quads[0]), 2),
2096 test::Pass(quads[1], arraysize(quads[1]), 1)};
2097 gfx::ColorSpace color_space1 = gfx::ColorSpace::CreateXYZD50();
2098 gfx::ColorSpace color_space2 = gfx::ColorSpace::CreateSRGB();
2099
2100 SubmitCompositorFrame(&factory_, passes, arraysize(passes),
2101 root_local_surface_id_);
2102
2103 SurfaceId surface_id(factory_.frame_sink_id(), root_local_surface_id_);
2104
2105 CompositorFrame aggregated_frame;
2106 aggregator_.SetOutputColorSpace(color_space1);
2107 aggregated_frame = aggregator_.Aggregate(surface_id);
2108 EXPECT_EQ(2u, aggregated_frame.render_pass_list.size());
2109 EXPECT_EQ(color_space1, aggregated_frame.render_pass_list[0]->color_space);
2110 EXPECT_EQ(color_space1, aggregated_frame.render_pass_list[1]->color_space);
2111
2112 aggregator_.SetOutputColorSpace(color_space2);
2113 aggregated_frame = aggregator_.Aggregate(surface_id);
2114 EXPECT_EQ(2u, aggregated_frame.render_pass_list.size());
2115 EXPECT_EQ(color_space2, aggregated_frame.render_pass_list[0]->color_space);
2116 EXPECT_EQ(color_space2, aggregated_frame.render_pass_list[1]->color_space);
2117 }
2118
2089 } // namespace 2119 } // namespace
2090 } // namespace cc 2120 } // namespace cc
2091 2121
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698