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/display.h" | 5 #include "cc/surfaces/display.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/test/null_task_runner.h" | 10 #include "base/test/null_task_runner.h" |
11 #include "cc/output/compositor_frame.h" | 11 #include "cc/output/compositor_frame.h" |
12 #include "cc/output/copy_output_result.h" | 12 #include "cc/output/copy_output_result.h" |
13 #include "cc/output/texture_mailbox_deleter.h" | 13 #include "cc/output/texture_mailbox_deleter.h" |
14 #include "cc/quads/render_pass.h" | 14 #include "cc/quads/render_pass.h" |
15 #include "cc/resources/shared_bitmap_manager.h" | 15 #include "cc/resources/shared_bitmap_manager.h" |
16 #include "cc/scheduler/begin_frame_source.h" | 16 #include "cc/scheduler/begin_frame_source.h" |
17 #include "cc/surfaces/display_client.h" | 17 #include "cc/surfaces/display_client.h" |
18 #include "cc/surfaces/display_scheduler.h" | 18 #include "cc/surfaces/display_scheduler.h" |
19 #include "cc/surfaces/frame_sink_id.h" | 19 #include "cc/surfaces/frame_sink_id.h" |
| 20 #include "cc/surfaces/local_surface_id_allocator.h" |
20 #include "cc/surfaces/surface.h" | 21 #include "cc/surfaces/surface.h" |
21 #include "cc/surfaces/surface_factory.h" | 22 #include "cc/surfaces/surface_factory.h" |
22 #include "cc/surfaces/surface_factory_client.h" | 23 #include "cc/surfaces/surface_factory_client.h" |
23 #include "cc/surfaces/surface_id_allocator.h" | |
24 #include "cc/surfaces/surface_manager.h" | 24 #include "cc/surfaces/surface_manager.h" |
25 #include "cc/test/fake_output_surface.h" | 25 #include "cc/test/fake_output_surface.h" |
26 #include "cc/test/scheduler_test_common.h" | 26 #include "cc/test/scheduler_test_common.h" |
27 #include "cc/test/test_shared_bitmap_manager.h" | 27 #include "cc/test/test_shared_bitmap_manager.h" |
28 #include "gpu/GLES2/gl2extchromium.h" | 28 #include "gpu/GLES2/gl2extchromium.h" |
29 #include "testing/gmock/include/gmock/gmock.h" | 29 #include "testing/gmock/include/gmock/gmock.h" |
30 #include "testing/gtest/include/gtest/gtest.h" | 30 #include "testing/gtest/include/gtest/gtest.h" |
31 | 31 |
32 using testing::AnyNumber; | 32 using testing::AnyNumber; |
33 | 33 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 CompositorFrame frame; | 144 CompositorFrame frame; |
145 pass_list->swap(frame.render_pass_list); | 145 pass_list->swap(frame.render_pass_list); |
146 | 146 |
147 factory_.SubmitCompositorFrame(local_surface_id, std::move(frame), | 147 factory_.SubmitCompositorFrame(local_surface_id, std::move(frame), |
148 SurfaceFactory::DrawCallback()); | 148 SurfaceFactory::DrawCallback()); |
149 } | 149 } |
150 | 150 |
151 SurfaceManager manager_; | 151 SurfaceManager manager_; |
152 FakeSurfaceFactoryClient surface_factory_client_; | 152 FakeSurfaceFactoryClient surface_factory_client_; |
153 SurfaceFactory factory_; | 153 SurfaceFactory factory_; |
154 SurfaceIdAllocator id_allocator_; | 154 LocalSurfaceIdAllocator id_allocator_; |
155 scoped_refptr<base::NullTaskRunner> task_runner_; | 155 scoped_refptr<base::NullTaskRunner> task_runner_; |
156 TestSharedBitmapManager shared_bitmap_manager_; | 156 TestSharedBitmapManager shared_bitmap_manager_; |
157 std::unique_ptr<BeginFrameSource> begin_frame_source_; | 157 std::unique_ptr<BeginFrameSource> begin_frame_source_; |
158 std::unique_ptr<Display> display_; | 158 std::unique_ptr<Display> display_; |
159 TestSoftwareOutputDevice* software_output_device_ = nullptr; | 159 TestSoftwareOutputDevice* software_output_device_ = nullptr; |
160 FakeOutputSurface* output_surface_ = nullptr; | 160 FakeOutputSurface* output_surface_ = nullptr; |
161 TestDisplayScheduler* scheduler_ = nullptr; | 161 TestDisplayScheduler* scheduler_ = nullptr; |
162 }; | 162 }; |
163 | 163 |
164 class StubDisplayClient : public DisplayClient { | 164 class StubDisplayClient : public DisplayClient { |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 // Verify DidLoseOutputSurface callback is hooked up correctly. | 515 // Verify DidLoseOutputSurface callback is hooked up correctly. |
516 EXPECT_EQ(0, client.loss_count()); | 516 EXPECT_EQ(0, client.loss_count()); |
517 output_surface_->context_provider()->ContextGL()->LoseContextCHROMIUM( | 517 output_surface_->context_provider()->ContextGL()->LoseContextCHROMIUM( |
518 GL_GUILTY_CONTEXT_RESET_ARB, GL_INNOCENT_CONTEXT_RESET_ARB); | 518 GL_GUILTY_CONTEXT_RESET_ARB, GL_INNOCENT_CONTEXT_RESET_ARB); |
519 output_surface_->context_provider()->ContextGL()->Flush(); | 519 output_surface_->context_provider()->ContextGL()->Flush(); |
520 EXPECT_EQ(1, client.loss_count()); | 520 EXPECT_EQ(1, client.loss_count()); |
521 } | 521 } |
522 | 522 |
523 } // namespace | 523 } // namespace |
524 } // namespace cc | 524 } // namespace cc |
OLD | NEW |