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