| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 CompositorFrame* last_sent_frame() { return last_sent_frame_.get(); } | 69 CompositorFrame* last_sent_frame() { return last_sent_frame_.get(); } |
| 70 size_t num_sent_frames() { return num_sent_frames_; } | 70 size_t num_sent_frames() { return num_sent_frames_; } |
| 71 | 71 |
| 72 CompositorFrameSinkClient* client() { return client_; } | 72 CompositorFrameSinkClient* client() { return client_; } |
| 73 | 73 |
| 74 const TransferableResourceArray& resources_held_by_parent() { | 74 const TransferableResourceArray& resources_held_by_parent() { |
| 75 return resources_held_by_parent_; | 75 return resources_held_by_parent_; |
| 76 } | 76 } |
| 77 | 77 |
| 78 gfx::Rect last_swap_rect() const { | 78 gfx::Rect last_swap_rect() const { |
| 79 DCHECK(last_swap_rect_valid_); | |
| 80 return last_swap_rect_; | 79 return last_swap_rect_; |
| 81 } | 80 } |
| 82 | 81 |
| 83 void ReturnResourcesHeldByParent(); | 82 void ReturnResourcesHeldByParent(); |
| 84 | 83 |
| 85 protected: | 84 protected: |
| 86 FakeCompositorFrameSink( | 85 FakeCompositorFrameSink( |
| 87 scoped_refptr<ContextProvider> context_provider, | 86 scoped_refptr<ContextProvider> context_provider, |
| 88 scoped_refptr<ContextProvider> worker_context_provider); | 87 scoped_refptr<ContextProvider> worker_context_provider); |
| 89 | 88 |
| 90 TestGpuMemoryBufferManager test_gpu_memory_buffer_manager_; | 89 TestGpuMemoryBufferManager test_gpu_memory_buffer_manager_; |
| 91 TestSharedBitmapManager test_shared_bitmap_manager_; | 90 TestSharedBitmapManager test_shared_bitmap_manager_; |
| 92 | 91 |
| 93 std::unique_ptr<CompositorFrame> last_sent_frame_; | 92 std::unique_ptr<CompositorFrame> last_sent_frame_; |
| 94 size_t num_sent_frames_ = 0; | 93 size_t num_sent_frames_ = 0; |
| 95 TransferableResourceArray resources_held_by_parent_; | 94 TransferableResourceArray resources_held_by_parent_; |
| 96 bool last_swap_rect_valid_ = false; | |
| 97 gfx::Rect last_swap_rect_; | 95 gfx::Rect last_swap_rect_; |
| 98 | 96 |
| 99 private: | 97 private: |
| 100 void DidReceiveCompositorFrameAck(); | 98 void DidReceiveCompositorFrameAck(); |
| 101 | 99 |
| 102 std::unique_ptr<BeginFrameSource> begin_frame_source_; | 100 std::unique_ptr<BeginFrameSource> begin_frame_source_; |
| 103 base::WeakPtrFactory<FakeCompositorFrameSink> weak_ptr_factory_; | 101 base::WeakPtrFactory<FakeCompositorFrameSink> weak_ptr_factory_; |
| 104 }; | 102 }; |
| 105 | 103 |
| 106 } // namespace cc | 104 } // namespace cc |
| 107 | 105 |
| 108 #endif // CC_TEST_FAKE_COMPOSITOR_FRAME_SINK_H_ | 106 #endif // CC_TEST_FAKE_COMPOSITOR_FRAME_SINK_H_ |
| OLD | NEW |