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