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 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1041 }; | 1041 }; |
1042 | 1042 |
1043 } // anonymous namespace | 1043 } // anonymous namespace |
1044 | 1044 |
1045 // static | 1045 // static |
1046 void ImageTransportFactory::Initialize() { | 1046 void ImageTransportFactory::Initialize() { |
1047 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 1047 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
1048 if (command_line->HasSwitch(switches::kTestCompositor)) { | 1048 if (command_line->HasSwitch(switches::kTestCompositor)) { |
1049 ui::SetupTestCompositor(); | 1049 ui::SetupTestCompositor(); |
1050 } | 1050 } |
| 1051 |
| 1052 #if defined(USE_WAYLAND) |
| 1053 g_factory = new NoTransportFactory(NULL); |
| 1054 #else |
1051 if (ui::IsTestCompositorEnabled()) { | 1055 if (ui::IsTestCompositorEnabled()) { |
1052 g_factory = new NoTransportFactory(new ui::TestContextFactory); | 1056 g_factory = new NoTransportFactory(new ui::TestContextFactory); |
1053 } else if (command_line->HasSwitch(switches::kUIEnableSoftwareCompositing)) { | 1057 } else if (command_line->HasSwitch(switches::kUIEnableSoftwareCompositing)) { |
1054 g_factory = new NoTransportFactory(new SoftwareContextFactory); | 1058 g_factory = new NoTransportFactory(new SoftwareContextFactory); |
1055 } else { | 1059 } else { |
1056 g_factory = new GpuProcessTransportFactory; | 1060 g_factory = new GpuProcessTransportFactory; |
1057 } | 1061 } |
1058 ui::ContextFactory::SetInstance(g_factory->AsContextFactory()); | 1062 ui::ContextFactory::SetInstance(g_factory->AsContextFactory()); |
| 1063 #endif |
1059 } | 1064 } |
1060 | 1065 |
1061 // static | 1066 // static |
1062 void ImageTransportFactory::Terminate() { | 1067 void ImageTransportFactory::Terminate() { |
1063 ui::ContextFactory::SetInstance(NULL); | 1068 ui::ContextFactory::SetInstance(NULL); |
1064 delete g_factory; | 1069 delete g_factory; |
1065 g_factory = NULL; | 1070 g_factory = NULL; |
1066 } | 1071 } |
1067 | 1072 |
1068 // static | 1073 // static |
1069 ImageTransportFactory* ImageTransportFactory::GetInstance() { | 1074 ImageTransportFactory* ImageTransportFactory::GetInstance() { |
1070 return g_factory; | 1075 return g_factory; |
1071 } | 1076 } |
1072 | 1077 |
1073 } // namespace content | 1078 } // namespace content |
OLD | NEW |