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

Side by Side Diff: content/browser/renderer_host/compositor_impl_android.h

Issue 1921533008: Add support for OutputSurface for Vulkan on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use vulkan flag + other review comments. Created 4 years, 7 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 (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 #ifndef CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 16 matching lines...) Expand all
27 27
28 class SkBitmap; 28 class SkBitmap;
29 struct ANativeWindow; 29 struct ANativeWindow;
30 30
31 namespace cc { 31 namespace cc {
32 class Layer; 32 class Layer;
33 class LayerTreeHost; 33 class LayerTreeHost;
34 class OnscreenDisplayClient; 34 class OnscreenDisplayClient;
35 class SurfaceIdAllocator; 35 class SurfaceIdAllocator;
36 class SurfaceManager; 36 class SurfaceManager;
37 class VulkanInProcessContextProvider;
37 } 38 }
38 39
39 namespace content { 40 namespace content {
40 class CompositorClient; 41 class CompositorClient;
41 42
42 // ----------------------------------------------------------------------------- 43 // -----------------------------------------------------------------------------
43 // Browser-side compositor that manages a tree of content and UI layers. 44 // Browser-side compositor that manages a tree of content and UI layers.
44 // ----------------------------------------------------------------------------- 45 // -----------------------------------------------------------------------------
45 class CONTENT_EXPORT CompositorImpl 46 class CONTENT_EXPORT CompositorImpl
46 : public Compositor, 47 : public Compositor,
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 void OnVSync(base::TimeTicks frame_time, 116 void OnVSync(base::TimeTicks frame_time,
116 base::TimeDelta vsync_period) override; 117 base::TimeDelta vsync_period) override;
117 void SetNeedsAnimate() override; 118 void SetNeedsAnimate() override;
118 void SetVisible(bool visible); 119 void SetVisible(bool visible);
119 void CreateOutputSurface(); 120 void CreateOutputSurface();
120 void CreateLayerTreeHost(); 121 void CreateLayerTreeHost();
121 122
122 void OnGpuChannelEstablished(); 123 void OnGpuChannelEstablished();
123 void OnGpuChannelTimeout(); 124 void OnGpuChannelTimeout();
124 125
126 scoped_refptr<cc::VulkanInProcessContextProvider>
127 SharedVulkanContextProviderAndroid();
128
125 // root_layer_ is the persistent internal root layer, while subroot_layer_ 129 // root_layer_ is the persistent internal root layer, while subroot_layer_
126 // is the one attached by the compositor client. 130 // is the one attached by the compositor client.
127 scoped_refptr<cc::Layer> root_layer_; 131 scoped_refptr<cc::Layer> root_layer_;
128 scoped_refptr<cc::Layer> subroot_layer_; 132 scoped_refptr<cc::Layer> subroot_layer_;
129 133
130 // Destruction order matters here: 134 // Destruction order matters here:
131 std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; 135 std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_;
132 base::ObserverList<VSyncObserver, true> observer_list_; 136 base::ObserverList<VSyncObserver, true> observer_list_;
133 std::unique_ptr<cc::LayerTreeHost> host_; 137 std::unique_ptr<cc::LayerTreeHost> host_;
134 ui::ResourceManagerImpl resource_manager_; 138 ui::ResourceManagerImpl resource_manager_;
(...skipping 23 matching lines...) Expand all
158 base::OneShotTimer establish_gpu_channel_timeout_; 162 base::OneShotTimer establish_gpu_channel_timeout_;
159 163
160 // Whether there is an OutputSurface request pending from the current 164 // Whether there is an OutputSurface request pending from the current
161 // |host_|. Becomes |true| if RequestNewOutputSurface is called, and |false| 165 // |host_|. Becomes |true| if RequestNewOutputSurface is called, and |false|
162 // if |host_| is deleted or we succeed in creating *and* initializing an 166 // if |host_| is deleted or we succeed in creating *and* initializing an
163 // OutputSurface (which is essentially the contract with cc). 167 // OutputSurface (which is essentially the contract with cc).
164 bool output_surface_request_pending_; 168 bool output_surface_request_pending_;
165 169
166 gpu::Capabilities gpu_capabilities_; 170 gpu::Capabilities gpu_capabilities_;
167 bool needs_begin_frames_; 171 bool needs_begin_frames_;
172
173 scoped_refptr<cc::VulkanInProcessContextProvider>
174 shared_vulkan_context_provider_android_;
175
168 base::WeakPtrFactory<CompositorImpl> weak_factory_; 176 base::WeakPtrFactory<CompositorImpl> weak_factory_;
169 177
170 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); 178 DISALLOW_COPY_AND_ASSIGN(CompositorImpl);
171 }; 179 };
172 180
173 } // namespace content 181 } // namespace content
174 182
175 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ 183 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698