OLD | NEW |
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 17 matching lines...) Expand all Loading... |
28 #include "ui/android/resources/ui_resource_provider.h" | 28 #include "ui/android/resources/ui_resource_provider.h" |
29 #include "ui/android/window_android_compositor.h" | 29 #include "ui/android/window_android_compositor.h" |
30 | 30 |
31 class SkBitmap; | 31 class SkBitmap; |
32 struct ANativeWindow; | 32 struct ANativeWindow; |
33 | 33 |
34 namespace cc { | 34 namespace cc { |
35 class Display; | 35 class Display; |
36 class Layer; | 36 class Layer; |
37 class LayerTreeHost; | 37 class LayerTreeHost; |
| 38 class OutputSurface; |
38 class SurfaceIdAllocator; | 39 class SurfaceIdAllocator; |
39 class SurfaceManager; | 40 class SurfaceManager; |
40 class VulkanContextProvider; | 41 class VulkanContextProvider; |
41 class VulkanInProcessContextProvider; | 42 class VulkanInProcessContextProvider; |
42 } | 43 } |
43 | 44 |
44 namespace content { | 45 namespace content { |
45 class CompositorClient; | 46 class CompositorClient; |
46 | 47 |
47 // ----------------------------------------------------------------------------- | 48 // ----------------------------------------------------------------------------- |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 void WillBeginMainFrame() override {} | 92 void WillBeginMainFrame() override {} |
92 void DidBeginMainFrame() override {} | 93 void DidBeginMainFrame() override {} |
93 void BeginMainFrame(const cc::BeginFrameArgs& args) override {} | 94 void BeginMainFrame(const cc::BeginFrameArgs& args) override {} |
94 void BeginMainFrameNotExpectedSoon() override {} | 95 void BeginMainFrameNotExpectedSoon() override {} |
95 void UpdateLayerTreeHost() override; | 96 void UpdateLayerTreeHost() override; |
96 void ApplyViewportDeltas(const gfx::Vector2dF& inner_delta, | 97 void ApplyViewportDeltas(const gfx::Vector2dF& inner_delta, |
97 const gfx::Vector2dF& outer_delta, | 98 const gfx::Vector2dF& outer_delta, |
98 const gfx::Vector2dF& elastic_overscroll_delta, | 99 const gfx::Vector2dF& elastic_overscroll_delta, |
99 float page_scale, | 100 float page_scale, |
100 float top_controls_delta) override {} | 101 float top_controls_delta) override {} |
101 void RequestNewOutputSurface() override; | 102 void RequestNewCompositorFrameSink() override; |
102 void DidInitializeOutputSurface() override; | 103 void DidInitializeCompositorFrameSink() override; |
103 void DidFailToInitializeOutputSurface() override; | 104 void DidFailToInitializeCompositorFrameSink() override; |
104 void WillCommit() override {} | 105 void WillCommit() override {} |
105 void DidCommit() override; | 106 void DidCommit() override; |
106 void DidCommitAndDrawFrame() override {} | 107 void DidCommitAndDrawFrame() override {} |
107 void DidCompleteSwapBuffers() override; | 108 void DidCompleteSwapBuffers() override; |
108 void DidCompletePageScaleAnimation() override {} | 109 void DidCompletePageScaleAnimation() override {} |
109 | 110 |
110 // LayerTreeHostSingleThreadClient implementation. | 111 // LayerTreeHostSingleThreadClient implementation. |
111 void DidPostSwapBuffers() override; | 112 void DidPostSwapBuffers() override; |
112 void DidAbortSwapBuffers() override; | 113 void DidAbortSwapBuffers() override; |
113 | 114 |
114 // WindowAndroidCompositor implementation. | 115 // WindowAndroidCompositor implementation. |
115 void AttachLayerForReadback(scoped_refptr<cc::Layer> layer) override; | 116 void AttachLayerForReadback(scoped_refptr<cc::Layer> layer) override; |
116 void RequestCopyOfOutputOnRootLayer( | 117 void RequestCopyOfOutputOnRootLayer( |
117 std::unique_ptr<cc::CopyOutputRequest> request) override; | 118 std::unique_ptr<cc::CopyOutputRequest> request) override; |
118 void OnVSync(base::TimeTicks frame_time, | 119 void OnVSync(base::TimeTicks frame_time, |
119 base::TimeDelta vsync_period) override; | 120 base::TimeDelta vsync_period) override; |
120 void SetNeedsAnimate() override; | 121 void SetNeedsAnimate() override; |
121 void SetVisible(bool visible); | 122 void SetVisible(bool visible); |
122 void CreateLayerTreeHost(); | 123 void CreateLayerTreeHost(); |
123 | 124 |
124 void HandlePendingOutputSurfaceRequest(); | 125 void HandlePendingCompositorFrameSinkRequest(); |
125 | 126 |
126 #if defined(ENABLE_VULKAN) | 127 #if defined(ENABLE_VULKAN) |
127 void CreateVulkanOutputSurface(); | 128 void CreateVulkanOutputSurface(); |
128 #endif | 129 #endif |
129 void OnGpuChannelEstablished( | 130 void OnGpuChannelEstablished( |
130 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, | 131 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, |
131 ui::ContextProviderFactory::GpuChannelHostResult result); | 132 ui::ContextProviderFactory::GpuChannelHostResult result); |
132 void InitializeDisplay( | 133 void InitializeDisplay( |
133 std::unique_ptr<cc::OutputSurface> display_output_surface, | 134 std::unique_ptr<cc::OutputSurface> display_output_surface, |
134 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider, | 135 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider, |
(...skipping 29 matching lines...) Expand all Loading... |
164 | 165 |
165 // Whether we need to update animations on the next composite. | 166 // Whether we need to update animations on the next composite. |
166 bool needs_animate_; | 167 bool needs_animate_; |
167 | 168 |
168 // The number of SwapBuffer calls that have not returned and ACK'd from | 169 // The number of SwapBuffer calls that have not returned and ACK'd from |
169 // the GPU thread. | 170 // the GPU thread. |
170 unsigned int pending_swapbuffers_; | 171 unsigned int pending_swapbuffers_; |
171 | 172 |
172 size_t num_successive_context_creation_failures_; | 173 size_t num_successive_context_creation_failures_; |
173 | 174 |
174 // Whether there is an OutputSurface request pending from the current | 175 // Whether there is an CompositorFrameSink request pending from the current |
175 // |host_|. Becomes |true| if RequestNewOutputSurface is called, and |false| | 176 // |host_|. Becomes |true| if RequestNewCompositorFrameSink is called, and |
176 // if |host_| is deleted or we succeed in creating *and* initializing an | 177 // |false| if |host_| is deleted or we succeed in creating *and* initializing |
177 // OutputSurface (which is essentially the contract with cc). | 178 // a CompositorFrameSink (which is essentially the contract with cc). |
178 bool output_surface_request_pending_; | 179 bool compositor_frame_sink_request_pending_; |
179 | 180 |
180 gpu::Capabilities gpu_capabilities_; | 181 gpu::Capabilities gpu_capabilities_; |
181 bool needs_begin_frames_; | 182 bool needs_begin_frames_; |
182 base::WeakPtrFactory<CompositorImpl> weak_factory_; | 183 base::WeakPtrFactory<CompositorImpl> weak_factory_; |
183 | 184 |
184 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); | 185 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); |
185 }; | 186 }; |
186 | 187 |
187 } // namespace content | 188 } // namespace content |
188 | 189 |
189 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ | 190 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ |
OLD | NEW |