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

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

Issue 1892303003: Added the Vulkan Context Provider implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 12 matching lines...) Expand all
23 23
24 namespace base { 24 namespace base {
25 class SimpleThread; 25 class SimpleThread;
26 class Thread; 26 class Thread;
27 } 27 }
28 28
29 namespace cc { 29 namespace cc {
30 class SingleThreadTaskGraphRunner; 30 class SingleThreadTaskGraphRunner;
31 class SoftwareOutputDevice; 31 class SoftwareOutputDevice;
32 class SurfaceManager; 32 class SurfaceManager;
33 class VulkanInProcessContextProvider;
33 } 34 }
34 35
35 namespace content { 36 namespace content {
36 class BrowserCompositorOutputSurface; 37 class BrowserCompositorOutputSurface;
37 class CompositorSwapClient; 38 class CompositorSwapClient;
38 class ContextProviderCommandBuffer; 39 class ContextProviderCommandBuffer;
39 class OutputDeviceBacking; 40 class OutputDeviceBacking;
40 class ReflectorImpl; 41 class ReflectorImpl;
41 class WebGraphicsContext3DCommandBufferImpl; 42 class WebGraphicsContext3DCommandBufferImpl;
42 43
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 void EstablishedGpuChannel(base::WeakPtr<ui::Compositor> compositor, 95 void EstablishedGpuChannel(base::WeakPtr<ui::Compositor> compositor,
95 bool create_gpu_output_surface, 96 bool create_gpu_output_surface,
96 int num_attempts); 97 int num_attempts);
97 std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> CreateContextCommon( 98 std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> CreateContextCommon(
98 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, 99 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
99 gpu::SurfaceHandle surface_handle); 100 gpu::SurfaceHandle surface_handle);
100 101
101 void OnLostMainThreadSharedContextInsideCallback(); 102 void OnLostMainThreadSharedContextInsideCallback();
102 void OnLostMainThreadSharedContext(); 103 void OnLostMainThreadSharedContext();
103 104
105 #if defined(ENABLE_VULKAN)
piman 2016/04/19 01:36:42 Trying to find a way to limit the amount of #ifdef
David Yen 2016/04/19 22:20:28 Done. The only thing is we still have to #ifdef ou
piman 2016/04/19 23:29:57 Yeah, I think I agree. I'm thinking that eventuall
106 scoped_refptr<cc::VulkanInProcessContextProvider>
107 SharedVulkanContextProvider();
108 #endif
109
104 typedef std::map<ui::Compositor*, PerCompositorData*> PerCompositorDataMap; 110 typedef std::map<ui::Compositor*, PerCompositorData*> PerCompositorDataMap;
105 PerCompositorDataMap per_compositor_data_; 111 PerCompositorDataMap per_compositor_data_;
106 scoped_refptr<ContextProviderCommandBuffer> shared_main_thread_contexts_; 112 scoped_refptr<ContextProviderCommandBuffer> shared_main_thread_contexts_;
107 std::unique_ptr<GLHelper> gl_helper_; 113 std::unique_ptr<GLHelper> gl_helper_;
108 base::ObserverList<ImageTransportFactoryObserver> observer_list_; 114 base::ObserverList<ImageTransportFactoryObserver> observer_list_;
109 std::unique_ptr<cc::SurfaceManager> surface_manager_; 115 std::unique_ptr<cc::SurfaceManager> surface_manager_;
110 uint32_t next_surface_id_namespace_; 116 uint32_t next_surface_id_namespace_;
111 std::unique_ptr<cc::SingleThreadTaskGraphRunner> task_graph_runner_; 117 std::unique_ptr<cc::SingleThreadTaskGraphRunner> task_graph_runner_;
112 scoped_refptr<ContextProviderCommandBuffer> shared_worker_context_provider_; 118 scoped_refptr<ContextProviderCommandBuffer> shared_worker_context_provider_;
113 119
120 #if defined(ENABLE_VULKAN)
121 bool shared_vulkan_context_provider_initialized_ = false;
122 scoped_refptr<cc::VulkanInProcessContextProvider>
123 shared_vulkan_context_provider_;
124 #endif
125
114 #if defined(OS_WIN) 126 #if defined(OS_WIN)
115 std::unique_ptr<OutputDeviceBacking> software_backing_; 127 std::unique_ptr<OutputDeviceBacking> software_backing_;
116 #endif 128 #endif
117 129
118 // The contents of this map and its methods may only be used on the compositor 130 // The contents of this map and its methods may only be used on the compositor
119 // thread. 131 // thread.
120 IDMap<BrowserCompositorOutputSurface> output_surface_map_; 132 IDMap<BrowserCompositorOutputSurface> output_surface_map_;
121 133
122 base::WeakPtrFactory<GpuProcessTransportFactory> callback_factory_; 134 base::WeakPtrFactory<GpuProcessTransportFactory> callback_factory_;
123 135
124 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory); 136 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory);
125 }; 137 };
126 138
127 } // namespace content 139 } // namespace content
128 140
129 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ 141 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698