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

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

Issue 755643004: Replace SystemUIResourceManager with ResourceManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 "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"
16 #include "content/common/content_export.h" 15 #include "content/common/content_export.h"
17 #include "content/common/gpu/client/context_provider_command_buffer.h" 16 #include "content/common/gpu/client/context_provider_command_buffer.h"
18 #include "content/public/browser/android/compositor.h" 17 #include "content/public/browser/android/compositor.h"
19 #include "gpu/command_buffer/common/capabilities.h" 18 #include "gpu/command_buffer/common/capabilities.h"
20 #include "third_party/khronos/GLES2/gl2.h" 19 #include "third_party/khronos/GLES2/gl2.h"
21 #include "ui/android/resources/resource_manager.h" 20 #include "ui/android/resources/resource_manager.h"
21 #include "ui/android/resources/ui_resource_provider.h"
22 #include "ui/base/android/system_ui_resource_manager.h" 22 #include "ui/base/android/system_ui_resource_manager.h"
23 #include "ui/base/android/window_android_compositor.h" 23 #include "ui/base/android/window_android_compositor.h"
24 24
25 class SkBitmap; 25 class SkBitmap;
26 struct ANativeWindow; 26 struct ANativeWindow;
27 27
28 namespace cc { 28 namespace cc {
29 class Layer; 29 class Layer;
30 class LayerTreeHost; 30 class LayerTreeHost;
31 class SurfaceIdAllocator; 31 class SurfaceIdAllocator;
32 } 32 }
33 33
34 namespace content { 34 namespace content {
35 class CompositorClient; 35 class CompositorClient;
36 class OnscreenDisplayClient; 36 class OnscreenDisplayClient;
37 class UIResourceProvider;
38 37
39 // ----------------------------------------------------------------------------- 38 // -----------------------------------------------------------------------------
40 // Browser-side compositor that manages a tree of content and UI layers. 39 // Browser-side compositor that manages a tree of content and UI layers.
41 // ----------------------------------------------------------------------------- 40 // -----------------------------------------------------------------------------
42 class CONTENT_EXPORT CompositorImpl 41 class CONTENT_EXPORT CompositorImpl
43 : public Compositor, 42 : public Compositor,
44 public cc::LayerTreeHostClient, 43 public cc::LayerTreeHostClient,
45 public cc::LayerTreeHostSingleThreadClient, 44 public cc::LayerTreeHostSingleThreadClient,
46 public ui::WindowAndroidCompositor { 45 public ui::WindowAndroidCompositor {
47 public: 46 public:
48 CompositorImpl(CompositorClient* client, gfx::NativeWindow root_window); 47 CompositorImpl(CompositorClient* client, gfx::NativeWindow root_window);
49 virtual ~CompositorImpl(); 48 virtual ~CompositorImpl();
50 49
51 static bool IsInitialized(); 50 static bool IsInitialized();
52 51
53 void PopulateGpuCapabilities(gpu::Capabilities gpu_capabilities); 52 void PopulateGpuCapabilities(gpu::Capabilities gpu_capabilities);
54 53
55 private: 54 private:
56 // Compositor implementation. 55 // Compositor implementation.
57 virtual void SetRootLayer(scoped_refptr<cc::Layer> root) override; 56 virtual void SetRootLayer(scoped_refptr<cc::Layer> root) override;
58 virtual void SetSurface(jobject surface) override; 57 virtual void SetSurface(jobject surface) override;
59 virtual void SetVisible(bool visible) override; 58 virtual void SetVisible(bool visible) override;
60 virtual void setDeviceScaleFactor(float factor) override; 59 virtual void setDeviceScaleFactor(float factor) override;
61 virtual void SetWindowBounds(const gfx::Size& size) override; 60 virtual void SetWindowBounds(const gfx::Size& size) override;
62 virtual void SetHasTransparentBackground(bool flag) override; 61 virtual void SetHasTransparentBackground(bool flag) override;
63 virtual void SetNeedsComposite() override; 62 virtual void SetNeedsComposite() override;
64 virtual UIResourceProvider& GetUIResourceProvider() override; 63 virtual ui::UIResourceProvider& GetUIResourceProvider() override;
65 virtual ui::ResourceManager& GetResourceManager() override; 64 virtual ui::ResourceManager& GetResourceManager() override;
66 65
67 // LayerTreeHostClient implementation. 66 // LayerTreeHostClient implementation.
68 virtual void WillBeginMainFrame(int frame_id) override {} 67 virtual void WillBeginMainFrame(int frame_id) override {}
69 virtual void DidBeginMainFrame() override {} 68 virtual void DidBeginMainFrame() override {}
70 virtual void BeginMainFrame(const cc::BeginFrameArgs& args) override {} 69 virtual void BeginMainFrame(const cc::BeginFrameArgs& args) override {}
71 virtual void Layout() override; 70 virtual void Layout() override;
72 virtual void ApplyViewportDeltas( 71 virtual void ApplyViewportDeltas(
73 const gfx::Vector2d& inner_delta, 72 const gfx::Vector2d& inner_delta,
74 const gfx::Vector2d& outer_delta, 73 const gfx::Vector2d& outer_delta,
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 will_composite_immediately_ = false; 132 will_composite_immediately_ = false;
134 } 133 }
135 void OnGpuChannelEstablished(); 134 void OnGpuChannelEstablished();
136 135
137 // root_layer_ is the persistent internal root layer, while subroot_layer_ 136 // root_layer_ is the persistent internal root layer, while subroot_layer_
138 // is the one attached by the compositor client. 137 // is the one attached by the compositor client.
139 scoped_refptr<cc::Layer> root_layer_; 138 scoped_refptr<cc::Layer> root_layer_;
140 scoped_refptr<cc::Layer> subroot_layer_; 139 scoped_refptr<cc::Layer> subroot_layer_;
141 140
142 scoped_ptr<cc::LayerTreeHost> host_; 141 scoped_ptr<cc::LayerTreeHost> host_;
143 content::UIResourceProviderImpl ui_resource_provider_; 142 ui::UIResourceProvider ui_resource_provider_;
144 ui::ResourceManager resource_manager_; 143 ui::ResourceManager resource_manager_;
145 144
146 scoped_ptr<OnscreenDisplayClient> display_client_; 145 scoped_ptr<OnscreenDisplayClient> display_client_;
147 scoped_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; 146 scoped_ptr<cc::SurfaceIdAllocator> surface_id_allocator_;
148 147
149 gfx::Size size_; 148 gfx::Size size_;
150 bool has_transparent_background_; 149 bool has_transparent_background_;
151 float device_scale_factor_; 150 float device_scale_factor_;
152 151
153 ANativeWindow* window_; 152 ANativeWindow* window_;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 base::TimeTicks last_vsync_; 192 base::TimeTicks last_vsync_;
194 193
195 base::WeakPtrFactory<CompositorImpl> weak_factory_; 194 base::WeakPtrFactory<CompositorImpl> weak_factory_;
196 195
197 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); 196 DISALLOW_COPY_AND_ASSIGN(CompositorImpl);
198 }; 197 };
199 198
200 } // namespace content 199 } // namespace content
201 200
202 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ 201 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698