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

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

Issue 2190033002: content: Add ContextProviderFactory to create a render ContextProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 }; 59 };
60 60
61 CompositorImpl(CompositorClient* client, gfx::NativeWindow root_window); 61 CompositorImpl(CompositorClient* client, gfx::NativeWindow root_window);
62 ~CompositorImpl() override; 62 ~CompositorImpl() override;
63 63
64 static bool IsInitialized(); 64 static bool IsInitialized();
65 65
66 static cc::SurfaceManager* GetSurfaceManager(); 66 static cc::SurfaceManager* GetSurfaceManager();
67 static uint32_t AllocateSurfaceClientId(); 67 static uint32_t AllocateSurfaceClientId();
68 68
69 static scoped_refptr<cc::VulkanInProcessContextProvider>
70 SharedVulkanContextProviderAndroid();
71
72 void PopulateGpuCapabilities(gpu::Capabilities gpu_capabilities); 69 void PopulateGpuCapabilities(gpu::Capabilities gpu_capabilities);
73 70
74 void AddObserver(VSyncObserver* observer); 71 void AddObserver(VSyncObserver* observer);
75 void RemoveObserver(VSyncObserver* observer); 72 void RemoveObserver(VSyncObserver* observer);
76 void OnNeedsBeginFramesChange(bool needs_begin_frames); 73 void OnNeedsBeginFramesChange(bool needs_begin_frames);
77 74
78 // ui::ResourceProvider implementation. 75 // ui::ResourceProvider implementation.
79 cc::UIResourceId CreateUIResource(cc::UIResourceClient* client) override; 76 cc::UIResourceId CreateUIResource(cc::UIResourceClient* client) override;
80 void DeleteUIResource(cc::UIResourceId resource_id) override; 77 void DeleteUIResource(cc::UIResourceId resource_id) override;
81 bool SupportsETC1NonPowerOfTwo() const override; 78 bool SupportsETC1NonPowerOfTwo() const override;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 void DidPostSwapBuffers() override; 112 void DidPostSwapBuffers() override;
116 void DidAbortSwapBuffers() override; 113 void DidAbortSwapBuffers() override;
117 114
118 // WindowAndroidCompositor implementation. 115 // WindowAndroidCompositor implementation.
119 void RequestCopyOfOutputOnRootLayer( 116 void RequestCopyOfOutputOnRootLayer(
120 std::unique_ptr<cc::CopyOutputRequest> request) override; 117 std::unique_ptr<cc::CopyOutputRequest> request) override;
121 void OnVSync(base::TimeTicks frame_time, 118 void OnVSync(base::TimeTicks frame_time,
122 base::TimeDelta vsync_period) override; 119 base::TimeDelta vsync_period) override;
123 void SetNeedsAnimate() override; 120 void SetNeedsAnimate() override;
124 void SetVisible(bool visible); 121 void SetVisible(bool visible);
125 void CreateOutputSurface(); 122 void CreateOutputSurface(scoped_refptr<gpu::GpuChannelHost> gpu_channel_host);
126 void CreateLayerTreeHost(); 123 void CreateLayerTreeHost();
127 124
128 void OnGpuChannelEstablished(); 125 void OnGpuChannelEstablished(
129 void OnGpuChannelTimeout(); 126 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host);
130 127
131 // root_layer_ is the persistent internal root layer, while subroot_layer_ 128 // root_layer_ is the persistent internal root layer, while subroot_layer_
132 // is the one attached by the compositor client. 129 // is the one attached by the compositor client.
133 scoped_refptr<cc::Layer> subroot_layer_; 130 scoped_refptr<cc::Layer> subroot_layer_;
134 131
135 // Destruction order matters here: 132 // Destruction order matters here:
136 std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; 133 std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_;
137 base::ObserverList<VSyncObserver, true> observer_list_; 134 base::ObserverList<VSyncObserver, true> observer_list_;
138 std::unique_ptr<cc::LayerTreeHost> host_; 135 std::unique_ptr<cc::LayerTreeHost> host_;
139 ui::ResourceManagerImpl resource_manager_; 136 ui::ResourceManagerImpl resource_manager_;
(...skipping 13 matching lines...) Expand all
153 150
154 // Whether we need to update animations on the next composite. 151 // Whether we need to update animations on the next composite.
155 bool needs_animate_; 152 bool needs_animate_;
156 153
157 // The number of SwapBuffer calls that have not returned and ACK'd from 154 // The number of SwapBuffer calls that have not returned and ACK'd from
158 // the GPU thread. 155 // the GPU thread.
159 unsigned int pending_swapbuffers_; 156 unsigned int pending_swapbuffers_;
160 157
161 size_t num_successive_context_creation_failures_; 158 size_t num_successive_context_creation_failures_;
162 159
163 base::OneShotTimer establish_gpu_channel_timeout_;
164
165 // Whether there is an OutputSurface request pending from the current 160 // Whether there is an OutputSurface request pending from the current
166 // |host_|. Becomes |true| if RequestNewOutputSurface is called, and |false| 161 // |host_|. Becomes |true| if RequestNewOutputSurface is called, and |false|
167 // if |host_| is deleted or we succeed in creating *and* initializing an 162 // if |host_| is deleted or we succeed in creating *and* initializing an
168 // OutputSurface (which is essentially the contract with cc). 163 // OutputSurface (which is essentially the contract with cc).
169 bool output_surface_request_pending_; 164 bool output_surface_request_pending_;
170 165
171 gpu::Capabilities gpu_capabilities_; 166 gpu::Capabilities gpu_capabilities_;
172 bool needs_begin_frames_; 167 bool needs_begin_frames_;
173 base::WeakPtrFactory<CompositorImpl> weak_factory_; 168 base::WeakPtrFactory<CompositorImpl> weak_factory_;
174 169
175 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); 170 DISALLOW_COPY_AND_ASSIGN(CompositorImpl);
176 }; 171 };
177 172
178 } // namespace content 173 } // namespace content
179 174
180 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ 175 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698