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 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 } | 670 } |
671 | 671 |
672 } // anonymous namespace | 672 } // anonymous namespace |
673 | 673 |
674 // static | 674 // static |
675 void ImageTransportFactory::Initialize() { | 675 void ImageTransportFactory::Initialize() { |
676 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 676 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
677 if (command_line->HasSwitch(switches::kTestCompositor)) { | 677 if (command_line->HasSwitch(switches::kTestCompositor)) { |
678 ui::SetupTestCompositor(); | 678 ui::SetupTestCompositor(); |
679 } | 679 } |
680 if (ui::IsTestCompositorEnabled()) { | 680 if (ui::IsTestCompositorEnabled()) |
681 g_factory = new DefaultTransportFactory(); | 681 g_factory = new DefaultTransportFactory(); |
682 WebKitPlatformSupportImpl::SetOffscreenContextFactoryForTest( | 682 else |
683 CreateTestContext); | |
684 } else { | |
685 g_factory = new GpuProcessTransportFactory(); | 683 g_factory = new GpuProcessTransportFactory(); |
686 } | |
687 ui::ContextFactory::SetInstance(g_factory->AsContextFactory()); | 684 ui::ContextFactory::SetInstance(g_factory->AsContextFactory()); |
688 } | 685 } |
689 | 686 |
690 // static | 687 // static |
691 void ImageTransportFactory::Terminate() { | 688 void ImageTransportFactory::Terminate() { |
692 ui::ContextFactory::SetInstance(NULL); | 689 ui::ContextFactory::SetInstance(NULL); |
693 delete g_factory; | 690 delete g_factory; |
694 g_factory = NULL; | 691 g_factory = NULL; |
695 } | 692 } |
696 | 693 |
697 // static | 694 // static |
698 ImageTransportFactory* ImageTransportFactory::GetInstance() { | 695 ImageTransportFactory* ImageTransportFactory::GetInstance() { |
699 return g_factory; | 696 return g_factory; |
700 } | 697 } |
701 | 698 |
702 } // namespace content | 699 } // namespace content |
OLD | NEW |