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

Side by Side Diff: gpu/command_buffer/service/mailbox_manager.cc

Issue 1716813002: Use GpuPreferences to avoid directly accessing switches in gpu related code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 4 years, 9 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "gpu/command_buffer/service/mailbox_manager.h" 5 #include "gpu/command_buffer/service/mailbox_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "gpu/command_buffer/service/gpu_switches.h" 8 #include "gpu/command_buffer/service/gpu_preferences.h"
9 #include "gpu/command_buffer/service/mailbox_manager_impl.h" 9 #include "gpu/command_buffer/service/mailbox_manager_impl.h"
10 #include "gpu/command_buffer/service/mailbox_manager_sync.h" 10 #include "gpu/command_buffer/service/mailbox_manager_sync.h"
11 11
12 namespace gpu { 12 namespace gpu {
13 namespace gles2 { 13 namespace gles2 {
14 14
15 // static 15 // static
16 scoped_refptr<MailboxManager> MailboxManager::Create() { 16 scoped_refptr<MailboxManager> MailboxManager::Create(
17 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 17 const GpuPreferences& gpu_preferences) {
18 switches::kEnableThreadedTextureMailboxes)) { 18 if (gpu_preferences.enable_threaded_texture_mailboxes)
19 return scoped_refptr<MailboxManager>(new MailboxManagerSync); 19 return scoped_refptr<MailboxManager>(new MailboxManagerSync);
20 } 20 return scoped_refptr<MailboxManager>(new MailboxManagerImpl);
21 return scoped_refptr<MailboxManager>(new MailboxManagerImpl);
22 } 21 }
23 22
24 } // namespage gles2 23 } // namespage gles2
25 } // namespace gpu 24 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/mailbox_manager.h ('k') | gpu/command_buffer/service/memory_program_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698