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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 const GpuHostMsg_AcceleratedSurfaceNew_Params& params) { | 305 const GpuHostMsg_AcceleratedSurfaceNew_Params& params) { |
306 RenderWidgetHostViewPort* view = GetRenderWidgetHostViewFromSurfaceID( | 306 RenderWidgetHostViewPort* view = GetRenderWidgetHostViewFromSurfaceID( |
307 params.surface_id); | 307 params.surface_id); |
308 if (!view) | 308 if (!view) |
309 return; | 309 return; |
310 | 310 |
311 if (params.mailbox_name.length() && | 311 if (params.mailbox_name.length() && |
312 params.mailbox_name.length() != GL_MAILBOX_SIZE_CHROMIUM) | 312 params.mailbox_name.length() != GL_MAILBOX_SIZE_CHROMIUM) |
313 return; | 313 return; |
314 | 314 |
315 view->AcceleratedSurfaceNew( | 315 view->AcceleratedSurfaceNew(params.surface_handle, params.mailbox_name); |
316 params.width, params.height, params.surface_handle, | |
317 params.mailbox_name); | |
318 } | 316 } |
319 | 317 |
320 static base::TimeDelta GetSwapDelay() { | 318 static base::TimeDelta GetSwapDelay() { |
321 CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 319 CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
322 int delay = 0; | 320 int delay = 0; |
323 if (cmd_line->HasSwitch(switches::kGpuSwapDelay)) { | 321 if (cmd_line->HasSwitch(switches::kGpuSwapDelay)) { |
324 base::StringToInt(cmd_line->GetSwitchValueNative( | 322 base::StringToInt(cmd_line->GetSwitchValueNative( |
325 switches::kGpuSwapDelay).c_str(), &delay); | 323 switches::kGpuSwapDelay).c_str(), &delay); |
326 } | 324 } |
327 return base::TimeDelta::FromMilliseconds(delay); | 325 return base::TimeDelta::FromMilliseconds(delay); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 view->AcceleratedSurfaceRelease(); | 394 view->AcceleratedSurfaceRelease(); |
397 } | 395 } |
398 | 396 |
399 void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived( | 397 void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived( |
400 const GPUVideoMemoryUsageStats& video_memory_usage_stats) { | 398 const GPUVideoMemoryUsageStats& video_memory_usage_stats) { |
401 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats( | 399 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats( |
402 video_memory_usage_stats); | 400 video_memory_usage_stats); |
403 } | 401 } |
404 | 402 |
405 } // namespace content | 403 } // namespace content |
OLD | NEW |