Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 10663003: Merge the IPCs used for GPU process synchronization. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <utility> 7 #include <utility>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after
1234 } 1234 }
1235 1235
1236 void RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwapped( 1236 void RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwapped(
1237 int32 surface_id, 1237 int32 surface_id,
1238 uint64 surface_handle, 1238 uint64 surface_handle,
1239 int32 route_id, 1239 int32 route_id,
1240 int32 gpu_process_host_id) { 1240 int32 gpu_process_host_id) {
1241 TRACE_EVENT0("renderer_host", 1241 TRACE_EVENT0("renderer_host",
1242 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwapped"); 1242 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwapped");
1243 if (!view_) { 1243 if (!view_) {
1244 RenderWidgetHostImpl::AcknowledgeSwapBuffers(route_id, 1244 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id,
1245 gpu_process_host_id); 1245 gpu_process_host_id);
1246 return; 1246 return;
1247 } 1247 }
1248 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params gpu_params; 1248 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params gpu_params;
1249 gpu_params.surface_id = surface_id; 1249 gpu_params.surface_id = surface_id;
1250 gpu_params.surface_handle = surface_handle; 1250 gpu_params.surface_handle = surface_handle;
1251 gpu_params.route_id = route_id; 1251 gpu_params.route_id = route_id;
1252 #if defined(OS_MACOSX) 1252 #if defined(OS_MACOSX)
1253 // Compositor window is always gfx::kNullPluginWindow. 1253 // Compositor window is always gfx::kNullPluginWindow.
1254 // TODO(jbates) http://crbug.com/105344 This will be removed when there are no 1254 // TODO(jbates) http://crbug.com/105344 This will be removed when there are no
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
1841 Send(new ViewMsg_LockMouse_ACK(routing_id_, false)); 1841 Send(new ViewMsg_LockMouse_ACK(routing_id_, false));
1842 return false; 1842 return false;
1843 } else { 1843 } else {
1844 Send(new ViewMsg_LockMouse_ACK(routing_id_, true)); 1844 Send(new ViewMsg_LockMouse_ACK(routing_id_, true));
1845 return true; 1845 return true;
1846 } 1846 }
1847 } 1847 }
1848 } 1848 }
1849 1849
1850 // static 1850 // static
1851 void RenderWidgetHostImpl::AcknowledgeSwapBuffers(int32 route_id, 1851 void RenderWidgetHostImpl::AcknowledgeBufferPresent(int32 route_id,
1852 int gpu_host_id) {
1853 GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(gpu_host_id);
1854 if (ui_shim)
1855 ui_shim->Send(new AcceleratedSurfaceMsg_BuffersSwappedACK(route_id));
1856 }
1857
1858 // static
1859 void RenderWidgetHostImpl::AcknowledgePostSubBuffer(int32 route_id,
1860 int gpu_host_id) { 1852 int gpu_host_id) {
1861 GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(gpu_host_id); 1853 GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(gpu_host_id);
1862 if (ui_shim) 1854 if (ui_shim)
1863 ui_shim->Send(new AcceleratedSurfaceMsg_PostSubBufferACK(route_id)); 1855 ui_shim->Send(new AcceleratedSurfaceMsg_BufferPresented(route_id));
1864 } 1856 }
1865 1857
1866 void RenderWidgetHostImpl::DelayedAutoResized() { 1858 void RenderWidgetHostImpl::DelayedAutoResized() {
1867 gfx::Size new_size = new_auto_size_; 1859 gfx::Size new_size = new_auto_size_;
1868 // Clear the new_auto_size_ since the empty value is used as a flag to 1860 // Clear the new_auto_size_ since the empty value is used as a flag to
1869 // indicate that no callback is in progress (i.e. without this line 1861 // indicate that no callback is in progress (i.e. without this line
1870 // DelayedAutoResized will not get called again). 1862 // DelayedAutoResized will not get called again).
1871 new_auto_size_.SetSize(0, 0); 1863 new_auto_size_.SetSize(0, 0);
1872 if (!should_auto_resize_) 1864 if (!should_auto_resize_)
1873 return; 1865 return;
1874 1866
1875 OnRenderAutoResized(new_size); 1867 OnRenderAutoResized(new_size);
1876 } 1868 }
1877 1869
1878 } // namespace content 1870 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.h ('k') | content/browser/renderer_host/render_widget_host_view_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698