| 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/renderer_host/image_transport_factory.h" | 5 #include "content/browser/renderer_host/image_transport_factory.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 } // anonymous namespace | 739 } // anonymous namespace |
| 740 | 740 |
| 741 // static | 741 // static |
| 742 void ImageTransportFactory::Initialize() { | 742 void ImageTransportFactory::Initialize() { |
| 743 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 743 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 744 if (command_line->HasSwitch(switches::kTestCompositor)) { | 744 if (command_line->HasSwitch(switches::kTestCompositor)) { |
| 745 ui::SetupTestCompositor(); | 745 ui::SetupTestCompositor(); |
| 746 } | 746 } |
| 747 if (ui::IsTestCompositorEnabled()) { | 747 if (ui::IsTestCompositorEnabled()) { |
| 748 g_factory = new NoTransportFactory(new ui::TestContextFactory); | 748 g_factory = new NoTransportFactory(new ui::TestContextFactory); |
| 749 } else if (command_line->HasSwitch(switches::kUIEnableSoftwareCompositing)) { | 749 } else if (command_line->HasSwitch(switches::kDisableGpu)) { |
| 750 g_factory = new NoTransportFactory(new SoftwareContextFactory); | 750 g_factory = new NoTransportFactory(new SoftwareContextFactory); |
| 751 } else { | 751 } else { |
| 752 g_factory = new GpuProcessTransportFactory; | 752 g_factory = new GpuProcessTransportFactory; |
| 753 } | 753 } |
| 754 ui::ContextFactory::SetInstance(g_factory->AsContextFactory()); | 754 ui::ContextFactory::SetInstance(g_factory->AsContextFactory()); |
| 755 } | 755 } |
| 756 | 756 |
| 757 // static | 757 // static |
| 758 void ImageTransportFactory::Terminate() { | 758 void ImageTransportFactory::Terminate() { |
| 759 ui::ContextFactory::SetInstance(NULL); | 759 ui::ContextFactory::SetInstance(NULL); |
| 760 delete g_factory; | 760 delete g_factory; |
| 761 g_factory = NULL; | 761 g_factory = NULL; |
| 762 } | 762 } |
| 763 | 763 |
| 764 // static | 764 // static |
| 765 ImageTransportFactory* ImageTransportFactory::GetInstance() { | 765 ImageTransportFactory* ImageTransportFactory::GetInstance() { |
| 766 return g_factory; | 766 return g_factory; |
| 767 } | 767 } |
| 768 | 768 |
| 769 } // namespace content | 769 } // namespace content |
| OLD | NEW |