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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 SynchronousCompositorHost::~SynchronousCompositorHost() { | 84 SynchronousCompositorHost::~SynchronousCompositorHost() { |
85 client_->DidDestroyCompositor(this, process_id_, routing_id_); | 85 client_->DidDestroyCompositor(this, process_id_, routing_id_); |
86 } | 86 } |
87 | 87 |
88 bool SynchronousCompositorHost::OnMessageReceived(const IPC::Message& message) { | 88 bool SynchronousCompositorHost::OnMessageReceived(const IPC::Message& message) { |
89 bool handled = true; | 89 bool handled = true; |
90 IPC_BEGIN_MESSAGE_MAP(SynchronousCompositorHost, message) | 90 IPC_BEGIN_MESSAGE_MAP(SynchronousCompositorHost, message) |
91 IPC_MESSAGE_HANDLER(SyncCompositorHostMsg_CompositorFrameSinkCreated, | 91 IPC_MESSAGE_HANDLER(SyncCompositorHostMsg_CompositorFrameSinkCreated, |
92 CompositorFrameSinkCreated) | 92 CompositorFrameSinkCreated) |
93 IPC_MESSAGE_HANDLER(SyncCompositorHostMsg_UpdateState, ProcessCommonParams) | 93 IPC_MESSAGE_HANDLER(SyncCompositorHostMsg_UpdateState, ProcessCommonParams) |
94 IPC_MESSAGE_HANDLER_GENERIC(SyncCompositorHostMsg_ReturnFrame, | 94 // IPC_MESSAGE_HANDLER_GENERIC(SyncCompositorHostMsg_ReturnFrame, |
95 DemandDrawHwReceiveFrame(message)) | 95 // DemandDrawHwReceiveFrame(message)) |
96 IPC_MESSAGE_UNHANDLED(handled = false) | 96 IPC_MESSAGE_UNHANDLED(handled = false) |
97 IPC_END_MESSAGE_MAP() | 97 IPC_END_MESSAGE_MAP() |
98 return handled; | 98 return handled; |
99 } | 99 } |
100 | 100 |
101 void SynchronousCompositorHost::DemandDrawHwAsync( | 101 scoped_refptr<SynchronousCompositor::FrameFuture> |
| 102 SynchronousCompositorHost::DemandDrawHwAsync( |
102 const gfx::Size& viewport_size, | 103 const gfx::Size& viewport_size, |
103 const gfx::Rect& viewport_rect_for_tile_priority, | 104 const gfx::Rect& viewport_rect_for_tile_priority, |
104 const gfx::Transform& transform_for_tile_priority) { | 105 const gfx::Transform& transform_for_tile_priority) { |
105 SyncCompositorDemandDrawHwParams params(viewport_size, | 106 SyncCompositorDemandDrawHwParams params(viewport_size, |
106 viewport_rect_for_tile_priority, | 107 viewport_rect_for_tile_priority, |
107 transform_for_tile_priority); | 108 transform_for_tile_priority); |
| 109 scoped_refptr<SynchronousCompositor::FrameFuture> frame_future = |
| 110 new FrameFuture(); |
| 111 rwhva_->GetRenderWidgetHost()->GetProcess()->GetFilter()->SetFrameFuture( |
| 112 routing_id_, frame_future); |
108 sender_->Send(new SyncCompositorMsg_DemandDrawHwAsync(routing_id_, params)); | 113 sender_->Send(new SyncCompositorMsg_DemandDrawHwAsync(routing_id_, params)); |
| 114 return frame_future; |
109 } | 115 } |
110 | 116 |
111 SynchronousCompositor::Frame SynchronousCompositorHost::DemandDrawHw( | 117 SynchronousCompositor::Frame SynchronousCompositorHost::DemandDrawHw( |
112 const gfx::Size& viewport_size, | 118 const gfx::Size& viewport_size, |
113 const gfx::Rect& viewport_rect_for_tile_priority, | 119 const gfx::Rect& viewport_rect_for_tile_priority, |
114 const gfx::Transform& transform_for_tile_priority) { | 120 const gfx::Transform& transform_for_tile_priority) { |
115 SyncCompositorDemandDrawHwParams params(viewport_size, | 121 SyncCompositorDemandDrawHwParams params(viewport_size, |
116 viewport_rect_for_tile_priority, | 122 viewport_rect_for_tile_priority, |
117 transform_for_tile_priority); | 123 transform_for_tile_priority); |
118 uint32_t compositor_frame_sink_id; | 124 uint32_t compositor_frame_sink_id; |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 if (params.page_scale_factor) { | 431 if (params.page_scale_factor) { |
426 client_->UpdateRootLayerState( | 432 client_->UpdateRootLayerState( |
427 this, gfx::ScrollOffsetToVector2dF(params.total_scroll_offset), | 433 this, gfx::ScrollOffsetToVector2dF(params.total_scroll_offset), |
428 gfx::ScrollOffsetToVector2dF(params.max_scroll_offset), | 434 gfx::ScrollOffsetToVector2dF(params.max_scroll_offset), |
429 params.scrollable_size, params.page_scale_factor, | 435 params.scrollable_size, params.page_scale_factor, |
430 params.min_page_scale_factor, params.max_page_scale_factor); | 436 params.min_page_scale_factor, params.max_page_scale_factor); |
431 } | 437 } |
432 } | 438 } |
433 | 439 |
434 } // namespace content | 440 } // namespace content |
OLD | NEW |