| 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/gpu/gpu_process_host.h" | 5 #include "content/browser/gpu/gpu_process_host.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 918 RenderWidgetHelper* helper = | 918 RenderWidgetHelper* helper = |
| 919 RenderWidgetHelper::FromProcessHostID(render_process_id); | 919 RenderWidgetHelper::FromProcessHostID(render_process_id); |
| 920 if (!helper) | 920 if (!helper) |
| 921 return; | 921 return; |
| 922 | 922 |
| 923 // Pass the SwapBuffers on to the RenderWidgetHelper to wake up the UI thread | 923 // Pass the SwapBuffers on to the RenderWidgetHelper to wake up the UI thread |
| 924 // if the browser is waiting for a new frame. Otherwise the RenderWidgetHelper | 924 // if the browser is waiting for a new frame. Otherwise the RenderWidgetHelper |
| 925 // will forward to the RenderWidgetHostView via RenderProcessHostImpl and | 925 // will forward to the RenderWidgetHostView via RenderProcessHostImpl and |
| 926 // RenderWidgetHostImpl. | 926 // RenderWidgetHostImpl. |
| 927 scoped_completion_runner.Release(); | 927 scoped_completion_runner.Release(); |
| 928 |
| 929 ViewHostMsg_CompositorSurfaceBuffersSwapped_Params view_params; |
| 930 view_params.surface_id = params.surface_id; |
| 931 view_params.surface_handle = params.surface_handle; |
| 932 view_params.route_id = params.route_id; |
| 933 view_params.size = params.size; |
| 934 view_params.scale_factor = params.scale_factor; |
| 935 view_params.gpu_process_host_id = host_id_; |
| 928 helper->DidReceiveBackingStoreMsg(ViewHostMsg_CompositorSurfaceBuffersSwapped( | 936 helper->DidReceiveBackingStoreMsg(ViewHostMsg_CompositorSurfaceBuffersSwapped( |
| 929 render_widget_id, | 937 render_widget_id, |
| 930 params.surface_id, | 938 view_params)); |
| 931 params.surface_handle, | |
| 932 params.route_id, | |
| 933 params.size, | |
| 934 host_id_)); | |
| 935 } | 939 } |
| 936 #endif // OS_MACOSX | 940 #endif // OS_MACOSX |
| 937 | 941 |
| 938 #if defined(OS_WIN) | 942 #if defined(OS_WIN) |
| 939 void GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped( | 943 void GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped( |
| 940 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params) { | 944 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params) { |
| 941 TRACE_EVENT0("gpu", "GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped"); | 945 TRACE_EVENT0("gpu", "GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped"); |
| 942 | 946 |
| 943 base::ScopedClosureRunner scoped_completion_runner( | 947 base::ScopedClosureRunner scoped_completion_runner( |
| 944 base::Bind(&AcceleratedSurfaceBuffersSwappedCompleted, | 948 base::Bind(&AcceleratedSurfaceBuffersSwappedCompleted, |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1256 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1260 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
| 1257 ClientIdToShaderCacheMap::iterator iter = | 1261 ClientIdToShaderCacheMap::iterator iter = |
| 1258 client_id_to_shader_cache_.find(client_id); | 1262 client_id_to_shader_cache_.find(client_id); |
| 1259 // If the cache doesn't exist then this is an off the record profile. | 1263 // If the cache doesn't exist then this is an off the record profile. |
| 1260 if (iter == client_id_to_shader_cache_.end()) | 1264 if (iter == client_id_to_shader_cache_.end()) |
| 1261 return; | 1265 return; |
| 1262 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1266 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
| 1263 } | 1267 } |
| 1264 | 1268 |
| 1265 } // namespace content | 1269 } // namespace content |
| OLD | NEW |