OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1333 #endif | 1333 #endif |
1334 | 1334 |
1335 void RenderWidgetHostViewAura::AcceleratedSurfaceBuffersSwapped( | 1335 void RenderWidgetHostViewAura::AcceleratedSurfaceBuffersSwapped( |
1336 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params_in_pixel, | 1336 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params_in_pixel, |
1337 int gpu_host_id) { | 1337 int gpu_host_id) { |
1338 BufferPresentedCallback ack_callback = base::Bind( | 1338 BufferPresentedCallback ack_callback = base::Bind( |
1339 &AcknowledgeBufferForGpu, | 1339 &AcknowledgeBufferForGpu, |
1340 params_in_pixel.route_id, | 1340 params_in_pixel.route_id, |
1341 gpu_host_id, | 1341 gpu_host_id, |
1342 params_in_pixel.mailbox_name); | 1342 params_in_pixel.mailbox_name); |
1343 // TODO(miletus) : Pass the params_in_pixel.latency_info directly into | |
1344 // BuffersSwapped() once GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params | |
1345 // is converted to contain std::vector<ui::LatencyInfo>. | |
1346 std::vector<ui::LatencyInfo> latency_info; | |
1347 latency_info.push_back(params_in_pixel.latency_info); | |
1348 BuffersSwapped(params_in_pixel.size, | 1343 BuffersSwapped(params_in_pixel.size, |
1349 gfx::Rect(params_in_pixel.size), | 1344 gfx::Rect(params_in_pixel.size), |
1350 params_in_pixel.scale_factor, | 1345 params_in_pixel.scale_factor, |
1351 params_in_pixel.mailbox_name, | 1346 params_in_pixel.mailbox_name, |
1352 latency_info, | 1347 params_in_pixel.latency_info, |
1353 ack_callback); | 1348 ack_callback); |
1354 } | 1349 } |
1355 | 1350 |
1356 void RenderWidgetHostViewAura::SwapDelegatedFrame( | 1351 void RenderWidgetHostViewAura::SwapDelegatedFrame( |
1357 uint32 output_surface_id, | 1352 uint32 output_surface_id, |
1358 scoped_ptr<cc::DelegatedFrameData> frame_data, | 1353 scoped_ptr<cc::DelegatedFrameData> frame_data, |
1359 float frame_device_scale_factor, | 1354 float frame_device_scale_factor, |
1360 const std::vector<ui::LatencyInfo>& latency_info) { | 1355 const std::vector<ui::LatencyInfo>& latency_info) { |
1361 DCHECK_NE(0u, frame_data->render_pass_list.size()); | 1356 DCHECK_NE(0u, frame_data->render_pass_list.size()); |
1362 | 1357 |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1744 int gpu_host_id) { | 1739 int gpu_host_id) { |
1745 gfx::Rect damage_rect(params_in_pixel.x, | 1740 gfx::Rect damage_rect(params_in_pixel.x, |
1746 params_in_pixel.y, | 1741 params_in_pixel.y, |
1747 params_in_pixel.width, | 1742 params_in_pixel.width, |
1748 params_in_pixel.height); | 1743 params_in_pixel.height); |
1749 BufferPresentedCallback ack_callback = | 1744 BufferPresentedCallback ack_callback = |
1750 base::Bind(&AcknowledgeBufferForGpu, | 1745 base::Bind(&AcknowledgeBufferForGpu, |
1751 params_in_pixel.route_id, | 1746 params_in_pixel.route_id, |
1752 gpu_host_id, | 1747 gpu_host_id, |
1753 params_in_pixel.mailbox_name); | 1748 params_in_pixel.mailbox_name); |
1754 // TODO(miletus) : Pass the params_in_pixel.latency_info directly into | |
1755 // BuffersSwapped() once GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params | |
1756 // is converted to contain std::vector<ui::LatencyInfo>. | |
1757 std::vector<ui::LatencyInfo> latency_info; | |
1758 latency_info.push_back(params_in_pixel.latency_info); | |
1759 BuffersSwapped(params_in_pixel.surface_size, | 1749 BuffersSwapped(params_in_pixel.surface_size, |
1760 damage_rect, | 1750 damage_rect, |
1761 params_in_pixel.surface_scale_factor, | 1751 params_in_pixel.surface_scale_factor, |
1762 params_in_pixel.mailbox_name, | 1752 params_in_pixel.mailbox_name, |
1763 latency_info, | 1753 params_in_pixel.latency_info, |
1764 ack_callback); | 1754 ack_callback); |
1765 } | 1755 } |
1766 | 1756 |
1767 void RenderWidgetHostViewAura::AcceleratedSurfaceSuspend() { | 1757 void RenderWidgetHostViewAura::AcceleratedSurfaceSuspend() { |
1768 } | 1758 } |
1769 | 1759 |
1770 void RenderWidgetHostViewAura::AcceleratedSurfaceRelease() { | 1760 void RenderWidgetHostViewAura::AcceleratedSurfaceRelease() { |
1771 // This really tells us to release the frontbuffer. | 1761 // This really tells us to release the frontbuffer. |
1772 if (current_surface_.get()) { | 1762 if (current_surface_.get()) { |
1773 ui::Compositor* compositor = GetCompositor(); | 1763 ui::Compositor* compositor = GetCompositor(); |
(...skipping 1727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3501 RenderWidgetHost* widget) { | 3491 RenderWidgetHost* widget) { |
3502 return new RenderWidgetHostViewAura(widget); | 3492 return new RenderWidgetHostViewAura(widget); |
3503 } | 3493 } |
3504 | 3494 |
3505 // static | 3495 // static |
3506 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 3496 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
3507 GetScreenInfoForWindow(results, NULL); | 3497 GetScreenInfoForWindow(results, NULL); |
3508 } | 3498 } |
3509 | 3499 |
3510 } // namespace content | 3500 } // namespace content |
OLD | NEW |