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

Side by Side Diff: content/browser/compositor/gpu_process_transport_factory.h

Issue 648413004: Make browser GPU channel creation async. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | content/browser/compositor/gpu_process_transport_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ 5 #ifndef CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_
6 #define CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ 6 #define CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/id_map.h" 10 #include "base/id_map.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "base/observer_list.h" 14 #include "base/observer_list.h"
15 #include "content/browser/compositor/image_transport_factory.h" 15 #include "content/browser/compositor/image_transport_factory.h"
16 #include "content/common/gpu/client/gpu_channel_host.h"
16 #include "ui/compositor/compositor.h" 17 #include "ui/compositor/compositor.h"
17 18
18 namespace base { 19 namespace base {
19 class Thread; 20 class Thread;
20 } 21 }
21 22
22 namespace cc { 23 namespace cc {
23 class SurfaceManager; 24 class SurfaceManager;
24 } 25 }
25 26
(...skipping 10 matching lines...) Expand all
36 public ImageTransportFactory { 37 public ImageTransportFactory {
37 public: 38 public:
38 GpuProcessTransportFactory(); 39 GpuProcessTransportFactory();
39 40
40 ~GpuProcessTransportFactory() override; 41 ~GpuProcessTransportFactory() override;
41 42
42 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> 43 scoped_ptr<WebGraphicsContext3DCommandBufferImpl>
43 CreateOffscreenCommandBufferContext(); 44 CreateOffscreenCommandBufferContext();
44 45
45 // ui::ContextFactory implementation. 46 // ui::ContextFactory implementation.
46 scoped_ptr<cc::OutputSurface> CreateOutputSurface( 47 void CreateOutputSurface(base::WeakPtr<ui::Compositor> compositor,
47 ui::Compositor* compositor, 48 bool software_fallback) override;
48 bool software_fallback) override;
49 scoped_refptr<ui::Reflector> CreateReflector(ui::Compositor* source, 49 scoped_refptr<ui::Reflector> CreateReflector(ui::Compositor* source,
50 ui::Layer* target) override; 50 ui::Layer* target) override;
51 void RemoveReflector(scoped_refptr<ui::Reflector> reflector) override; 51 void RemoveReflector(scoped_refptr<ui::Reflector> reflector) override;
52 void RemoveCompositor(ui::Compositor* compositor) override; 52 void RemoveCompositor(ui::Compositor* compositor) override;
53 scoped_refptr<cc::ContextProvider> SharedMainThreadContextProvider() override; 53 scoped_refptr<cc::ContextProvider> SharedMainThreadContextProvider() override;
54 bool DoesCreateTestContexts() override; 54 bool DoesCreateTestContexts() override;
55 cc::SharedBitmapManager* GetSharedBitmapManager() override; 55 cc::SharedBitmapManager* GetSharedBitmapManager() override;
56 cc::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; 56 cc::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override;
57 base::MessageLoopProxy* GetCompositorMessageLoop() override; 57 base::MessageLoopProxy* GetCompositorMessageLoop() override;
58 scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() override; 58 scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() override;
59 59
60 // ImageTransportFactory implementation. 60 // ImageTransportFactory implementation.
61 ui::ContextFactory* GetContextFactory() override; 61 ui::ContextFactory* GetContextFactory() override;
62 gfx::GLSurfaceHandle GetSharedSurfaceHandle() override; 62 gfx::GLSurfaceHandle GetSharedSurfaceHandle() override;
63 cc::SurfaceManager* GetSurfaceManager() override; 63 cc::SurfaceManager* GetSurfaceManager() override;
64 GLHelper* GetGLHelper() override; 64 GLHelper* GetGLHelper() override;
65 void AddObserver(ImageTransportFactoryObserver* observer) override; 65 void AddObserver(ImageTransportFactoryObserver* observer) override;
66 void RemoveObserver(ImageTransportFactoryObserver* observer) override; 66 void RemoveObserver(ImageTransportFactoryObserver* observer) override;
67 #if defined(OS_MACOSX) 67 #if defined(OS_MACOSX)
68 void OnSurfaceDisplayed(int surface_id) override; 68 void OnSurfaceDisplayed(int surface_id) override;
69 #endif 69 #endif
70 70
71 private: 71 private:
72 struct PerCompositorData; 72 struct PerCompositorData;
73 73
74 PerCompositorData* CreatePerCompositorData(ui::Compositor* compositor); 74 PerCompositorData* CreatePerCompositorData(ui::Compositor* compositor);
75 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> 75 void EstablishedGpuChannel(base::WeakPtr<ui::Compositor> compositor,
76 CreateContextCommon(int surface_id); 76 bool create_software_renderer);
77 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateContextCommon(
78 scoped_refptr<GpuChannelHost> gpu_channel_host,
79 int surface_id);
77 80
78 void OnLostMainThreadSharedContextInsideCallback(); 81 void OnLostMainThreadSharedContextInsideCallback();
79 void OnLostMainThreadSharedContext(); 82 void OnLostMainThreadSharedContext();
80 83
81 typedef std::map<ui::Compositor*, PerCompositorData*> PerCompositorDataMap; 84 typedef std::map<ui::Compositor*, PerCompositorData*> PerCompositorDataMap;
82 scoped_ptr<base::Thread> compositor_thread_; 85 scoped_ptr<base::Thread> compositor_thread_;
83 PerCompositorDataMap per_compositor_data_; 86 PerCompositorDataMap per_compositor_data_;
84 scoped_refptr<ContextProviderCommandBuffer> shared_main_thread_contexts_; 87 scoped_refptr<ContextProviderCommandBuffer> shared_main_thread_contexts_;
85 scoped_ptr<GLHelper> gl_helper_; 88 scoped_ptr<GLHelper> gl_helper_;
86 ObserverList<ImageTransportFactoryObserver> observer_list_; 89 ObserverList<ImageTransportFactoryObserver> observer_list_;
87 scoped_ptr<cc::SurfaceManager> surface_manager_; 90 scoped_ptr<cc::SurfaceManager> surface_manager_;
88 uint32_t next_surface_id_namespace_; 91 uint32_t next_surface_id_namespace_;
89 92
90 // The contents of this map and its methods may only be used on the compositor 93 // The contents of this map and its methods may only be used on the compositor
91 // thread. 94 // thread.
92 IDMap<BrowserCompositorOutputSurface> output_surface_map_; 95 IDMap<BrowserCompositorOutputSurface> output_surface_map_;
93 96
94 scoped_refptr<BrowserCompositorOutputSurfaceProxy> output_surface_proxy_; 97 scoped_refptr<BrowserCompositorOutputSurfaceProxy> output_surface_proxy_;
95 98
96 base::WeakPtrFactory<GpuProcessTransportFactory> callback_factory_; 99 base::WeakPtrFactory<GpuProcessTransportFactory> callback_factory_;
97 100
98 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory); 101 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory);
99 }; 102 };
100 103
101 } // namespace content 104 } // namespace content
102 105
103 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ 106 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/compositor/gpu_process_transport_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698