| 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" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "cc/output/begin_frame_args.h" | 15 #include "cc/output/begin_frame_args.h" |
| 16 #include "cc/output/compositor_frame.h" | 16 #include "cc/output/compositor_frame.h" |
| 17 #include "cc/output/compositor_frame_sink.h" | 17 #include "cc/output/compositor_frame_sink.h" |
| 18 #include "cc/output/software_output_device.h" | 18 #include "cc/output/software_output_device.h" |
| 19 #include "cc/test/test_context_provider.h" | 19 #include "cc/test/test_context_provider.h" |
| 20 #include "cc/test/test_gles2_interface.h" | 20 #include "cc/test/test_gles2_interface.h" |
| 21 #include "cc/test/test_gpu_memory_buffer_manager.h" |
| 22 #include "cc/test/test_shared_bitmap_manager.h" |
| 21 #include "cc/test/test_web_graphics_context_3d.h" | 23 #include "cc/test/test_web_graphics_context_3d.h" |
| 22 | 24 |
| 23 namespace cc { | 25 namespace cc { |
| 24 | 26 |
| 25 class FakeCompositorFrameSink : public CompositorFrameSink { | 27 class FakeCompositorFrameSink : public CompositorFrameSink { |
| 26 public: | 28 public: |
| 27 ~FakeCompositorFrameSink() override; | 29 ~FakeCompositorFrameSink() override; |
| 28 | 30 |
| 29 static std::unique_ptr<FakeCompositorFrameSink> Create3d() { | 31 static std::unique_ptr<FakeCompositorFrameSink> Create3d() { |
| 30 return base::WrapUnique(new FakeCompositorFrameSink( | 32 return base::WrapUnique(new FakeCompositorFrameSink( |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 return last_swap_rect_; | 68 return last_swap_rect_; |
| 67 } | 69 } |
| 68 | 70 |
| 69 void ReturnResourcesHeldByParent(); | 71 void ReturnResourcesHeldByParent(); |
| 70 | 72 |
| 71 protected: | 73 protected: |
| 72 FakeCompositorFrameSink( | 74 FakeCompositorFrameSink( |
| 73 scoped_refptr<ContextProvider> context_provider, | 75 scoped_refptr<ContextProvider> context_provider, |
| 74 scoped_refptr<ContextProvider> worker_context_provider); | 76 scoped_refptr<ContextProvider> worker_context_provider); |
| 75 | 77 |
| 78 TestGpuMemoryBufferManager test_gpu_memory_buffer_manager_; |
| 79 TestSharedBitmapManager test_shared_bitmap_manager_; |
| 80 |
| 76 std::unique_ptr<CompositorFrame> last_sent_frame_; | 81 std::unique_ptr<CompositorFrame> last_sent_frame_; |
| 77 size_t num_sent_frames_ = 0; | 82 size_t num_sent_frames_ = 0; |
| 78 TransferableResourceArray resources_held_by_parent_; | 83 TransferableResourceArray resources_held_by_parent_; |
| 79 bool last_swap_rect_valid_ = false; | 84 bool last_swap_rect_valid_ = false; |
| 80 gfx::Rect last_swap_rect_; | 85 gfx::Rect last_swap_rect_; |
| 81 | 86 |
| 82 private: | 87 private: |
| 83 void DidReceiveCompositorFrameAck(); | 88 void DidReceiveCompositorFrameAck(); |
| 84 | 89 |
| 85 base::WeakPtrFactory<FakeCompositorFrameSink> weak_ptr_factory_; | 90 base::WeakPtrFactory<FakeCompositorFrameSink> weak_ptr_factory_; |
| 86 }; | 91 }; |
| 87 | 92 |
| 88 } // namespace cc | 93 } // namespace cc |
| 89 | 94 |
| 90 #endif // CC_TEST_FAKE_COMPOSITOR_FRAME_SINK_H_ | 95 #endif // CC_TEST_FAKE_COMPOSITOR_FRAME_SINK_H_ |
| OLD | NEW |