OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "cc/surfaces/surface_display_output_surface.h" | 5 #include "cc/surfaces/surface_display_output_surface.h" |
6 | 6 |
| 7 #include <memory> |
| 8 |
7 #include "cc/surfaces/onscreen_display_client.h" | 9 #include "cc/surfaces/onscreen_display_client.h" |
8 #include "cc/surfaces/surface_id_allocator.h" | 10 #include "cc/surfaces/surface_id_allocator.h" |
9 #include "cc/surfaces/surface_manager.h" | 11 #include "cc/surfaces/surface_manager.h" |
10 #include "cc/test/fake_output_surface.h" | 12 #include "cc/test/fake_output_surface.h" |
11 #include "cc/test/fake_output_surface_client.h" | 13 #include "cc/test/fake_output_surface_client.h" |
12 #include "cc/test/ordered_simple_task_runner.h" | 14 #include "cc/test/ordered_simple_task_runner.h" |
13 #include "cc/test/test_context_provider.h" | 15 #include "cc/test/test_context_provider.h" |
14 #include "cc/test/test_gpu_memory_buffer_manager.h" | 16 #include "cc/test/test_gpu_memory_buffer_manager.h" |
15 #include "cc/test/test_shared_bitmap_manager.h" | 17 #include "cc/test/test_shared_bitmap_manager.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 SwapBuffersWithDamage(display_rect_); | 110 SwapBuffersWithDamage(display_rect_); |
109 | 111 |
110 EXPECT_EQ(0u, output_surface_->num_sent_frames()); | 112 EXPECT_EQ(0u, output_surface_->num_sent_frames()); |
111 task_runner_->RunUntilIdle(); | 113 task_runner_->RunUntilIdle(); |
112 EXPECT_EQ(1u, output_surface_->num_sent_frames()); | 114 EXPECT_EQ(1u, output_surface_->num_sent_frames()); |
113 } | 115 } |
114 | 116 |
115 protected: | 117 protected: |
116 std::unique_ptr<base::SimpleTestTickClock> now_src_; | 118 std::unique_ptr<base::SimpleTestTickClock> now_src_; |
117 scoped_refptr<OrderedSimpleTaskRunner> task_runner_; | 119 scoped_refptr<OrderedSimpleTaskRunner> task_runner_; |
118 scoped_ptr<BackToBackBeginFrameSource> begin_frame_source_; | 120 std::unique_ptr<BackToBackBeginFrameSource> begin_frame_source_; |
119 SurfaceIdAllocator allocator_; | 121 SurfaceIdAllocator allocator_; |
120 | 122 |
121 const gfx::Size display_size_; | 123 const gfx::Size display_size_; |
122 const gfx::Rect display_rect_; | 124 const gfx::Rect display_rect_; |
123 FakeOutputSurface* output_surface_; | 125 FakeOutputSurface* output_surface_; |
124 SurfaceManager surface_manager_; | 126 SurfaceManager surface_manager_; |
125 TestSharedBitmapManager bitmap_manager_; | 127 TestSharedBitmapManager bitmap_manager_; |
126 TestGpuMemoryBufferManager gpu_memory_buffer_manager_; | 128 TestGpuMemoryBufferManager gpu_memory_buffer_manager_; |
127 RendererSettings renderer_settings_; | 129 RendererSettings renderer_settings_; |
128 FakeOnscreenDisplayClient display_client_; | 130 FakeOnscreenDisplayClient display_client_; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 EXPECT_EQ(1u, output_surface_->num_sent_frames()); | 172 EXPECT_EQ(1u, output_surface_->num_sent_frames()); |
171 | 173 |
172 SwapBuffersWithDamage(gfx::Rect()); | 174 SwapBuffersWithDamage(gfx::Rect()); |
173 EXPECT_EQ(1u, output_surface_->num_sent_frames()); | 175 EXPECT_EQ(1u, output_surface_->num_sent_frames()); |
174 task_runner_->RunUntilIdle(); | 176 task_runner_->RunUntilIdle(); |
175 EXPECT_EQ(1u, output_surface_->num_sent_frames()); | 177 EXPECT_EQ(1u, output_surface_->num_sent_frames()); |
176 } | 178 } |
177 | 179 |
178 } // namespace | 180 } // namespace |
179 } // namespace cc | 181 } // namespace cc |
OLD | NEW |