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/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
793 | 793 |
794 #if defined(OS_MACOSX) | 794 #if defined(OS_MACOSX) |
795 void GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped( | 795 void GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped( |
796 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params) { | 796 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params) { |
797 TRACE_EVENT0("gpu", "GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped"); | 797 TRACE_EVENT0("gpu", "GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped"); |
798 | 798 |
799 if (!ui::LatencyInfo::Verify(params.latency_info, | 799 if (!ui::LatencyInfo::Verify(params.latency_info, |
800 "GpuHostMsg_AcceleratedSurfaceBuffersSwapped")) | 800 "GpuHostMsg_AcceleratedSurfaceBuffersSwapped")) |
801 return; | 801 return; |
802 | 802 |
803 gfx::AcceleratedWidget native_widget = | |
804 GpuSurfaceTracker::Get()->AcquireNativeWidget(params.surface_id); | |
805 if (native_widget) { | |
806 RenderWidgetHelper::OnNativeSurfaceBuffersSwapped(params); | |
ccameron
2014/05/06 00:20:32
We may want to move this to a place higher up in t
piman
2014/05/06 00:59:01
Definitely not for this patch, but I'm hoping we c
| |
807 return; | |
808 } | |
809 | |
803 gfx::GLSurfaceHandle surface_handle = | 810 gfx::GLSurfaceHandle surface_handle = |
804 GpuSurfaceTracker::Get()->GetSurfaceHandle(params.surface_id); | 811 GpuSurfaceTracker::Get()->GetSurfaceHandle(params.surface_id); |
805 // Compositor window is always gfx::kNullPluginWindow. | 812 // Compositor window is always gfx::kNullPluginWindow. |
806 // TODO(jbates) http://crbug.com/105344 This will be removed when there are no | 813 // TODO(jbates) http://crbug.com/105344 This will be removed when there are no |
807 // plugin windows. | 814 // plugin windows. |
808 if (surface_handle.handle != gfx::kNullPluginWindow || | 815 if (surface_handle.handle != gfx::kNullPluginWindow || |
809 surface_handle.transport_type == gfx::TEXTURE_TRANSPORT) { | 816 surface_handle.transport_type == gfx::TEXTURE_TRANSPORT) { |
810 RouteOnUIThread(GpuHostMsg_AcceleratedSurfaceBuffersSwapped(params)); | 817 RouteOnUIThread(GpuHostMsg_AcceleratedSurfaceBuffersSwapped(params)); |
811 return; | 818 return; |
812 } | 819 } |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1056 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1063 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
1057 ClientIdToShaderCacheMap::iterator iter = | 1064 ClientIdToShaderCacheMap::iterator iter = |
1058 client_id_to_shader_cache_.find(client_id); | 1065 client_id_to_shader_cache_.find(client_id); |
1059 // If the cache doesn't exist then this is an off the record profile. | 1066 // If the cache doesn't exist then this is an off the record profile. |
1060 if (iter == client_id_to_shader_cache_.end()) | 1067 if (iter == client_id_to_shader_cache_.end()) |
1061 return; | 1068 return; |
1062 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1069 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
1063 } | 1070 } |
1064 | 1071 |
1065 } // namespace content | 1072 } // namespace content |
OLD | NEW |