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_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1383 int32 surface_id, | 1383 int32 surface_id, |
1384 uint64 surface_handle, | 1384 uint64 surface_handle, |
1385 int32 route_id, | 1385 int32 route_id, |
1386 const gfx::Size& size, | 1386 const gfx::Size& size, |
1387 int32 gpu_process_host_id) { | 1387 int32 gpu_process_host_id) { |
1388 TRACE_EVENT0("renderer_host", | 1388 TRACE_EVENT0("renderer_host", |
1389 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwapped"); | 1389 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwapped"); |
1390 if (!view_) { | 1390 if (!view_) { |
1391 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, | 1391 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, |
1392 gpu_process_host_id, | 1392 gpu_process_host_id, |
| 1393 false, |
1393 0); | 1394 0); |
1394 return; | 1395 return; |
1395 } | 1396 } |
1396 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params gpu_params; | 1397 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params gpu_params; |
1397 gpu_params.surface_id = surface_id; | 1398 gpu_params.surface_id = surface_id; |
1398 gpu_params.surface_handle = surface_handle; | 1399 gpu_params.surface_handle = surface_handle; |
1399 gpu_params.route_id = route_id; | 1400 gpu_params.route_id = route_id; |
1400 gpu_params.size = size; | 1401 gpu_params.size = size; |
1401 #if defined(OS_MACOSX) | 1402 #if defined(OS_MACOSX) |
1402 // Compositor window is always gfx::kNullPluginWindow. | 1403 // Compositor window is always gfx::kNullPluginWindow. |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2120 return false; | 2121 return false; |
2121 } else { | 2122 } else { |
2122 Send(new ViewMsg_LockMouse_ACK(routing_id_, true)); | 2123 Send(new ViewMsg_LockMouse_ACK(routing_id_, true)); |
2123 return true; | 2124 return true; |
2124 } | 2125 } |
2125 } | 2126 } |
2126 } | 2127 } |
2127 | 2128 |
2128 // static | 2129 // static |
2129 void RenderWidgetHostImpl::AcknowledgeBufferPresent( | 2130 void RenderWidgetHostImpl::AcknowledgeBufferPresent( |
2130 int32 route_id, int gpu_host_id, uint32 sync_point) { | 2131 int32 route_id, int gpu_host_id, bool presented, uint32 sync_point) { |
2131 GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(gpu_host_id); | 2132 GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(gpu_host_id); |
2132 if (ui_shim) | 2133 if (ui_shim) |
2133 ui_shim->Send(new AcceleratedSurfaceMsg_BufferPresented(route_id, | 2134 ui_shim->Send(new AcceleratedSurfaceMsg_BufferPresented(route_id, |
| 2135 presented, |
2134 sync_point)); | 2136 sync_point)); |
2135 } | 2137 } |
2136 | 2138 |
2137 void RenderWidgetHostImpl::AcknowledgeSwapBuffersToRenderer() { | 2139 void RenderWidgetHostImpl::AcknowledgeSwapBuffersToRenderer() { |
2138 if (!is_threaded_compositing_enabled_) | 2140 if (!is_threaded_compositing_enabled_) |
2139 Send(new ViewMsg_SwapBuffers_ACK(routing_id_)); | 2141 Send(new ViewMsg_SwapBuffers_ACK(routing_id_)); |
2140 } | 2142 } |
2141 | 2143 |
2142 #if defined(USE_AURA) | 2144 #if defined(USE_AURA) |
2143 // static | 2145 // static |
(...skipping 20 matching lines...) Expand all Loading... |
2164 return; | 2166 return; |
2165 | 2167 |
2166 OnRenderAutoResized(new_size); | 2168 OnRenderAutoResized(new_size); |
2167 } | 2169 } |
2168 | 2170 |
2169 void RenderWidgetHostImpl::DetachDelegate() { | 2171 void RenderWidgetHostImpl::DetachDelegate() { |
2170 delegate_ = NULL; | 2172 delegate_ = NULL; |
2171 } | 2173 } |
2172 | 2174 |
2173 } // namespace content | 2175 } // namespace content |
OLD | NEW |