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_ui_shim.h" | 5 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 OnSurfaceDisplayedCallback(params.surface_id); | 301 OnSurfaceDisplayedCallback(params.surface_id); |
302 } else { | 302 } else { |
303 gfx::AcceleratedWidget native_widget = | 303 gfx::AcceleratedWidget native_widget = |
304 content::GpuSurfaceTracker::Get()->AcquireNativeWidget( | 304 content::GpuSurfaceTracker::Get()->AcquireNativeWidget( |
305 params.surface_id); | 305 params.surface_id); |
306 ui::AcceleratedWidgetMacGotAcceleratedFrame( | 306 ui::AcceleratedWidgetMacGotAcceleratedFrame( |
307 native_widget, params.surface_handle, params.latency_info, params.size, | 307 native_widget, params.surface_handle, params.latency_info, params.size, |
308 params.scale_factor, | 308 params.scale_factor, |
309 params.damage_rect, | 309 params.damage_rect, |
310 base::Bind(&OnSurfaceDisplayedCallback, params.surface_id), | 310 base::Bind(&OnSurfaceDisplayedCallback, params.surface_id), |
311 &ack_params.disable_throttling, &ack_params.renderer_id, | 311 &ack_params.disable_throttling, &ack_params.renderer_id); |
312 &ack_params.display_id_for_vsync); | |
313 } | 312 } |
314 Send(new AcceleratedSurfaceMsg_BufferPresented(params.route_id, ack_params)); | 313 Send(new AcceleratedSurfaceMsg_BufferPresented(params.route_id, ack_params)); |
315 } | 314 } |
316 #endif | 315 #endif |
317 | 316 |
318 void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived( | 317 void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived( |
319 const GPUVideoMemoryUsageStats& video_memory_usage_stats) { | 318 const GPUVideoMemoryUsageStats& video_memory_usage_stats) { |
320 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats( | 319 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats( |
321 video_memory_usage_stats); | 320 video_memory_usage_stats); |
322 } | 321 } |
323 | 322 |
324 void GpuProcessHostUIShim::OnAddSubscription( | 323 void GpuProcessHostUIShim::OnAddSubscription( |
325 int32 process_id, unsigned int target) { | 324 int32 process_id, unsigned int target) { |
326 RenderProcessHost* rph = RenderProcessHost::FromID(process_id); | 325 RenderProcessHost* rph = RenderProcessHost::FromID(process_id); |
327 if (rph) { | 326 if (rph) { |
328 rph->OnAddSubscription(target); | 327 rph->OnAddSubscription(target); |
329 } | 328 } |
330 } | 329 } |
331 | 330 |
332 void GpuProcessHostUIShim::OnRemoveSubscription( | 331 void GpuProcessHostUIShim::OnRemoveSubscription( |
333 int32 process_id, unsigned int target) { | 332 int32 process_id, unsigned int target) { |
334 RenderProcessHost* rph = RenderProcessHost::FromID(process_id); | 333 RenderProcessHost* rph = RenderProcessHost::FromID(process_id); |
335 if (rph) { | 334 if (rph) { |
336 rph->OnRemoveSubscription(target); | 335 rph->OnRemoveSubscription(target); |
337 } | 336 } |
338 } | 337 } |
339 | 338 |
340 } // namespace content | 339 } // namespace content |
OLD | NEW |