Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 1165823003: Re-land: content: Enable native GpuMemoryBuffers by default on MacOSX. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/browser_main_loop.h" 5 #include "content/browser/browser_main_loop.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 if (parsed_command_line_.HasSwitch(switches::kRendererProcessLimit)) { 470 if (parsed_command_line_.HasSwitch(switches::kRendererProcessLimit)) {
471 std::string limit_string = parsed_command_line_.GetSwitchValueASCII( 471 std::string limit_string = parsed_command_line_.GetSwitchValueASCII(
472 switches::kRendererProcessLimit); 472 switches::kRendererProcessLimit);
473 size_t process_limit; 473 size_t process_limit;
474 if (base::StringToSizeT(limit_string, &process_limit)) { 474 if (base::StringToSizeT(limit_string, &process_limit)) {
475 RenderProcessHost::SetMaxRendererProcessCount(process_limit); 475 RenderProcessHost::SetMaxRendererProcessCount(process_limit);
476 } 476 }
477 } 477 }
478 #endif // !defined(OS_IOS) 478 #endif // !defined(OS_IOS)
479 479
480 if (parsed_command_line_.HasSwitch(switches::kEnableNativeGpuMemoryBuffers)) { 480 #if defined(OS_MACOSX)
481 bool enable_native_gpu_memory_buffers =
482 !parsed_command_line_.HasSwitch(switches::kDisableNativeGpuMemoryBuffers);
483 #else
484 bool enable_native_gpu_memory_buffers =
485 parsed_command_line_.HasSwitch(switches::kEnableNativeGpuMemoryBuffers);
486 #endif
487 if (enable_native_gpu_memory_buffers) {
481 BrowserGpuChannelHostFactory::EnableGpuMemoryBufferFactoryUsage( 488 BrowserGpuChannelHostFactory::EnableGpuMemoryBufferFactoryUsage(
482 gfx::GpuMemoryBuffer::MAP); 489 gfx::GpuMemoryBuffer::MAP);
483 BrowserGpuChannelHostFactory::EnableGpuMemoryBufferFactoryUsage( 490 BrowserGpuChannelHostFactory::EnableGpuMemoryBufferFactoryUsage(
484 gfx::GpuMemoryBuffer::PERSISTENT_MAP); 491 gfx::GpuMemoryBuffer::PERSISTENT_MAP);
485 } 492 }
486 493
487 #if defined(USE_OZONE) 494 #if defined(USE_OZONE)
488 BrowserGpuChannelHostFactory::EnableGpuMemoryBufferFactoryUsage( 495 BrowserGpuChannelHostFactory::EnableGpuMemoryBufferFactoryUsage(
489 gfx::GpuMemoryBuffer::SCANOUT); 496 gfx::GpuMemoryBuffer::SCANOUT);
490 #endif 497 #endif
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 DCHECK(is_tracing_startup_); 1387 DCHECK(is_tracing_startup_);
1381 1388
1382 is_tracing_startup_ = false; 1389 is_tracing_startup_ = false;
1383 TracingController::GetInstance()->DisableRecording( 1390 TracingController::GetInstance()->DisableRecording(
1384 TracingController::CreateFileSink( 1391 TracingController::CreateFileSink(
1385 startup_trace_file_, 1392 startup_trace_file_,
1386 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); 1393 base::Bind(OnStoppedStartupTracing, startup_trace_file_)));
1387 } 1394 }
1388 1395
1389 } // namespace content 1396 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/child/child_thread_impl_browsertest.cc » ('j') | content/public/common/content_switches.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698