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

Side by Side Diff: content/browser/android/synchronous_compositor_host.cc

Issue 2036023002: Rewire Android WebView's compositor changed signal. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use web_contents_ Created 4 years, 6 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 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 } 61 }
62 62
63 SynchronousCompositorHost::SynchronousCompositorHost( 63 SynchronousCompositorHost::SynchronousCompositorHost(
64 RenderWidgetHostViewAndroid* rwhva, 64 RenderWidgetHostViewAndroid* rwhva,
65 SynchronousCompositorClient* client, 65 SynchronousCompositorClient* client,
66 bool use_in_proc_software_draw) 66 bool use_in_proc_software_draw)
67 : rwhva_(rwhva), 67 : rwhva_(rwhva),
68 client_(client), 68 client_(client),
69 ui_task_runner_( 69 ui_task_runner_(
70 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI)), 70 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI)),
71 process_id_(rwhva_->GetRenderWidgetHost()->GetProcess()->GetID()),
71 routing_id_(rwhva_->GetRenderWidgetHost()->GetRoutingID()), 72 routing_id_(rwhva_->GetRenderWidgetHost()->GetRoutingID()),
72 sender_(rwhva_->GetRenderWidgetHost()), 73 sender_(rwhva_->GetRenderWidgetHost()),
73 use_in_process_zero_copy_software_draw_(use_in_proc_software_draw), 74 use_in_process_zero_copy_software_draw_(use_in_proc_software_draw),
74 bytes_limit_(0u), 75 bytes_limit_(0u),
75 renderer_param_version_(0u), 76 renderer_param_version_(0u),
76 need_animate_scroll_(false), 77 need_animate_scroll_(false),
77 need_invalidate_count_(0u), 78 need_invalidate_count_(0u),
78 did_activate_pending_tree_count_(0u) { 79 did_activate_pending_tree_count_(0u) {
79 client_->DidInitializeCompositor(this); 80 client_->DidInitializeCompositor(this, process_id_, routing_id_);
80 } 81 }
81 82
82 SynchronousCompositorHost::~SynchronousCompositorHost() { 83 SynchronousCompositorHost::~SynchronousCompositorHost() {
83 client_->DidDestroyCompositor(this); 84 client_->DidDestroyCompositor(this, process_id_, routing_id_);
84 } 85 }
85 86
86 bool SynchronousCompositorHost::OnMessageReceived(const IPC::Message& message) { 87 bool SynchronousCompositorHost::OnMessageReceived(const IPC::Message& message) {
87 bool handled = true; 88 bool handled = true;
88 IPC_BEGIN_MESSAGE_MAP(SynchronousCompositorHost, message) 89 IPC_BEGIN_MESSAGE_MAP(SynchronousCompositorHost, message)
89 IPC_MESSAGE_HANDLER(SyncCompositorHostMsg_OutputSurfaceCreated, 90 IPC_MESSAGE_HANDLER(SyncCompositorHostMsg_OutputSurfaceCreated,
90 OutputSurfaceCreated) 91 OutputSurfaceCreated)
91 IPC_MESSAGE_HANDLER(SyncCompositorHostMsg_UpdateState, ProcessCommonParams) 92 IPC_MESSAGE_HANDLER(SyncCompositorHostMsg_UpdateState, ProcessCommonParams)
92 IPC_MESSAGE_UNHANDLED(handled = false) 93 IPC_MESSAGE_UNHANDLED(handled = false)
93 IPC_END_MESSAGE_MAP() 94 IPC_END_MESSAGE_MAP()
94 return handled; 95 return handled;
95 } 96 }
96 97
97 void SynchronousCompositorHost::DidBecomeCurrent() {
98 client_->DidBecomeCurrent(this);
99 }
100
101 SynchronousCompositor::Frame SynchronousCompositorHost::DemandDrawHw( 98 SynchronousCompositor::Frame SynchronousCompositorHost::DemandDrawHw(
102 const gfx::Size& surface_size, 99 const gfx::Size& surface_size,
103 const gfx::Transform& transform, 100 const gfx::Transform& transform,
104 const gfx::Rect& viewport, 101 const gfx::Rect& viewport,
105 const gfx::Rect& clip, 102 const gfx::Rect& clip,
106 const gfx::Rect& viewport_rect_for_tile_priority, 103 const gfx::Rect& viewport_rect_for_tile_priority,
107 const gfx::Transform& transform_for_tile_priority) { 104 const gfx::Transform& transform_for_tile_priority) {
108 SyncCompositorDemandDrawHwParams params(surface_size, transform, viewport, 105 SyncCompositorDemandDrawHwParams params(surface_size, transform, viewport,
109 clip, viewport_rect_for_tile_priority, 106 clip, viewport_rect_for_tile_priority,
110 transform_for_tile_priority); 107 transform_for_tile_priority);
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 if (params.page_scale_factor) { 383 if (params.page_scale_factor) {
387 client_->UpdateRootLayerState( 384 client_->UpdateRootLayerState(
388 gfx::ScrollOffsetToVector2dF(params.total_scroll_offset), 385 gfx::ScrollOffsetToVector2dF(params.total_scroll_offset),
389 gfx::ScrollOffsetToVector2dF(params.max_scroll_offset), 386 gfx::ScrollOffsetToVector2dF(params.max_scroll_offset),
390 params.scrollable_size, params.page_scale_factor, 387 params.scrollable_size, params.page_scale_factor,
391 params.min_page_scale_factor, params.max_page_scale_factor); 388 params.min_page_scale_factor, params.max_page_scale_factor);
392 } 389 }
393 } 390 }
394 391
395 } // namespace content 392 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/synchronous_compositor_host.h ('k') | content/browser/renderer_host/render_widget_host_view_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698