| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_FAKE_COMPOSITOR_FRAME_SINK_SUPPORT_CLIENT_H_ | 5 #ifndef CC_TEST_FAKE_COMPOSITOR_FRAME_SINK_SUPPORT_CLIENT_H_ |
| 6 #define CC_TEST_FAKE_COMPOSITOR_FRAME_SINK_SUPPORT_CLIENT_H_ | 6 #define CC_TEST_FAKE_COMPOSITOR_FRAME_SINK_SUPPORT_CLIENT_H_ |
| 7 | 7 |
| 8 #include "cc/surfaces/compositor_frame_sink_support_client.h" | 8 #include "cc/surfaces/compositor_frame_sink_support_client.h" |
| 9 #include "cc/surfaces/local_surface_id.h" | 9 #include "cc/surfaces/local_surface_id.h" |
| 10 #include "ui/gfx/geometry/rect.h" | 10 #include "ui/gfx/geometry/rect.h" |
| 11 | 11 |
| 12 namespace cc { | 12 namespace cc { |
| 13 | 13 |
| 14 class FakeCompositorFrameSinkSupportClient | 14 class FakeCompositorFrameSinkSupportClient |
| 15 : public CompositorFrameSinkSupportClient { | 15 : public CompositorFrameSinkSupportClient { |
| 16 public: | 16 public: |
| 17 FakeCompositorFrameSinkSupportClient(); | 17 FakeCompositorFrameSinkSupportClient(); |
| 18 ~FakeCompositorFrameSinkSupportClient() override; | 18 ~FakeCompositorFrameSinkSupportClient() override; |
| 19 | 19 |
| 20 // CompositorFrameSinkSupportClient implementation. | 20 // CompositorFrameSinkSupportClient implementation. |
| 21 void DidReceiveCompositorFrameAck( | 21 void DidReceiveCompositorFrameAck( |
| 22 const ReturnedResourceArray& resources) override; | 22 const ReturnedResourceArray& resources) override; |
| 23 void OnBeginFrame(const BeginFrameArgs& args) override; | 23 void OnBeginFrame(const BeginFrameArgs& args) override; |
| 24 void ReclaimResources(const ReturnedResourceArray& resources) override; | 24 void ReclaimResources(const ReturnedResourceArray& resources) override; |
| 25 void WillDrawSurface(const LocalSurfaceId& local_surface_id, | 25 void WillDrawSurface(const LocalSurfaceId& local_surface_id, |
| 26 const gfx::Rect& damage_rect) override; | 26 const gfx::Rect& damage_rect) override; |
| 27 void DidRejectCompositorFrame() override; |
| 27 | 28 |
| 28 const gfx::Rect& last_damage_rect() const { return last_damage_rect_; } | 29 const gfx::Rect& last_damage_rect() const { return last_damage_rect_; } |
| 29 const LocalSurfaceId& last_local_surface_id() const { | 30 const LocalSurfaceId& last_local_surface_id() const { |
| 30 return last_local_surface_id_; | 31 return last_local_surface_id_; |
| 31 } | 32 } |
| 32 const ReturnedResourceArray& returned_resources() const { | 33 const ReturnedResourceArray& returned_resources() const { |
| 33 return returned_resources_; | 34 return returned_resources_; |
| 34 } | 35 } |
| 35 | 36 |
| 36 private: | 37 private: |
| 37 gfx::Rect last_damage_rect_; | 38 gfx::Rect last_damage_rect_; |
| 38 LocalSurfaceId last_local_surface_id_; | 39 LocalSurfaceId last_local_surface_id_; |
| 39 ReturnedResourceArray returned_resources_; | 40 ReturnedResourceArray returned_resources_; |
| 40 | 41 |
| 41 DISALLOW_COPY_AND_ASSIGN(FakeCompositorFrameSinkSupportClient); | 42 DISALLOW_COPY_AND_ASSIGN(FakeCompositorFrameSinkSupportClient); |
| 42 }; | 43 }; |
| 43 | 44 |
| 44 } // namespace cc | 45 } // namespace cc |
| 45 | 46 |
| 46 #endif // CC_TEST_FAKE_COMPOSITOR_FRAME_SINK_SUPPORT_CLIENT_H_ | 47 #endif // CC_TEST_FAKE_COMPOSITOR_FRAME_SINK_SUPPORT_CLIENT_H_ |
| OLD | NEW |