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

Side by Side Diff: ui/android/delegated_frame_host_android.h

Issue 2612083002: DirectCompositorFrameSink Uses CompositorFrameSinkSupport (Closed)
Patch Set: Restored DelegatedFrameHostAndroid::RegisterFrameSinkHierarchy() and UnregisterFrameSinkHierarchy()… 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 UI_ANDROID_DELEGATED_FRAME_HOST_ANDROID_H_ 5 #ifndef UI_ANDROID_DELEGATED_FRAME_HOST_ANDROID_H_
6 #define UI_ANDROID_DELEGATED_FRAME_HOST_ANDROID_H_ 6 #define UI_ANDROID_DELEGATED_FRAME_HOST_ANDROID_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "cc/output/copy_output_request.h" 10 #include "cc/output/copy_output_request.h"
11 #include "cc/resources/returned_resource.h" 11 #include "cc/resources/returned_resource.h"
12 #include "cc/surfaces/surface_factory.h" 12 #include "cc/surfaces/surface_factory.h"
13 #include "cc/surfaces/surface_factory_client.h" 13 #include "cc/surfaces/surface_factory_client.h"
14 #include "ui/android/ui_android_export.h" 14 #include "ui/android/ui_android_export.h"
15 #include "ui/gfx/selection_bound.h" 15 #include "ui/gfx/selection_bound.h"
16 16
17 namespace cc { 17 namespace cc {
18 18
19 class CompositorFrame; 19 class CompositorFrame;
20 class Layer; 20 class Layer;
21 class SurfaceManager; 21 class SurfaceManager;
22 class SurfaceLayer; 22 class SurfaceLayer;
23 class SurfaceIdAllocator; 23 class SurfaceIdAllocator;
24 enum class SurfaceDrawStatus; 24 enum class SurfaceDrawStatus;
25 25
26 } // namespace cc 26 } // namespace cc
27 27
28 namespace content {
29 class CompositorImpl;
30 } // namespace content
31
28 namespace ui { 32 namespace ui {
29 class ViewAndroid; 33 class ViewAndroid;
30 class WindowAndroidCompositor; 34 class WindowAndroidCompositor;
31 35
32 class UI_ANDROID_EXPORT DelegatedFrameHostAndroid 36 class UI_ANDROID_EXPORT DelegatedFrameHostAndroid
33 : public cc::SurfaceFactoryClient { 37 : public cc::SurfaceFactoryClient {
34 public: 38 public:
35 class Client { 39 class Client {
36 public: 40 public:
37 virtual void SetBeginFrameSource( 41 virtual void SetBeginFrameSource(
(...skipping 24 matching lines...) Expand all
62 cc::CopyOutputRequest::CopyOutputRequestCallback result_callback); 66 cc::CopyOutputRequest::CopyOutputRequestCallback result_callback);
63 67
64 void CompositorFrameSinkChanged(); 68 void CompositorFrameSinkChanged();
65 69
66 void UpdateBackgroundColor(SkColor color); 70 void UpdateBackgroundColor(SkColor color);
67 71
68 void UpdateContainerSizeinDIP(const gfx::Size& size_in_dip); 72 void UpdateContainerSizeinDIP(const gfx::Size& size_in_dip);
69 73
70 // Called when this DFH is attached/detached from a parent browser compositor 74 // Called when this DFH is attached/detached from a parent browser compositor
71 // and needs to be attached to the surface hierarchy. 75 // and needs to be attached to the surface hierarchy.
72 void RegisterFrameSinkHierarchy(const cc::FrameSinkId& parent_id); 76 void AttachToCompositor(content::CompositorImpl* compositor);
Fady Samuel 2017/02/02 00:07:43 This doesn't work. ui/android cannot depend on con
Alex Z. 2017/02/02 00:17:32 AttachToCompositor calls compositor->AddChildFrame
73 void UnregisterFrameSinkHierarchy(); 77 void DetachFromCompositor();
74 78
75 private: 79 private:
76 // cc::SurfaceFactoryClient implementation. 80 // cc::SurfaceFactoryClient implementation.
77 void ReturnResources(const cc::ReturnedResourceArray& resources) override; 81 void ReturnResources(const cc::ReturnedResourceArray& resources) override;
78 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; 82 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override;
79 83
80 void UpdateBackgroundLayer(); 84 void UpdateBackgroundLayer();
81 85
82 const cc::FrameSinkId frame_sink_id_; 86 const cc::FrameSinkId frame_sink_id_;
83 87
84 ViewAndroid* view_; 88 ViewAndroid* view_;
85 89
86 cc::SurfaceManager* surface_manager_; 90 cc::SurfaceManager* surface_manager_;
87 std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; 91 std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_;
88 cc::FrameSinkId registered_parent_frame_sink_id_; 92 content::CompositorImpl* parent_compositor_impl_;
89 Client* client_; 93 Client* client_;
90 94
91 std::unique_ptr<cc::SurfaceFactory> surface_factory_; 95 std::unique_ptr<cc::SurfaceFactory> surface_factory_;
92 96
93 struct FrameData { 97 struct FrameData {
94 FrameData(); 98 FrameData();
95 ~FrameData(); 99 ~FrameData();
96 100
97 cc::LocalSurfaceId local_surface_id; 101 cc::LocalSurfaceId local_surface_id;
98 gfx::Size surface_size; 102 gfx::Size surface_size;
(...skipping 11 matching lines...) Expand all
110 scoped_refptr<cc::Layer> background_layer_; 114 scoped_refptr<cc::Layer> background_layer_;
111 115
112 gfx::Size container_size_in_dip_; 116 gfx::Size container_size_in_dip_;
113 117
114 DISALLOW_COPY_AND_ASSIGN(DelegatedFrameHostAndroid); 118 DISALLOW_COPY_AND_ASSIGN(DelegatedFrameHostAndroid);
115 }; 119 };
116 120
117 } // namespace ui 121 } // namespace ui
118 122
119 #endif // UI_ANDROID_DELEGATED_FRAME_HOST_ANDROID_H_ 123 #endif // UI_ANDROID_DELEGATED_FRAME_HOST_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698