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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 } | 124 } |
125 } | 125 } |
126 | 126 |
127 #if defined(OS_WIN) | 127 #if defined(OS_WIN) |
128 // This sends a ViewMsg_SwapBuffers_ACK directly to the renderer process | 128 // This sends a ViewMsg_SwapBuffers_ACK directly to the renderer process |
129 // (RenderWidget). | 129 // (RenderWidget). |
130 void AcceleratedSurfaceBuffersSwappedCompletedForRenderer( | 130 void AcceleratedSurfaceBuffersSwappedCompletedForRenderer( |
131 int surface_id, | 131 int surface_id, |
132 base::TimeTicks timebase, | 132 base::TimeTicks timebase, |
133 base::TimeDelta interval, | 133 base::TimeDelta interval, |
134 const ui::LatencyInfo& latency_info) { | 134 const std::vector<ui::LatencyInfo>& latency_info) { |
135 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { | 135 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
136 BrowserThread::PostTask( | 136 BrowserThread::PostTask( |
137 BrowserThread::UI, | 137 BrowserThread::UI, |
138 FROM_HERE, | 138 FROM_HERE, |
139 base::Bind(&AcceleratedSurfaceBuffersSwappedCompletedForRenderer, | 139 base::Bind(&AcceleratedSurfaceBuffersSwappedCompletedForRenderer, |
140 surface_id, timebase, interval, latency_info)); | 140 surface_id, timebase, interval, latency_info)); |
141 return; | 141 return; |
142 } | 142 } |
143 | 143 |
144 int render_process_id = 0; | 144 int render_process_id = 0; |
(...skipping 14 matching lines...) Expand all Loading... |
159 RenderWidgetHostImpl::From(rwh)->DidReceiveRendererFrame(); | 159 RenderWidgetHostImpl::From(rwh)->DidReceiveRendererFrame(); |
160 } | 160 } |
161 | 161 |
162 void AcceleratedSurfaceBuffersSwappedCompleted( | 162 void AcceleratedSurfaceBuffersSwappedCompleted( |
163 int host_id, | 163 int host_id, |
164 int route_id, | 164 int route_id, |
165 int surface_id, | 165 int surface_id, |
166 bool alive, | 166 bool alive, |
167 base::TimeTicks timebase, | 167 base::TimeTicks timebase, |
168 base::TimeDelta interval, | 168 base::TimeDelta interval, |
169 const ui::LatencyInfo& latency_info) { | 169 const std::vector<ui::LatencyInfo>& latency_info) { |
170 AcceleratedSurfaceBuffersSwappedCompletedForGPU( | 170 AcceleratedSurfaceBuffersSwappedCompletedForGPU( |
171 host_id, route_id, alive, timebase, interval); | 171 host_id, route_id, alive, timebase, interval); |
172 AcceleratedSurfaceBuffersSwappedCompletedForRenderer( | 172 AcceleratedSurfaceBuffersSwappedCompletedForRenderer( |
173 surface_id, timebase, interval, latency_info); | 173 surface_id, timebase, interval, latency_info); |
174 } | 174 } |
175 | 175 |
176 // NOTE: changes to this class need to be reviewed by the security team. | 176 // NOTE: changes to this class need to be reviewed by the security team. |
177 class GpuSandboxedProcessLauncherDelegate | 177 class GpuSandboxedProcessLauncherDelegate |
178 : public SandboxedProcessLauncherDelegate { | 178 : public SandboxedProcessLauncherDelegate { |
179 public: | 179 public: |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 #endif // OS_MACOSX | 924 #endif // OS_MACOSX |
925 | 925 |
926 #if defined(OS_WIN) | 926 #if defined(OS_WIN) |
927 void GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped( | 927 void GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped( |
928 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params) { | 928 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params) { |
929 TRACE_EVENT0("gpu", "GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped"); | 929 TRACE_EVENT0("gpu", "GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped"); |
930 | 930 |
931 base::ScopedClosureRunner scoped_completion_runner( | 931 base::ScopedClosureRunner scoped_completion_runner( |
932 base::Bind(&AcceleratedSurfaceBuffersSwappedCompleted, | 932 base::Bind(&AcceleratedSurfaceBuffersSwappedCompleted, |
933 host_id_, params.route_id, params.surface_id, | 933 host_id_, params.route_id, params.surface_id, |
934 true, base::TimeTicks(), base::TimeDelta(), ui::LatencyInfo())); | 934 true, base::TimeTicks(), base::TimeDelta(), |
| 935 std::vector<ui::LatencyInfo>())); |
935 | 936 |
936 gfx::GLSurfaceHandle handle = | 937 gfx::GLSurfaceHandle handle = |
937 GpuSurfaceTracker::Get()->GetSurfaceHandle(params.surface_id); | 938 GpuSurfaceTracker::Get()->GetSurfaceHandle(params.surface_id); |
938 | 939 |
939 if (handle.is_null()) | 940 if (handle.is_null()) |
940 return; | 941 return; |
941 | 942 |
942 if (handle.transport_type == gfx::TEXTURE_TRANSPORT) { | 943 if (handle.transport_type == gfx::TEXTURE_TRANSPORT) { |
943 TRACE_EVENT1("gpu", "SurfaceIDNotFound_RoutingToUI", | 944 TRACE_EVENT1("gpu", "SurfaceIDNotFound_RoutingToUI", |
944 "surface_id", params.surface_id); | 945 "surface_id", params.surface_id); |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1257 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1258 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
1258 ClientIdToShaderCacheMap::iterator iter = | 1259 ClientIdToShaderCacheMap::iterator iter = |
1259 client_id_to_shader_cache_.find(client_id); | 1260 client_id_to_shader_cache_.find(client_id); |
1260 // If the cache doesn't exist then this is an off the record profile. | 1261 // If the cache doesn't exist then this is an off the record profile. |
1261 if (iter == client_id_to_shader_cache_.end()) | 1262 if (iter == client_id_to_shader_cache_.end()) |
1262 return; | 1263 return; |
1263 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1264 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
1264 } | 1265 } |
1265 | 1266 |
1266 } // namespace content | 1267 } // namespace content |
OLD | NEW |