| 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 CC_TEST_TEST_COMPOSITOR_FRAME_SINK_H_ | 5 #ifndef CC_TEST_TEST_COMPOSITOR_FRAME_SINK_H_ |
| 6 #define CC_TEST_TEST_COMPOSITOR_FRAME_SINK_H_ | 6 #define CC_TEST_TEST_COMPOSITOR_FRAME_SINK_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "cc/output/compositor_frame_sink.h" | 10 #include "cc/output/compositor_frame_sink.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 Display* display() const { return display_.get(); } | 72 Display* display() const { return display_.get(); } |
| 73 | 73 |
| 74 // Will be included with the next SubmitCompositorFrame. | 74 // Will be included with the next SubmitCompositorFrame. |
| 75 void RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> request); | 75 void RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> request); |
| 76 | 76 |
| 77 // CompositorFrameSink implementation. | 77 // CompositorFrameSink implementation. |
| 78 bool BindToClient(CompositorFrameSinkClient* client) override; | 78 bool BindToClient(CompositorFrameSinkClient* client) override; |
| 79 void DetachFromClient() override; | 79 void DetachFromClient() override; |
| 80 void SetLocalSurfaceId(const LocalSurfaceId& local_surface_id) override; | 80 void SetLocalSurfaceId(const LocalSurfaceId& local_surface_id) override; |
| 81 void SubmitCompositorFrame(CompositorFrame frame) override; | 81 void SubmitCompositorFrame(CompositorFrame frame) override; |
| 82 void DidNotProduceFrame(const BeginFrameAck& ack) override; |
| 82 | 83 |
| 83 // CompositorFrameSinkSupportClient implementation. | 84 // CompositorFrameSinkSupportClient implementation. |
| 84 void DidReceiveCompositorFrameAck( | 85 void DidReceiveCompositorFrameAck( |
| 85 const ReturnedResourceArray& resources) override; | 86 const ReturnedResourceArray& resources) override; |
| 86 void OnBeginFrame(const BeginFrameArgs& args) override; | 87 void OnBeginFrame(const BeginFrameArgs& args) override; |
| 87 void ReclaimResources(const ReturnedResourceArray& resources) override; | 88 void ReclaimResources(const ReturnedResourceArray& resources) override; |
| 88 void WillDrawSurface(const LocalSurfaceId& local_surface_id, | 89 void WillDrawSurface(const LocalSurfaceId& local_surface_id, |
| 89 const gfx::Rect& damage_rect) override; | 90 const gfx::Rect& damage_rect) override; |
| 90 | 91 |
| 91 // DisplayClient implementation. | 92 // DisplayClient implementation. |
| 92 void DisplayOutputSurfaceLost() override; | 93 void DisplayOutputSurfaceLost() override; |
| 93 void DisplayWillDrawAndSwap(bool will_draw_and_swap, | 94 void DisplayWillDrawAndSwap(bool will_draw_and_swap, |
| 94 const RenderPassList& render_passes) override; | 95 const RenderPassList& render_passes) override; |
| 95 void DisplayDidDrawAndSwap() override; | 96 void DisplayDidDrawAndSwap() override; |
| 96 | 97 |
| 97 private: | 98 private: |
| 98 // ExternalBeginFrameSource implementation. | 99 // ExternalBeginFrameSource implementation. |
| 99 void OnNeedsBeginFrames(bool needs_begin_frames) override; | 100 void OnNeedsBeginFrames(bool needs_begin_frames) override; |
| 100 void OnDidFinishFrame(const BeginFrameAck& ack) override; | |
| 101 | 101 |
| 102 void SendCompositorFrameAckToClient(); | 102 void SendCompositorFrameAckToClient(); |
| 103 | 103 |
| 104 const bool synchronous_composite_; | 104 const bool synchronous_composite_; |
| 105 const bool disable_display_vsync_; | 105 const bool disable_display_vsync_; |
| 106 const RendererSettings renderer_settings_; | 106 const RendererSettings renderer_settings_; |
| 107 | 107 |
| 108 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 108 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 109 | 109 |
| 110 FrameSinkId frame_sink_id_; | 110 FrameSinkId frame_sink_id_; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 127 gfx::Size enlarge_pass_texture_amount_; | 127 gfx::Size enlarge_pass_texture_amount_; |
| 128 | 128 |
| 129 std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests_; | 129 std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests_; |
| 130 | 130 |
| 131 base::WeakPtrFactory<TestCompositorFrameSink> weak_ptr_factory_; | 131 base::WeakPtrFactory<TestCompositorFrameSink> weak_ptr_factory_; |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 } // namespace cc | 134 } // namespace cc |
| 135 | 135 |
| 136 #endif // CC_TEST_TEST_COMPOSITOR_FRAME_SINK_H_ | 136 #endif // CC_TEST_TEST_COMPOSITOR_FRAME_SINK_H_ |
| OLD | NEW |