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/common/gpu/client/context_provider_command_buffer.h" |
19 #include "content/public/browser/android/compositor.h" | 19 #include "content/public/browser/android/compositor.h" |
20 #include "gpu/command_buffer/common/capabilities.h" | 20 #include "gpu/command_buffer/common/capabilities.h" |
21 #include "third_party/khronos/GLES2/gl2.h" | 21 #include "third_party/khronos/GLES2/gl2.h" |
| 22 #include "ui/android/resources/resource_manager.h" |
22 #include "ui/base/android/system_ui_resource_manager.h" | 23 #include "ui/base/android/system_ui_resource_manager.h" |
23 #include "ui/base/android/window_android_compositor.h" | 24 #include "ui/base/android/window_android_compositor.h" |
24 | 25 |
25 class SkBitmap; | 26 class SkBitmap; |
26 struct ANativeWindow; | 27 struct ANativeWindow; |
27 | 28 |
28 namespace cc { | 29 namespace cc { |
29 class Layer; | 30 class Layer; |
30 class LayerTreeHost; | 31 class LayerTreeHost; |
31 class SurfaceIdAllocator; | 32 class SurfaceIdAllocator; |
(...skipping 24 matching lines...) Expand all Loading... |
56 private: | 57 private: |
57 // Compositor implementation. | 58 // Compositor implementation. |
58 virtual void SetRootLayer(scoped_refptr<cc::Layer> root) override; | 59 virtual void SetRootLayer(scoped_refptr<cc::Layer> root) override; |
59 virtual void SetSurface(jobject surface) override; | 60 virtual void SetSurface(jobject surface) override; |
60 virtual void SetVisible(bool visible) override; | 61 virtual void SetVisible(bool visible) override; |
61 virtual void setDeviceScaleFactor(float factor) override; | 62 virtual void setDeviceScaleFactor(float factor) override; |
62 virtual void SetWindowBounds(const gfx::Size& size) override; | 63 virtual void SetWindowBounds(const gfx::Size& size) override; |
63 virtual void SetHasTransparentBackground(bool flag) override; | 64 virtual void SetHasTransparentBackground(bool flag) override; |
64 virtual void SetNeedsComposite() override; | 65 virtual void SetNeedsComposite() override; |
65 virtual UIResourceProvider& GetUIResourceProvider() override; | 66 virtual UIResourceProvider& GetUIResourceProvider() override; |
| 67 virtual ui::ResourceManager& GetResourceManager() override; |
66 | 68 |
67 // LayerTreeHostClient implementation. | 69 // LayerTreeHostClient implementation. |
68 virtual void WillBeginMainFrame(int frame_id) override {} | 70 virtual void WillBeginMainFrame(int frame_id) override {} |
69 virtual void DidBeginMainFrame() override {} | 71 virtual void DidBeginMainFrame() override {} |
70 virtual void BeginMainFrame(const cc::BeginFrameArgs& args) override {} | 72 virtual void BeginMainFrame(const cc::BeginFrameArgs& args) override {} |
71 virtual void Layout() override; | 73 virtual void Layout() override; |
72 virtual void ApplyViewportDeltas( | 74 virtual void ApplyViewportDeltas( |
73 const gfx::Vector2d& inner_delta, | 75 const gfx::Vector2d& inner_delta, |
74 const gfx::Vector2d& outer_delta, | 76 const gfx::Vector2d& outer_delta, |
75 float page_scale, | 77 float page_scale, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 } | 139 } |
138 void OnGpuChannelEstablished(); | 140 void OnGpuChannelEstablished(); |
139 | 141 |
140 // root_layer_ is the persistent internal root layer, while subroot_layer_ | 142 // root_layer_ is the persistent internal root layer, while subroot_layer_ |
141 // is the one attached by the compositor client. | 143 // is the one attached by the compositor client. |
142 scoped_refptr<cc::Layer> root_layer_; | 144 scoped_refptr<cc::Layer> root_layer_; |
143 scoped_refptr<cc::Layer> subroot_layer_; | 145 scoped_refptr<cc::Layer> subroot_layer_; |
144 | 146 |
145 scoped_ptr<cc::LayerTreeHost> host_; | 147 scoped_ptr<cc::LayerTreeHost> host_; |
146 content::UIResourceProviderImpl ui_resource_provider_; | 148 content::UIResourceProviderImpl ui_resource_provider_; |
| 149 ui::ResourceManager resource_manager_; |
147 | 150 |
148 scoped_ptr<OnscreenDisplayClient> display_client_; | 151 scoped_ptr<OnscreenDisplayClient> display_client_; |
149 scoped_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; | 152 scoped_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; |
150 | 153 |
151 gfx::Size size_; | 154 gfx::Size size_; |
152 bool has_transparent_background_; | 155 bool has_transparent_background_; |
153 float device_scale_factor_; | 156 float device_scale_factor_; |
154 | 157 |
155 ANativeWindow* window_; | 158 ANativeWindow* window_; |
156 int surface_id_; | 159 int surface_id_; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 base::TimeTicks last_vsync_; | 198 base::TimeTicks last_vsync_; |
196 | 199 |
197 base::WeakPtrFactory<CompositorImpl> weak_factory_; | 200 base::WeakPtrFactory<CompositorImpl> weak_factory_; |
198 | 201 |
199 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); | 202 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); |
200 }; | 203 }; |
201 | 204 |
202 } // namespace content | 205 } // namespace content |
203 | 206 |
204 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ | 207 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ |
OLD | NEW |