| 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> |
| 11 | 11 |
| 12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
| 13 #include "cc/output/copy_output_result.h" | 13 #include "cc/output/copy_output_result.h" |
| 14 #include "cc/scheduler/begin_frame_source.h" | 14 #include "cc/scheduler/begin_frame_source.h" |
| 15 #include "cc/surfaces/compositor_frame_sink_support_client.h" | 15 #include "cc/surfaces/compositor_frame_sink_support_client.h" |
| 16 #include "content/browser/bad_message.h" |
| 16 #include "content/browser/compositor/image_transport_factory.h" | 17 #include "content/browser/compositor/image_transport_factory.h" |
| 17 #include "content/browser/compositor/owned_mailbox.h" | 18 #include "content/browser/compositor/owned_mailbox.h" |
| 18 #include "content/browser/renderer_host/delegated_frame_evictor.h" | 19 #include "content/browser/renderer_host/delegated_frame_evictor.h" |
| 19 #include "content/browser/renderer_host/dip_util.h" | 20 #include "content/browser/renderer_host/dip_util.h" |
| 20 #include "content/browser/renderer_host/render_widget_host_impl.h" | 21 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 21 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 22 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 22 #include "content/public/browser/render_process_host.h" | 23 #include "content/public/browser/render_process_host.h" |
| 23 #include "ui/compositor/compositor.h" | 24 #include "ui/compositor/compositor.h" |
| 24 #include "ui/compositor/compositor_observer.h" | 25 #include "ui/compositor/compositor_observer.h" |
| 25 #include "ui/compositor/compositor_vsync_manager.h" | 26 #include "ui/compositor/compositor_vsync_manager.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 bool defer_compositor_lock) = 0; | 71 bool defer_compositor_lock) = 0; |
| 71 virtual void DelegatedFrameHostResizeLockWasReleased() = 0; | 72 virtual void DelegatedFrameHostResizeLockWasReleased() = 0; |
| 72 | 73 |
| 73 virtual void DelegatedFrameHostSendReclaimCompositorResources( | 74 virtual void DelegatedFrameHostSendReclaimCompositorResources( |
| 74 int compositor_frame_sink_id, | 75 int compositor_frame_sink_id, |
| 75 bool is_swap_ack, | 76 bool is_swap_ack, |
| 76 const cc::ReturnedResourceArray& resources) = 0; | 77 const cc::ReturnedResourceArray& resources) = 0; |
| 77 | 78 |
| 78 virtual void SetBeginFrameSource(cc::BeginFrameSource* source) = 0; | 79 virtual void SetBeginFrameSource(cc::BeginFrameSource* source) = 0; |
| 79 virtual bool IsAutoResizeEnabled() const = 0; | 80 virtual bool IsAutoResizeEnabled() const = 0; |
| 81 |
| 82 virtual void ReceivedBadMessage(bad_message::BadMessageReason reason) {} |
| 80 }; | 83 }; |
| 81 | 84 |
| 82 // The DelegatedFrameHost is used to host all of the RenderWidgetHostView state | 85 // The DelegatedFrameHost is used to host all of the RenderWidgetHostView state |
| 83 // and functionality that is associated with delegated frames being sent from | 86 // and functionality that is associated with delegated frames being sent from |
| 84 // the RenderWidget. The DelegatedFrameHost will push these changes through to | 87 // the RenderWidget. The DelegatedFrameHost will push these changes through to |
| 85 // the ui::Compositor associated with its DelegatedFrameHostClient. | 88 // the ui::Compositor associated with its DelegatedFrameHostClient. |
| 86 class CONTENT_EXPORT DelegatedFrameHost | 89 class CONTENT_EXPORT DelegatedFrameHost |
| 87 : public ui::CompositorObserver, | 90 : public ui::CompositorObserver, |
| 88 public ui::CompositorVSyncManager::Observer, | 91 public ui::CompositorVSyncManager::Observer, |
| 89 public ui::ContextFactoryObserver, | 92 public ui::ContextFactoryObserver, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 113 | 116 |
| 114 // DelegatedFrameEvictorClient implementation. | 117 // DelegatedFrameEvictorClient implementation. |
| 115 void EvictDelegatedFrame() override; | 118 void EvictDelegatedFrame() override; |
| 116 | 119 |
| 117 // cc::CompositorFrameSinkSupportClient implementation. | 120 // cc::CompositorFrameSinkSupportClient implementation. |
| 118 void DidReceiveCompositorFrameAck() override; | 121 void DidReceiveCompositorFrameAck() override; |
| 119 void OnBeginFrame(const cc::BeginFrameArgs& args) override; | 122 void OnBeginFrame(const cc::BeginFrameArgs& args) override; |
| 120 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; | 123 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; |
| 121 void WillDrawSurface(const cc::LocalSurfaceId& id, | 124 void WillDrawSurface(const cc::LocalSurfaceId& id, |
| 122 const gfx::Rect& damage_rect) override; | 125 const gfx::Rect& damage_rect) override; |
| 126 void OnBadFrameReceived() override; |
| 123 | 127 |
| 124 // Public interface exposed to RenderWidgetHostView. | 128 // Public interface exposed to RenderWidgetHostView. |
| 125 | 129 |
| 126 void SwapDelegatedFrame(uint32_t compositor_frame_sink_id, | 130 void SwapDelegatedFrame(uint32_t compositor_frame_sink_id, |
| 127 cc::CompositorFrame frame); | 131 cc::CompositorFrame frame); |
| 128 void ClearDelegatedFrame(); | 132 void ClearDelegatedFrame(); |
| 129 void WasHidden(); | 133 void WasHidden(); |
| 130 void WasShown(const ui::LatencyInfo& latency_info); | 134 void WasShown(const ui::LatencyInfo& latency_info); |
| 131 void WasResized(); | 135 void WasResized(); |
| 132 bool HasSavedFrame(); | 136 bool HasSavedFrame(); |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 bool needs_begin_frame_ = false; | 342 bool needs_begin_frame_ = false; |
| 339 | 343 |
| 340 bool has_frame_ = false; | 344 bool has_frame_ = false; |
| 341 | 345 |
| 342 std::unique_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; | 346 std::unique_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; |
| 343 }; | 347 }; |
| 344 | 348 |
| 345 } // namespace content | 349 } // namespace content |
| 346 | 350 |
| 347 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ | 351 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ |
| OLD | NEW |