OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_H_ | 5 #ifndef CC_TEST_FAKE_COMPOSITOR_FRAME_SINK_H_ |
6 #define CC_TEST_FAKE_COMPOSITOR_FRAME_SINK_H_ | 6 #define CC_TEST_FAKE_COMPOSITOR_FRAME_SINK_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 return base::WrapUnique(new FakeCompositorFrameSink( | 42 return base::WrapUnique(new FakeCompositorFrameSink( |
43 TestContextProvider::Create(std::move(context)), | 43 TestContextProvider::Create(std::move(context)), |
44 TestContextProvider::CreateWorker())); | 44 TestContextProvider::CreateWorker())); |
45 } | 45 } |
46 | 46 |
47 static std::unique_ptr<FakeCompositorFrameSink> CreateSoftware() { | 47 static std::unique_ptr<FakeCompositorFrameSink> CreateSoftware() { |
48 return base::WrapUnique(new FakeCompositorFrameSink(nullptr, nullptr)); | 48 return base::WrapUnique(new FakeCompositorFrameSink(nullptr, nullptr)); |
49 } | 49 } |
50 | 50 |
51 // CompositorFrameSink implementation. | 51 // CompositorFrameSink implementation. |
52 void SwapBuffers(CompositorFrame frame) override; | 52 void SubmitCompositorFrame(CompositorFrame frame) override; |
53 void DetachFromClient() override; | 53 void DetachFromClient() override; |
54 | 54 |
55 CompositorFrame* last_sent_frame() { return last_sent_frame_.get(); } | 55 CompositorFrame* last_sent_frame() { return last_sent_frame_.get(); } |
56 size_t num_sent_frames() { return num_sent_frames_; } | 56 size_t num_sent_frames() { return num_sent_frames_; } |
57 | 57 |
58 CompositorFrameSinkClient* client() { return client_; } | 58 CompositorFrameSinkClient* client() { return client_; } |
59 | 59 |
60 const TransferableResourceArray& resources_held_by_parent() { | 60 const TransferableResourceArray& resources_held_by_parent() { |
61 return resources_held_by_parent_; | 61 return resources_held_by_parent_; |
62 } | 62 } |
(...skipping 10 matching lines...) Expand all Loading... |
73 scoped_refptr<ContextProvider> context_provider, | 73 scoped_refptr<ContextProvider> context_provider, |
74 scoped_refptr<ContextProvider> worker_context_provider); | 74 scoped_refptr<ContextProvider> worker_context_provider); |
75 | 75 |
76 std::unique_ptr<CompositorFrame> last_sent_frame_; | 76 std::unique_ptr<CompositorFrame> last_sent_frame_; |
77 size_t num_sent_frames_ = 0; | 77 size_t num_sent_frames_ = 0; |
78 TransferableResourceArray resources_held_by_parent_; | 78 TransferableResourceArray resources_held_by_parent_; |
79 bool last_swap_rect_valid_ = false; | 79 bool last_swap_rect_valid_ = false; |
80 gfx::Rect last_swap_rect_; | 80 gfx::Rect last_swap_rect_; |
81 | 81 |
82 private: | 82 private: |
83 void SwapBuffersAck(); | 83 void DidReceiveCompositorFrameAck(); |
84 | 84 |
85 base::WeakPtrFactory<FakeCompositorFrameSink> weak_ptr_factory_; | 85 base::WeakPtrFactory<FakeCompositorFrameSink> weak_ptr_factory_; |
86 }; | 86 }; |
87 | 87 |
88 } // namespace cc | 88 } // namespace cc |
89 | 89 |
90 #endif // CC_TEST_FAKE_COMPOSITOR_FRAME_SINK_H_ | 90 #endif // CC_TEST_FAKE_COMPOSITOR_FRAME_SINK_H_ |
OLD | NEW |