OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/output/output_surface.h" | 5 #include "cc/output/output_surface.h" |
6 | 6 |
7 #include "base/test/test_simple_task_runner.h" | 7 #include "base/test/test_simple_task_runner.h" |
8 #include "cc/output/managed_memory_policy.h" | 8 #include "cc/output/managed_memory_policy.h" |
9 #include "cc/output/output_surface_client.h" | 9 #include "cc/output/output_surface_client.h" |
10 #include "cc/output/software_output_device.h" | 10 #include "cc/output/software_output_device.h" |
| 11 #include "cc/test/begin_frame_args_test.h" |
11 #include "cc/test/fake_output_surface.h" | 12 #include "cc/test/fake_output_surface.h" |
12 #include "cc/test/fake_output_surface_client.h" | 13 #include "cc/test/fake_output_surface_client.h" |
13 #include "cc/test/scheduler_test_common.h" | 14 #include "cc/test/scheduler_test_common.h" |
14 #include "cc/test/test_context_provider.h" | 15 #include "cc/test/test_context_provider.h" |
15 #include "cc/test/test_web_graphics_context_3d.h" | 16 #include "cc/test/test_web_graphics_context_3d.h" |
16 #include "gpu/GLES2/gl2extchromium.h" | 17 #include "gpu/GLES2/gl2extchromium.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
18 #include "ui/gfx/frame_time.h" | 19 #include "ui/gfx/frame_time.h" |
19 | 20 |
20 namespace cc { | 21 namespace cc { |
(...skipping 17 matching lines...) Expand all Loading... |
38 } | 39 } |
39 | 40 |
40 using OutputSurface::ReleaseGL; | 41 using OutputSurface::ReleaseGL; |
41 | 42 |
42 void CommitVSyncParametersForTesting(base::TimeTicks timebase, | 43 void CommitVSyncParametersForTesting(base::TimeTicks timebase, |
43 base::TimeDelta interval) { | 44 base::TimeDelta interval) { |
44 CommitVSyncParameters(timebase, interval); | 45 CommitVSyncParameters(timebase, interval); |
45 } | 46 } |
46 | 47 |
47 void BeginFrameForTesting() { | 48 void BeginFrameForTesting() { |
48 client_->BeginFrame(BeginFrameArgs::CreateExpiredForTesting()); | 49 client_->BeginFrame(CreateExpiredBeginFrameArgsForTesting()); |
49 } | 50 } |
50 | 51 |
51 void DidSwapBuffersForTesting() { client_->DidSwapBuffers(); } | 52 void DidSwapBuffersForTesting() { client_->DidSwapBuffers(); } |
52 | 53 |
53 void OnSwapBuffersCompleteForTesting() { client_->DidSwapBuffersComplete(); } | 54 void OnSwapBuffersCompleteForTesting() { client_->DidSwapBuffersComplete(); } |
54 | 55 |
55 protected: | 56 protected: |
56 }; | 57 }; |
57 | 58 |
58 class TestSoftwareOutputDevice : public SoftwareOutputDevice { | 59 class TestSoftwareOutputDevice : public SoftwareOutputDevice { |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); | 219 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); |
219 EXPECT_EQ(0, software_output_device->discard_backbuffer_count()); | 220 EXPECT_EQ(0, software_output_device->discard_backbuffer_count()); |
220 output_surface.DiscardBackbuffer(); | 221 output_surface.DiscardBackbuffer(); |
221 | 222 |
222 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); | 223 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); |
223 EXPECT_EQ(1, software_output_device->discard_backbuffer_count()); | 224 EXPECT_EQ(1, software_output_device->discard_backbuffer_count()); |
224 } | 225 } |
225 | 226 |
226 } // namespace | 227 } // namespace |
227 } // namespace cc | 228 } // namespace cc |
OLD | NEW |