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/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 280 |
281 #endif | 281 #endif |
282 | 282 |
283 void GpuProcessHostUIShim::OnAcceleratedSurfaceNew( | 283 void GpuProcessHostUIShim::OnAcceleratedSurfaceNew( |
284 const GpuHostMsg_AcceleratedSurfaceNew_Params& params) { | 284 const GpuHostMsg_AcceleratedSurfaceNew_Params& params) { |
285 RenderWidgetHostViewPort* view = GetRenderWidgetHostViewFromSurfaceID( | 285 RenderWidgetHostViewPort* view = GetRenderWidgetHostViewFromSurfaceID( |
286 params.surface_id); | 286 params.surface_id); |
287 if (!view) | 287 if (!view) |
288 return; | 288 return; |
289 view->AcceleratedSurfaceNew( | 289 view->AcceleratedSurfaceNew( |
290 params.width, params.height, params.surface_handle); | 290 params.width, params.height, params.surface_handle, |
| 291 params.mailbox_name); |
291 } | 292 } |
292 | 293 |
293 static base::TimeDelta GetSwapDelay() { | 294 static base::TimeDelta GetSwapDelay() { |
294 CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 295 CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
295 int delay = 0; | 296 int delay = 0; |
296 if (cmd_line->HasSwitch(switches::kGpuSwapDelay)) { | 297 if (cmd_line->HasSwitch(switches::kGpuSwapDelay)) { |
297 base::StringToInt(cmd_line->GetSwitchValueNative( | 298 base::StringToInt(cmd_line->GetSwitchValueNative( |
298 switches::kGpuSwapDelay).c_str(), &delay); | 299 switches::kGpuSwapDelay).c_str(), &delay); |
299 } | 300 } |
300 return base::TimeDelta::FromMilliseconds(delay); | 301 return base::TimeDelta::FromMilliseconds(delay); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 if (!view) | 364 if (!view) |
364 return; | 365 return; |
365 view->AcceleratedSurfaceRelease(params.identifier); | 366 view->AcceleratedSurfaceRelease(params.identifier); |
366 } | 367 } |
367 | 368 |
368 void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived( | 369 void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived( |
369 const content::GPUVideoMemoryUsageStats& video_memory_usage_stats) { | 370 const content::GPUVideoMemoryUsageStats& video_memory_usage_stats) { |
370 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats( | 371 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats( |
371 video_memory_usage_stats); | 372 video_memory_usage_stats); |
372 } | 373 } |
373 | |
OLD | NEW |