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 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1371 int32 surface_id, | 1371 int32 surface_id, |
1372 uint64 surface_handle, | 1372 uint64 surface_handle, |
1373 int32 route_id, | 1373 int32 route_id, |
1374 const gfx::Size& size, | 1374 const gfx::Size& size, |
1375 int32 gpu_process_host_id) { | 1375 int32 gpu_process_host_id) { |
1376 TRACE_EVENT0("renderer_host", | 1376 TRACE_EVENT0("renderer_host", |
1377 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwapped"); | 1377 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwapped"); |
1378 if (!view_) { | 1378 if (!view_) { |
1379 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, | 1379 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, |
1380 gpu_process_host_id, | 1380 gpu_process_host_id, |
| 1381 false, |
1381 0); | 1382 0); |
1382 return; | 1383 return; |
1383 } | 1384 } |
1384 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params gpu_params; | 1385 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params gpu_params; |
1385 gpu_params.surface_id = surface_id; | 1386 gpu_params.surface_id = surface_id; |
1386 gpu_params.surface_handle = surface_handle; | 1387 gpu_params.surface_handle = surface_handle; |
1387 gpu_params.route_id = route_id; | 1388 gpu_params.route_id = route_id; |
1388 gpu_params.size = size; | 1389 gpu_params.size = size; |
1389 #if defined(OS_MACOSX) | 1390 #if defined(OS_MACOSX) |
1390 // Compositor window is always gfx::kNullPluginWindow. | 1391 // Compositor window is always gfx::kNullPluginWindow. |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2081 return false; | 2082 return false; |
2082 } else { | 2083 } else { |
2083 Send(new ViewMsg_LockMouse_ACK(routing_id_, true)); | 2084 Send(new ViewMsg_LockMouse_ACK(routing_id_, true)); |
2084 return true; | 2085 return true; |
2085 } | 2086 } |
2086 } | 2087 } |
2087 } | 2088 } |
2088 | 2089 |
2089 // static | 2090 // static |
2090 void RenderWidgetHostImpl::AcknowledgeBufferPresent( | 2091 void RenderWidgetHostImpl::AcknowledgeBufferPresent( |
2091 int32 route_id, int gpu_host_id, uint32 sync_point) { | 2092 int32 route_id, int gpu_host_id, bool presented, uint32 sync_point) { |
2092 GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(gpu_host_id); | 2093 GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(gpu_host_id); |
2093 if (ui_shim) | 2094 if (ui_shim) |
2094 ui_shim->Send(new AcceleratedSurfaceMsg_BufferPresented(route_id, | 2095 ui_shim->Send(new AcceleratedSurfaceMsg_BufferPresented(route_id, |
| 2096 presented, |
2095 sync_point)); | 2097 sync_point)); |
2096 } | 2098 } |
2097 | 2099 |
2098 void RenderWidgetHostImpl::AcknowledgeSwapBuffersToRenderer() { | 2100 void RenderWidgetHostImpl::AcknowledgeSwapBuffersToRenderer() { |
2099 if (!is_threaded_compositing_enabled_) | 2101 if (!is_threaded_compositing_enabled_) |
2100 Send(new ViewMsg_SwapBuffers_ACK(routing_id_)); | 2102 Send(new ViewMsg_SwapBuffers_ACK(routing_id_)); |
2101 } | 2103 } |
2102 | 2104 |
2103 #if defined(USE_AURA) | 2105 #if defined(USE_AURA) |
2104 // static | 2106 // static |
(...skipping 20 matching lines...) Expand all Loading... |
2125 return; | 2127 return; |
2126 | 2128 |
2127 OnRenderAutoResized(new_size); | 2129 OnRenderAutoResized(new_size); |
2128 } | 2130 } |
2129 | 2131 |
2130 void RenderWidgetHostImpl::DetachDelegate() { | 2132 void RenderWidgetHostImpl::DetachDelegate() { |
2131 delegate_ = NULL; | 2133 delegate_ = NULL; |
2132 } | 2134 } |
2133 | 2135 |
2134 } // namespace content | 2136 } // namespace content |
OLD | NEW |