diff options
author | miletus@chromium.org <miletus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-02 22:56:50 +0000 |
---|---|---|
committer | miletus@chromium.org <miletus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-02 22:56:50 +0000 |
commit | b76029b635be92539c461a084c801b95d53beedf (patch) | |
tree | 5ee99a79709728a2223d878f3e064d6a18566ae6 /content/browser/renderer_host | |
parent | bf46313710fa79090e01a2c933dc1411e124e6a3 (diff) | |
download | chromium_src-b76029b635be92539c461a084c801b95d53beedf.zip chromium_src-b76029b635be92539c461a084c801b95d53beedf.tar.gz chromium_src-b76029b635be92539c461a084c801b95d53beedf.tar.bz2 |
Remove some LatencyInfo merging code path
This CL removes a few code paths that do LatencyInfo merging:
1. compositor -> output surface through CompositorFrameMetadata
2. gpu -> browser compositor through
GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params and
GpuHostMsg_AcceleratedSurfacePostSubBuffer_Param
A follow up CL will remove GPU side LatencyInfo merging (mainly in image
transport surface) so that we remove LatencyInfo merging entirely from
the code path renderer cc -> gpu -> browser cc -> gpu.
BUG=246034
TEST=unittests pass.
Review URL: https://codereview.chromium.org/100443006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242825 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host')
4 files changed, 32 insertions, 15 deletions
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc index 83fec41..881bf81 100644 --- a/content/browser/renderer_host/render_widget_host_view_android.cc +++ b/content/browser/renderer_host/render_widget_host_view_android.cc @@ -810,9 +810,11 @@ void RenderWidgetHostViewAndroid::OnSwapCompositorFrame( ComputeContentsSize(frame->metadata); if (layer_->layer_tree_host()) { - scoped_ptr<cc::SwapPromise> swap_promise( - new cc::LatencyInfoSwapPromise(frame->metadata.latency_info)); - layer_->layer_tree_host()->QueueSwapPromise(swap_promise.Pass()); + for (size_t i = 0; i < frame->metadata.latency_info.size(); i++) { + scoped_ptr<cc::SwapPromise> swap_promise( + new cc::LatencyInfoSwapPromise(frame->metadata.latency_info[i])); + layer_->layer_tree_host()->QueueSwapPromise(swap_promise.Pass()); + } } BuffersSwapped(frame->gl_frame_data->mailbox, output_surface_id, callback); diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index e3651c6..700aece 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -1329,11 +1329,16 @@ void RenderWidgetHostViewAura::AcceleratedSurfaceBuffersSwapped( params_in_pixel.route_id, gpu_host_id, params_in_pixel.mailbox_name); + // TODO(miletus) : Pass the params_in_pixel.latency_info directly into + // BuffersSwapped() once GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params + // is converted to contain std::vector<ui::LatencyInfo>. + std::vector<ui::LatencyInfo> latency_info; + latency_info.push_back(params_in_pixel.latency_info); BuffersSwapped(params_in_pixel.size, gfx::Rect(params_in_pixel.size), params_in_pixel.scale_factor, params_in_pixel.mailbox_name, - params_in_pixel.latency_info, + latency_info, ack_callback); } @@ -1341,7 +1346,7 @@ void RenderWidgetHostViewAura::SwapDelegatedFrame( uint32 output_surface_id, scoped_ptr<cc::DelegatedFrameData> frame_data, float frame_device_scale_factor, - const ui::LatencyInfo& latency_info) { + const std::vector<ui::LatencyInfo>& latency_info) { DCHECK_NE(0u, frame_data->render_pass_list.size()); cc::RenderPass* root_pass = frame_data->render_pass_list.back(); @@ -1437,7 +1442,8 @@ void RenderWidgetHostViewAura::SwapDelegatedFrame( if (!compositor) { SendDelegatedFrameAck(output_surface_id); } else { - compositor->SetLatencyInfo(latency_info); + for (size_t i = 0; i < latency_info.size(); i++) + compositor->SetLatencyInfo(latency_info[i]); AddOnCommitCallbackAndDisableLocks( base::Bind(&RenderWidgetHostViewAura::SendDelegatedFrameAck, AsWeakPtr(), @@ -1491,7 +1497,7 @@ void RenderWidgetHostViewAura::SwapSoftwareFrame( uint32 output_surface_id, scoped_ptr<cc::SoftwareFrameData> frame_data, float frame_device_scale_factor, - const ui::LatencyInfo& latency_info) { + const std::vector<ui::LatencyInfo>& latency_info) { const gfx::Size& frame_size = frame_data->size; const gfx::Rect& damage_rect = frame_data->damage_rect; gfx::Size frame_size_in_dip = @@ -1535,7 +1541,8 @@ void RenderWidgetHostViewAura::SwapSoftwareFrame( ui::Compositor* compositor = GetCompositor(); if (compositor) { - compositor->SetLatencyInfo(latency_info); + for (size_t i = 0; i < latency_info.size(); i++) + compositor->SetLatencyInfo(latency_info[i]); AddOnCommitCallbackAndDisableLocks( base::Bind(&RenderWidgetHostViewAura::SendSoftwareFrameAck, AsWeakPtr(), @@ -1654,7 +1661,7 @@ void RenderWidgetHostViewAura::BuffersSwapped( const gfx::Rect& damage_rect, float surface_scale_factor, const std::string& mailbox_name, - const ui::LatencyInfo& latency_info, + const std::vector<ui::LatencyInfo>& latency_info, const BufferPresentedCallback& ack_callback) { scoped_refptr<ui::Texture> previous_texture(current_surface_); const gfx::Rect surface_rect = gfx::Rect(surface_size); @@ -1714,7 +1721,8 @@ void RenderWidgetHostViewAura::BuffersSwapped( if (paint_observer_) paint_observer_->OnUpdateCompositorContent(); window_->SchedulePaintInRect(rect_to_paint); - compositor->SetLatencyInfo(latency_info); + for (size_t i = 0; i < latency_info.size(); i++) + compositor->SetLatencyInfo(latency_info[i]); } SwapBuffersCompleted(ack_callback, previous_texture); @@ -1732,11 +1740,16 @@ void RenderWidgetHostViewAura::AcceleratedSurfacePostSubBuffer( params_in_pixel.route_id, gpu_host_id, params_in_pixel.mailbox_name); + // TODO(miletus) : Pass the params_in_pixel.latency_info directly into + // BuffersSwapped() once GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params + // is converted to contain std::vector<ui::LatencyInfo>. + std::vector<ui::LatencyInfo> latency_info; + latency_info.push_back(params_in_pixel.latency_info); BuffersSwapped(params_in_pixel.surface_size, damage_rect, params_in_pixel.surface_scale_factor, params_in_pixel.mailbox_name, - params_in_pixel.latency_info, + latency_info, ack_callback); } diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h index 0da4885..4039c5b 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.h +++ b/content/browser/renderer_host/render_widget_host_view_aura.h @@ -527,7 +527,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAura const gfx::Rect& damage_rect, float surface_scale_factor, const std::string& mailbox_name, - const ui::LatencyInfo& latency_info, + const std::vector<ui::LatencyInfo>& latency_info, const BufferPresentedCallback& ack_callback); bool SwapBuffersPrepare(const gfx::Rect& surface_rect, @@ -544,7 +544,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAura uint32 output_surface_id, scoped_ptr<cc::DelegatedFrameData> frame_data, float frame_device_scale_factor, - const ui::LatencyInfo& latency_info); + const std::vector<ui::LatencyInfo>& latency_info); void SendDelegatedFrameAck(uint32 output_surface_id); void SendReturnedDelegatedResources(uint32 output_surface_id); @@ -557,7 +557,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAura void SwapSoftwareFrame(uint32 output_surface_id, scoped_ptr<cc::SoftwareFrameData> frame_data, float frame_device_scale_factor, - const ui::LatencyInfo& latency_info); + const std::vector<ui::LatencyInfo>& latency_info); void SendSoftwareFrameAck(uint32 output_surface_id); void SendReclaimSoftwareFrames(); void ReleaseSoftwareFrame(uint32 output_surface_id, diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm index ac25d31..d5825c8 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm @@ -1693,7 +1693,9 @@ void RenderWidgetHostViewMac::OnSwapCompositorFrame( software_frame_manager_->GetCurrentFrameOutputSurfaceId(), render_widget_host_->GetProcess()->GetID(), ack); - software_latency_info_.push_back(frame->metadata.latency_info); + for (size_t i = 0; i < frame->metadata.latency_info.size(); i++) { + software_latency_info_.push_back(frame->metadata.latency_info[i]); + } software_frame_manager_->SwapToNewFrameComplete( !render_widget_host_->is_hidden()); |