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

Side by Side Diff: services/ui/ws/window_tree_client_unittest.cc

Issue 2547243002: Set device scale factor in CompositorFrame and scale frame size in WS. (Closed)
Patch Set: test Created 4 years 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
« no previous file with comments | « services/ui/ws/platform_display_default.cc ('k') | ui/display/screen_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 2148 matching lines...) Expand 10 before | Expand all | Expand 10 after
2159 cc::mojom::MojoCompositorFrameSinkClientPtr surface_client_ptr; 2159 cc::mojom::MojoCompositorFrameSinkClientPtr surface_client_ptr;
2160 client_request = mojo::GetProxy(&surface_client_ptr); 2160 client_request = mojo::GetProxy(&surface_client_ptr);
2161 wt2()->AttachCompositorFrameSink( 2161 wt2()->AttachCompositorFrameSink(
2162 window_2_101, mojom::CompositorFrameSinkType::DEFAULT, 2162 window_2_101, mojom::CompositorFrameSinkType::DEFAULT,
2163 mojo::GetProxy(&surface_ptr), std::move(surface_client_ptr)); 2163 mojo::GetProxy(&surface_ptr), std::move(surface_client_ptr));
2164 cc::CompositorFrame compositor_frame; 2164 cc::CompositorFrame compositor_frame;
2165 std::unique_ptr<cc::RenderPass> render_pass = cc::RenderPass::Create(); 2165 std::unique_ptr<cc::RenderPass> render_pass = cc::RenderPass::Create();
2166 gfx::Rect frame_rect(0, 0, 100, 100); 2166 gfx::Rect frame_rect(0, 0, 100, 100);
2167 render_pass->SetNew(1, frame_rect, frame_rect, gfx::Transform()); 2167 render_pass->SetNew(1, frame_rect, frame_rect, gfx::Transform());
2168 compositor_frame.render_pass_list.push_back(std::move(render_pass)); 2168 compositor_frame.render_pass_list.push_back(std::move(render_pass));
2169 compositor_frame.metadata.device_scale_factor = 1.f;
2169 cc::LocalFrameId local_frame_id(1, base::UnguessableToken::Create()); 2170 cc::LocalFrameId local_frame_id(1, base::UnguessableToken::Create());
2170 surface_ptr->SubmitCompositorFrame(local_frame_id, 2171 surface_ptr->SubmitCompositorFrame(local_frame_id,
2171 std::move(compositor_frame)); 2172 std::move(compositor_frame));
2172 // Make sure the parent connection gets the surface ID. 2173 // Make sure the parent connection gets the surface ID.
2173 wt_client1()->WaitForChangeCount(1); 2174 wt_client1()->WaitForChangeCount(1);
2174 // Verify that the submitted frame is for |window_2_101|. 2175 // Verify that the submitted frame is for |window_2_101|.
2175 EXPECT_EQ(window_2_101_in_ws1, 2176 EXPECT_EQ(window_2_101_in_ws1,
2176 changes1()->back().surface_id.frame_sink_id().client_id()); 2177 changes1()->back().surface_id.frame_sink_id().client_id());
2177 } 2178 }
2178 2179
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2215 2216
2216 // TODO(sky): make sure coverage of what was 2217 // TODO(sky): make sure coverage of what was
2217 // WindowManagerTest.SecondEmbedRoot_InitService and 2218 // WindowManagerTest.SecondEmbedRoot_InitService and
2218 // WindowManagerTest.MultipleEmbedRootsBeforeWTHReady gets added to window 2219 // WindowManagerTest.MultipleEmbedRootsBeforeWTHReady gets added to window
2219 // manager 2220 // manager
2220 // tests. 2221 // tests.
2221 2222
2222 } // namespace test 2223 } // namespace test
2223 } // namespace ws 2224 } // namespace ws
2224 } // namespace ui 2225 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/platform_display_default.cc ('k') | ui/display/screen_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698