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

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

Issue 2686243002: content/ui[Android]: Remove ContextProviderFactory. (Closed)
Patch Set: .. Created 3 years, 10 months 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 <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
11 11
12 #include "base/cancelable_callback.h" 12 #include "base/cancelable_callback.h"
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "base/observer_list.h" 16 #include "base/observer_list.h"
17 #include "base/timer/timer.h" 17 #include "base/timer/timer.h"
18 #include "cc/surfaces/frame_sink_id.h" 18 #include "cc/surfaces/frame_sink_id.h"
19 #include "cc/trees/layer_tree_host_client.h" 19 #include "cc/trees/layer_tree_host_client.h"
20 #include "cc/trees/layer_tree_host_single_thread_client.h" 20 #include "cc/trees/layer_tree_host_single_thread_client.h"
21 #include "content/common/content_export.h" 21 #include "content/common/content_export.h"
22 #include "content/public/browser/android/compositor.h" 22 #include "content/public/browser/android/compositor.h"
23 #include "gpu/command_buffer/common/capabilities.h" 23 #include "gpu/command_buffer/common/capabilities.h"
24 #include "gpu/ipc/common/surface_handle.h" 24 #include "gpu/ipc/common/surface_handle.h"
25 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h" 25 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h"
26 #include "third_party/khronos/GLES2/gl2.h" 26 #include "third_party/khronos/GLES2/gl2.h"
27 #include "ui/android/context_provider_factory.h"
28 #include "ui/android/resources/resource_manager_impl.h" 27 #include "ui/android/resources/resource_manager_impl.h"
29 #include "ui/android/resources/ui_resource_provider.h" 28 #include "ui/android/resources/ui_resource_provider.h"
30 #include "ui/android/window_android_compositor.h" 29 #include "ui/android/window_android_compositor.h"
31 30
32 struct ANativeWindow; 31 struct ANativeWindow;
33 32
34 namespace cc { 33 namespace cc {
35 class AnimationHost; 34 class AnimationHost;
36 class Display; 35 class Display;
36 class FrameSinkId;
37 class Layer; 37 class Layer;
38 class LayerTreeHost; 38 class LayerTreeHost;
39 class OutputSurface; 39 class OutputSurface;
40 class SurfaceManager;
40 class VulkanContextProvider; 41 class VulkanContextProvider;
41 } 42 }
42 43
43 namespace content { 44 namespace content {
44 class CompositorClient; 45 class CompositorClient;
45 46
46 // ----------------------------------------------------------------------------- 47 // -----------------------------------------------------------------------------
47 // Browser-side compositor that manages a tree of content and UI layers. 48 // Browser-side compositor that manages a tree of content and UI layers.
48 // ----------------------------------------------------------------------------- 49 // -----------------------------------------------------------------------------
49 class CONTENT_EXPORT CompositorImpl 50 class CONTENT_EXPORT CompositorImpl
50 : public Compositor, 51 : public Compositor,
51 public cc::LayerTreeHostClient, 52 public cc::LayerTreeHostClient,
52 public cc::LayerTreeHostSingleThreadClient, 53 public cc::LayerTreeHostSingleThreadClient,
53 public ui::UIResourceProvider, 54 public ui::UIResourceProvider,
54 public ui::WindowAndroidCompositor { 55 public ui::WindowAndroidCompositor {
55 public: 56 public:
56 CompositorImpl(CompositorClient* client, gfx::NativeWindow root_window); 57 CompositorImpl(CompositorClient* client, gfx::NativeWindow root_window);
57 ~CompositorImpl() override; 58 ~CompositorImpl() override;
58 59
59 static bool IsInitialized(); 60 static bool IsInitialized();
60 61
62 static cc::SurfaceManager* GetSurfaceManager();
63 static cc::FrameSinkId AllocateFrameSinkId();
64
61 // ui::ResourceProvider implementation. 65 // ui::ResourceProvider implementation.
62 cc::UIResourceId CreateUIResource(cc::UIResourceClient* client) override; 66 cc::UIResourceId CreateUIResource(cc::UIResourceClient* client) override;
63 void DeleteUIResource(cc::UIResourceId resource_id) override; 67 void DeleteUIResource(cc::UIResourceId resource_id) override;
64 bool SupportsETC1NonPowerOfTwo() const override; 68 bool SupportsETC1NonPowerOfTwo() const override;
65 69
66 private: 70 private:
67 // Compositor implementation. 71 // Compositor implementation.
68 void SetRootLayer(scoped_refptr<cc::Layer> root) override; 72 void SetRootLayer(scoped_refptr<cc::Layer> root) override;
69 void SetSurface(jobject surface) override; 73 void SetSurface(jobject surface) override;
70 void SetWindowBounds(const gfx::Size& size) override; 74 void SetWindowBounds(const gfx::Size& size) override;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 112
109 void SetVisible(bool visible); 113 void SetVisible(bool visible);
110 void CreateLayerTreeHost(); 114 void CreateLayerTreeHost();
111 115
112 void HandlePendingCompositorFrameSinkRequest(); 116 void HandlePendingCompositorFrameSinkRequest();
113 117
114 #if defined(ENABLE_VULKAN) 118 #if defined(ENABLE_VULKAN)
115 void CreateVulkanOutputSurface(); 119 void CreateVulkanOutputSurface();
116 #endif 120 #endif
117 void OnGpuChannelEstablished( 121 void OnGpuChannelEstablished(
118 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, 122 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host);
119 ui::ContextProviderFactory::GpuChannelHostResult result);
120 void InitializeDisplay( 123 void InitializeDisplay(
121 std::unique_ptr<cc::OutputSurface> display_output_surface, 124 std::unique_ptr<cc::OutputSurface> display_output_surface,
122 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider, 125 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider,
123 scoped_refptr<cc::ContextProvider> context_provider); 126 scoped_refptr<cc::ContextProvider> context_provider);
124 127
125 bool HavePendingReadbacks(); 128 bool HavePendingReadbacks();
126 void SetBackgroundColor(int color); 129 void SetBackgroundColor(int color);
127 130
128 cc::FrameSinkId frame_sink_id_; 131 cc::FrameSinkId frame_sink_id_;
129 132
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 std::unordered_set<cc::FrameSinkId, cc::FrameSinkIdHash> 174 std::unordered_set<cc::FrameSinkId, cc::FrameSinkIdHash>
172 pending_child_frame_sink_ids_; 175 pending_child_frame_sink_ids_;
173 base::WeakPtrFactory<CompositorImpl> weak_factory_; 176 base::WeakPtrFactory<CompositorImpl> weak_factory_;
174 177
175 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); 178 DISALLOW_COPY_AND_ASSIGN(CompositorImpl);
176 }; 179 };
177 180
178 } // namespace content 181 } // namespace content
179 182
180 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ 183 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698