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

Side by Side Diff: content/browser/renderer_host/image_transport_factory.cc

Issue 12212100: Provide shared context to Platform API in renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebaseforreals Created 7 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 | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « content/browser/renderer_host/compositor_impl_android.cc ('k') | content/common/gpu/client/context_provider_command_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698