OLD | NEW |
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" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 ~DelegatedFrameHostAndroid() override; | 44 ~DelegatedFrameHostAndroid() override; |
45 | 45 |
46 void SubmitCompositorFrame(cc::CompositorFrame frame, | 46 void SubmitCompositorFrame(cc::CompositorFrame frame, |
47 cc::SurfaceFactory::DrawCallback draw_callback); | 47 cc::SurfaceFactory::DrawCallback draw_callback); |
48 | 48 |
49 void DestroyDelegatedContent(); | 49 void DestroyDelegatedContent(); |
50 | 50 |
51 bool HasDelegatedContent() const; | 51 bool HasDelegatedContent() const; |
52 | 52 |
53 uint32_t GetSurfaceClientId() const; | 53 cc::FrameSinkId GetFrameSinkId() const; |
54 | 54 |
55 // Should only be called when the host has a content layer. | 55 // Should only be called when the host has a content layer. |
56 void RequestCopyOfSurface( | 56 void RequestCopyOfSurface( |
57 WindowAndroidCompositor* compositor, | 57 WindowAndroidCompositor* compositor, |
58 const gfx::Rect& src_subrect_in_pixel, | 58 const gfx::Rect& src_subrect_in_pixel, |
59 cc::CopyOutputRequest::CopyOutputRequestCallback result_callback); | 59 cc::CopyOutputRequest::CopyOutputRequestCallback result_callback); |
60 | 60 |
61 void CompositorFrameSinkChanged(); | 61 void CompositorFrameSinkChanged(); |
62 | 62 |
63 void UpdateBackgroundColor(SkColor color); | 63 void UpdateBackgroundColor(SkColor color); |
64 | 64 |
65 void UpdateContainerSizeinDIP(const gfx::Size& size_in_dip); | 65 void UpdateContainerSizeinDIP(const gfx::Size& size_in_dip); |
66 | 66 |
67 // Called when this DFH is attached/detached from a parent browser compositor | 67 // Called when this DFH is attached/detached from a parent browser compositor |
68 // and needs to be attached to the surface hierarchy. | 68 // and needs to be attached to the surface hierarchy. |
69 void RegisterSurfaceNamespaceHierarchy(uint32_t parent_id); | 69 void RegisterFrameSinkHierarchy(const cc::FrameSinkId& parent_id); |
70 void UnregisterSurfaceNamespaceHierarchy(); | 70 void UnregisterFrameSinkHierarchy(); |
71 | 71 |
72 private: | 72 private: |
73 // cc::SurfaceFactoryClient implementation. | 73 // cc::SurfaceFactoryClient implementation. |
74 void ReturnResources(const cc::ReturnedResourceArray& resources) override; | 74 void ReturnResources(const cc::ReturnedResourceArray& resources) override; |
75 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; | 75 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; |
76 | 76 |
77 void UpdateBackgroundLayer(); | 77 void UpdateBackgroundLayer(); |
78 | 78 |
79 ViewAndroid* view_; | 79 ViewAndroid* view_; |
80 | 80 |
81 cc::SurfaceManager* surface_manager_; | 81 cc::SurfaceManager* surface_manager_; |
82 std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; | 82 std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; |
83 uint32_t registered_parent_client_id_ = 0u; | 83 cc::FrameSinkId registered_parent_frame_sink_id_; |
84 ReturnResourcesCallback return_resources_callback_; | 84 ReturnResourcesCallback return_resources_callback_; |
85 | 85 |
86 std::unique_ptr<cc::SurfaceFactory> surface_factory_; | 86 std::unique_ptr<cc::SurfaceFactory> surface_factory_; |
87 | 87 |
88 struct FrameData { | 88 struct FrameData { |
89 FrameData(); | 89 FrameData(); |
90 ~FrameData(); | 90 ~FrameData(); |
91 | 91 |
92 cc::SurfaceId surface_id; | 92 cc::SurfaceId surface_id; |
93 gfx::Size surface_size; | 93 gfx::Size surface_size; |
(...skipping 11 matching lines...) Expand all Loading... |
105 scoped_refptr<cc::Layer> background_layer_; | 105 scoped_refptr<cc::Layer> background_layer_; |
106 | 106 |
107 gfx::Size container_size_in_dip_; | 107 gfx::Size container_size_in_dip_; |
108 | 108 |
109 DISALLOW_COPY_AND_ASSIGN(DelegatedFrameHostAndroid); | 109 DISALLOW_COPY_AND_ASSIGN(DelegatedFrameHostAndroid); |
110 }; | 110 }; |
111 | 111 |
112 } // namespace ui | 112 } // namespace ui |
113 | 113 |
114 #endif // UI_ANDROID_DELEGATED_FRAME_HOST_ANDROID_H_ | 114 #endif // UI_ANDROID_DELEGATED_FRAME_HOST_ANDROID_H_ |
OLD | NEW |