| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_DELEGATED_FRAME_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 // Returns the color that the resize gutters should be drawn with. Takes the | 64 // Returns the color that the resize gutters should be drawn with. Takes the |
| 65 // suggested color from the current page background. | 65 // suggested color from the current page background. |
| 66 virtual SkColor DelegatedFrameHostGetGutterColor(SkColor color) const = 0; | 66 virtual SkColor DelegatedFrameHostGetGutterColor(SkColor color) const = 0; |
| 67 virtual gfx::Size DelegatedFrameHostDesiredSizeInDIP() const = 0; | 67 virtual gfx::Size DelegatedFrameHostDesiredSizeInDIP() const = 0; |
| 68 | 68 |
| 69 virtual bool DelegatedFrameCanCreateResizeLock() const = 0; | 69 virtual bool DelegatedFrameCanCreateResizeLock() const = 0; |
| 70 virtual std::unique_ptr<CompositorResizeLock> | 70 virtual std::unique_ptr<CompositorResizeLock> |
| 71 DelegatedFrameHostCreateResizeLock() = 0; | 71 DelegatedFrameHostCreateResizeLock() = 0; |
| 72 | 72 |
| 73 virtual void DelegatedFrameHostSendReclaimCompositorResources( | |
| 74 bool is_swap_ack, | |
| 75 const cc::ReturnedResourceArray& resources) = 0; | |
| 76 | |
| 77 virtual void OnBeginFrame(const cc::BeginFrameArgs& args) = 0; | 73 virtual void OnBeginFrame(const cc::BeginFrameArgs& args) = 0; |
| 78 virtual bool IsAutoResizeEnabled() const = 0; | 74 virtual bool IsAutoResizeEnabled() const = 0; |
| 79 }; | 75 }; |
| 80 | 76 |
| 81 // The DelegatedFrameHost is used to host all of the RenderWidgetHostView state | 77 // The DelegatedFrameHost is used to host all of the RenderWidgetHostView state |
| 82 // and functionality that is associated with delegated frames being sent from | 78 // and functionality that is associated with delegated frames being sent from |
| 83 // the RenderWidget. The DelegatedFrameHost will push these changes through to | 79 // the RenderWidget. The DelegatedFrameHost will push these changes through to |
| 84 // the ui::Compositor associated with its DelegatedFrameHostClient. | 80 // the ui::Compositor associated with its DelegatedFrameHostClient. |
| 85 class CONTENT_EXPORT DelegatedFrameHost | 81 class CONTENT_EXPORT DelegatedFrameHost |
| 86 : public ui::CompositorObserver, | 82 : public ui::CompositorObserver, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 114 // cc::CompositorFrameSinkSupportClient implementation. | 110 // cc::CompositorFrameSinkSupportClient implementation. |
| 115 void DidReceiveCompositorFrameAck( | 111 void DidReceiveCompositorFrameAck( |
| 116 const cc::ReturnedResourceArray& resources) override; | 112 const cc::ReturnedResourceArray& resources) override; |
| 117 void OnBeginFrame(const cc::BeginFrameArgs& args) override; | 113 void OnBeginFrame(const cc::BeginFrameArgs& args) override; |
| 118 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; | 114 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; |
| 119 void WillDrawSurface(const cc::LocalSurfaceId& id, | 115 void WillDrawSurface(const cc::LocalSurfaceId& id, |
| 120 const gfx::Rect& damage_rect) override; | 116 const gfx::Rect& damage_rect) override; |
| 121 | 117 |
| 122 // Public interface exposed to RenderWidgetHostView. | 118 // Public interface exposed to RenderWidgetHostView. |
| 123 | 119 |
| 124 void DidCreateNewRendererCompositorFrameSink(); | 120 void DidCreateNewRendererCompositorFrameSink( |
| 121 cc::mojom::MojoCompositorFrameSinkClient* renderer_compositor_frame_sink); |
| 125 void SubmitCompositorFrame(const cc::LocalSurfaceId& local_surface_id, | 122 void SubmitCompositorFrame(const cc::LocalSurfaceId& local_surface_id, |
| 126 cc::CompositorFrame frame); | 123 cc::CompositorFrame frame); |
| 127 void ClearDelegatedFrame(); | 124 void ClearDelegatedFrame(); |
| 128 void WasHidden(); | 125 void WasHidden(); |
| 129 void WasShown(const ui::LatencyInfo& latency_info); | 126 void WasShown(const ui::LatencyInfo& latency_info); |
| 130 void WasResized(); | 127 void WasResized(); |
| 131 bool HasSavedFrame(); | 128 bool HasSavedFrame(); |
| 132 gfx::Size GetRequestedRendererSize() const; | 129 gfx::Size GetRequestedRendererSize() const; |
| 133 void SetCompositor(ui::Compositor* compositor); | 130 void SetCompositor(ui::Compositor* compositor); |
| 134 void ResetCompositor(); | 131 void ResetCompositor(); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 // YUV readback pipeline. | 313 // YUV readback pipeline. |
| 317 std::unique_ptr<display_compositor::ReadbackYUVInterface> | 314 std::unique_ptr<display_compositor::ReadbackYUVInterface> |
| 318 yuv_readback_pipeline_; | 315 yuv_readback_pipeline_; |
| 319 | 316 |
| 320 bool needs_begin_frame_ = false; | 317 bool needs_begin_frame_ = false; |
| 321 uint32_t latest_confirmed_begin_frame_source_id_ = 0; | 318 uint32_t latest_confirmed_begin_frame_source_id_ = 0; |
| 322 uint64_t latest_confirmed_begin_frame_sequence_number_ = | 319 uint64_t latest_confirmed_begin_frame_sequence_number_ = |
| 323 cc::BeginFrameArgs::kInvalidFrameNumber; | 320 cc::BeginFrameArgs::kInvalidFrameNumber; |
| 324 | 321 |
| 325 bool has_frame_ = false; | 322 bool has_frame_ = false; |
| 323 cc::mojom::MojoCompositorFrameSinkClient* renderer_compositor_frame_sink_ = |
| 324 nullptr; |
| 326 | 325 |
| 327 std::unique_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; | 326 std::unique_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; |
| 328 }; | 327 }; |
| 329 | 328 |
| 330 } // namespace content | 329 } // namespace content |
| 331 | 330 |
| 332 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ | 331 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ |
| OLD | NEW |