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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/cancelable_callback.h" | 9 #include "base/cancelable_callback.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "cc/trees/layer_tree_host_client.h" | 13 #include "cc/trees/layer_tree_host_client.h" |
14 #include "cc/trees/layer_tree_host_single_thread_client.h" | 14 #include "cc/trees/layer_tree_host_single_thread_client.h" |
15 #include "content/browser/android/ui_resource_provider_impl.h" | 15 #include "content/browser/android/ui_resource_provider_impl.h" |
16 #include "content/browser/renderer_host/image_transport_factory_android.h" | 16 #include "content/browser/renderer_host/image_transport_factory_android.h" |
17 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
| 18 #include "content/common/gpu/client/context_provider_command_buffer.h" |
18 #include "content/public/browser/android/compositor.h" | 19 #include "content/public/browser/android/compositor.h" |
19 #include "third_party/khronos/GLES2/gl2.h" | 20 #include "third_party/khronos/GLES2/gl2.h" |
20 #include "ui/base/android/system_ui_resource_manager.h" | 21 #include "ui/base/android/system_ui_resource_manager.h" |
21 #include "ui/base/android/window_android_compositor.h" | 22 #include "ui/base/android/window_android_compositor.h" |
22 | 23 |
23 class SkBitmap; | 24 class SkBitmap; |
24 struct ANativeWindow; | 25 struct ANativeWindow; |
25 | 26 |
26 namespace cc { | 27 namespace cc { |
27 class Layer; | 28 class Layer; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 69 |
69 // LayerTreeHostClient implementation. | 70 // LayerTreeHostClient implementation. |
70 virtual void WillBeginMainFrame(int frame_id) OVERRIDE {} | 71 virtual void WillBeginMainFrame(int frame_id) OVERRIDE {} |
71 virtual void DidBeginMainFrame() OVERRIDE {} | 72 virtual void DidBeginMainFrame() OVERRIDE {} |
72 virtual void BeginMainFrame(const cc::BeginFrameArgs& args) OVERRIDE {} | 73 virtual void BeginMainFrame(const cc::BeginFrameArgs& args) OVERRIDE {} |
73 virtual void Layout() OVERRIDE; | 74 virtual void Layout() OVERRIDE; |
74 virtual void ApplyScrollAndScale(const gfx::Vector2d& scroll_delta, | 75 virtual void ApplyScrollAndScale(const gfx::Vector2d& scroll_delta, |
75 float page_scale) OVERRIDE {} | 76 float page_scale) OVERRIDE {} |
76 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback) | 77 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback) |
77 OVERRIDE; | 78 OVERRIDE; |
78 virtual void DidInitializeOutputSurface() OVERRIDE {} | 79 virtual void DidInitializeOutputSurface() OVERRIDE; |
79 virtual void WillCommit() OVERRIDE {} | 80 virtual void WillCommit() OVERRIDE {} |
80 virtual void DidCommit() OVERRIDE; | 81 virtual void DidCommit() OVERRIDE; |
81 virtual void DidCommitAndDrawFrame() OVERRIDE {} | 82 virtual void DidCommitAndDrawFrame() OVERRIDE {} |
82 virtual void DidCompleteSwapBuffers() OVERRIDE; | 83 virtual void DidCompleteSwapBuffers() OVERRIDE; |
83 | 84 |
84 // LayerTreeHostSingleThreadClient implementation. | 85 // LayerTreeHostSingleThreadClient implementation. |
85 virtual void ScheduleComposite() OVERRIDE; | 86 virtual void ScheduleComposite() OVERRIDE; |
86 virtual void ScheduleAnimation() OVERRIDE; | 87 virtual void ScheduleAnimation() OVERRIDE; |
87 virtual void DidPostSwapBuffers() OVERRIDE; | 88 virtual void DidPostSwapBuffers() OVERRIDE; |
88 virtual void DidAbortSwapBuffers() OVERRIDE; | 89 virtual void DidAbortSwapBuffers() OVERRIDE; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 will_composite_immediately_ = false; | 129 will_composite_immediately_ = false; |
129 } | 130 } |
130 void OnGpuChannelEstablished(); | 131 void OnGpuChannelEstablished(); |
131 | 132 |
132 // root_layer_ is the persistent internal root layer, while subroot_layer_ | 133 // root_layer_ is the persistent internal root layer, while subroot_layer_ |
133 // is the one attached by the compositor client. | 134 // is the one attached by the compositor client. |
134 scoped_refptr<cc::Layer> root_layer_; | 135 scoped_refptr<cc::Layer> root_layer_; |
135 scoped_refptr<cc::Layer> subroot_layer_; | 136 scoped_refptr<cc::Layer> subroot_layer_; |
136 | 137 |
137 scoped_ptr<cc::LayerTreeHost> host_; | 138 scoped_ptr<cc::LayerTreeHost> host_; |
| 139 scoped_refptr<content::ContextProviderCommandBuffer> context_provider_; |
138 content::UIResourceProviderImpl ui_resource_provider_; | 140 content::UIResourceProviderImpl ui_resource_provider_; |
139 | 141 |
140 gfx::Size size_; | 142 gfx::Size size_; |
141 bool has_transparent_background_; | 143 bool has_transparent_background_; |
142 float device_scale_factor_; | 144 float device_scale_factor_; |
143 | 145 |
144 ANativeWindow* window_; | 146 ANativeWindow* window_; |
145 int surface_id_; | 147 int surface_id_; |
146 | 148 |
147 CompositorClient* client_; | 149 CompositorClient* client_; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 base::TimeTicks last_vsync_; | 181 base::TimeTicks last_vsync_; |
180 | 182 |
181 base::WeakPtrFactory<CompositorImpl> weak_factory_; | 183 base::WeakPtrFactory<CompositorImpl> weak_factory_; |
182 | 184 |
183 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); | 185 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); |
184 }; | 186 }; |
185 | 187 |
186 } // namespace content | 188 } // namespace content |
187 | 189 |
188 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ | 190 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ |
OLD | NEW |