| OLD | NEW |
| 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 if (GpuPreferences::GetInstance()->enable_threaded_texture_mailboxes) |
| 18 switches::kEnableThreadedTextureMailboxes)) { | 18 return scoped_refptr<MailboxManager>(new MailboxManagerSync); |
| 19 return scoped_refptr<MailboxManager>(new MailboxManagerSync); | 19 return scoped_refptr<MailboxManager>(new MailboxManagerImpl); |
| 20 } | |
| 21 return scoped_refptr<MailboxManager>(new MailboxManagerImpl); | |
| 22 } | 20 } |
| 23 | 21 |
| 24 } // namespage gles2 | 22 } // namespage gles2 |
| 25 } // namespace gpu | 23 } // namespace gpu |
| OLD | NEW |