OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/browser/android/synchronous_compositor_host.h" | 5 #include "content/browser/android/synchronous_compositor_host.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 IPC_BEGIN_MESSAGE_MAP(SynchronousCompositorHost, message) | 87 IPC_BEGIN_MESSAGE_MAP(SynchronousCompositorHost, message) |
88 IPC_MESSAGE_HANDLER(SyncCompositorHostMsg_OutputSurfaceCreated, | 88 IPC_MESSAGE_HANDLER(SyncCompositorHostMsg_OutputSurfaceCreated, |
89 OutputSurfaceCreated) | 89 OutputSurfaceCreated) |
90 IPC_MESSAGE_HANDLER(SyncCompositorHostMsg_UpdateState, ProcessCommonParams) | 90 IPC_MESSAGE_HANDLER(SyncCompositorHostMsg_UpdateState, ProcessCommonParams) |
91 IPC_MESSAGE_UNHANDLED(handled = false) | 91 IPC_MESSAGE_UNHANDLED(handled = false) |
92 IPC_END_MESSAGE_MAP() | 92 IPC_END_MESSAGE_MAP() |
93 return handled; | 93 return handled; |
94 } | 94 } |
95 | 95 |
96 SynchronousCompositor::Frame SynchronousCompositorHost::DemandDrawHw( | 96 SynchronousCompositor::Frame SynchronousCompositorHost::DemandDrawHw( |
97 const gfx::Size& surface_size, | |
98 const gfx::Transform& transform, | |
99 const gfx::Rect& viewport, | 97 const gfx::Rect& viewport, |
100 const gfx::Rect& clip, | |
101 const gfx::Rect& viewport_rect_for_tile_priority, | 98 const gfx::Rect& viewport_rect_for_tile_priority, |
102 const gfx::Transform& transform_for_tile_priority) { | 99 const gfx::Transform& transform_for_tile_priority) { |
103 SyncCompositorDemandDrawHwParams params(surface_size, transform, viewport, | 100 SyncCompositorDemandDrawHwParams params( |
104 clip, viewport_rect_for_tile_priority, | 101 viewport, viewport_rect_for_tile_priority, transform_for_tile_priority); |
105 transform_for_tile_priority); | |
106 SynchronousCompositor::Frame frame; | 102 SynchronousCompositor::Frame frame; |
107 frame.frame.reset(new cc::CompositorFrame); | 103 frame.frame.reset(new cc::CompositorFrame); |
108 SyncCompositorCommonRendererParams common_renderer_params; | 104 SyncCompositorCommonRendererParams common_renderer_params; |
109 if (!sender_->Send(new SyncCompositorMsg_DemandDrawHw( | 105 if (!sender_->Send(new SyncCompositorMsg_DemandDrawHw( |
110 routing_id_, params, &common_renderer_params, | 106 routing_id_, params, &common_renderer_params, |
111 &frame.output_surface_id, frame.frame.get()))) { | 107 &frame.output_surface_id, frame.frame.get()))) { |
112 return SynchronousCompositor::Frame(); | 108 return SynchronousCompositor::Frame(); |
113 } | 109 } |
114 ProcessCommonParams(common_renderer_params); | 110 ProcessCommonParams(common_renderer_params); |
115 if (!frame.frame->delegated_frame_data) { | 111 if (!frame.frame->delegated_frame_data) { |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 if (params.page_scale_factor) { | 377 if (params.page_scale_factor) { |
382 client_->UpdateRootLayerState( | 378 client_->UpdateRootLayerState( |
383 this, gfx::ScrollOffsetToVector2dF(params.total_scroll_offset), | 379 this, gfx::ScrollOffsetToVector2dF(params.total_scroll_offset), |
384 gfx::ScrollOffsetToVector2dF(params.max_scroll_offset), | 380 gfx::ScrollOffsetToVector2dF(params.max_scroll_offset), |
385 params.scrollable_size, params.page_scale_factor, | 381 params.scrollable_size, params.page_scale_factor, |
386 params.min_page_scale_factor, params.max_page_scale_factor); | 382 params.min_page_scale_factor, params.max_page_scale_factor); |
387 } | 383 } |
388 } | 384 } |
389 | 385 |
390 } // namespace content | 386 } // namespace content |
OLD | NEW |