| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 OutputSurfaceChanged(); | 61 void OutputSurfaceChanged(); |
| 62 | 62 |
| 63 void UpdateBackgroundColor(SkColor color); | 63 void UpdateBackgroundColor(SkColor color); |
| 64 | 64 |
| 65 void SetContentsOpaque(bool opaque); | |
| 66 | |
| 67 void UpdateContainerSizeinDIP(const gfx::Size& size_in_dip); | 65 void UpdateContainerSizeinDIP(const gfx::Size& size_in_dip); |
| 68 | 66 |
| 69 private: | 67 private: |
| 70 // cc::SurfaceFactoryClient implementation. | 68 // cc::SurfaceFactoryClient implementation. |
| 71 void ReturnResources(const cc::ReturnedResourceArray& resources) override; | 69 void ReturnResources(const cc::ReturnedResourceArray& resources) override; |
| 72 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; | 70 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; |
| 73 | 71 |
| 74 void UpdateBackgroundLayer(); | 72 void UpdateBackgroundLayer(); |
| 75 | 73 |
| 76 ViewAndroid* view_; | 74 ViewAndroid* view_; |
| 77 | 75 |
| 78 cc::SurfaceManager* surface_manager_; | 76 cc::SurfaceManager* surface_manager_; |
| 79 std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; | 77 std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; |
| 80 ReturnResourcesCallback return_resources_callback_; | 78 ReturnResourcesCallback return_resources_callback_; |
| 81 | 79 |
| 82 std::unique_ptr<cc::SurfaceFactory> surface_factory_; | 80 std::unique_ptr<cc::SurfaceFactory> surface_factory_; |
| 83 | 81 |
| 84 struct FrameData { | 82 struct FrameData { |
| 85 FrameData(); | 83 FrameData(); |
| 86 ~FrameData(); | 84 ~FrameData(); |
| 87 | 85 |
| 88 cc::SurfaceId surface_id; | 86 cc::SurfaceId surface_id; |
| 89 gfx::Size surface_size; | 87 gfx::Size surface_size; |
| 90 float top_controls_height; | 88 float top_controls_height; |
| 91 float top_controls_shown_ratio; | 89 float top_controls_shown_ratio; |
| 92 float bottom_controls_height; | 90 float bottom_controls_height; |
| 93 float bottom_controls_shown_ratio; | 91 float bottom_controls_shown_ratio; |
| 94 cc::Selection<gfx::SelectionBound> viewport_selection; | 92 cc::Selection<gfx::SelectionBound> viewport_selection; |
| 93 bool has_transparent_background; |
| 95 }; | 94 }; |
| 96 std::unique_ptr<FrameData> current_frame_; | 95 std::unique_ptr<FrameData> current_frame_; |
| 97 | 96 |
| 98 scoped_refptr<cc::SurfaceLayer> content_layer_; | 97 scoped_refptr<cc::SurfaceLayer> content_layer_; |
| 99 | 98 |
| 100 scoped_refptr<cc::Layer> background_layer_; | 99 scoped_refptr<cc::Layer> background_layer_; |
| 101 | 100 |
| 102 gfx::Size container_size_in_dip_; | 101 gfx::Size container_size_in_dip_; |
| 103 | 102 |
| 104 DISALLOW_COPY_AND_ASSIGN(DelegatedFrameHostAndroid); | 103 DISALLOW_COPY_AND_ASSIGN(DelegatedFrameHostAndroid); |
| 105 }; | 104 }; |
| 106 | 105 |
| 107 } // namespace ui | 106 } // namespace ui |
| 108 | 107 |
| 109 #endif // UI_ANDROID_DELEGATED_FRAME_HOST_ANDROID_H_ | 108 #endif // UI_ANDROID_DELEGATED_FRAME_HOST_ANDROID_H_ |
| OLD | NEW |