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" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 return InitializeAndSetContext3d(new_context_provider); | 42 return InitializeAndSetContext3d(new_context_provider); |
43 } | 43 } |
44 | 44 |
45 using OutputSurface::ReleaseGL; | 45 using OutputSurface::ReleaseGL; |
46 | 46 |
47 void CommitVSyncParametersForTesting(base::TimeTicks timebase, | 47 void CommitVSyncParametersForTesting(base::TimeTicks timebase, |
48 base::TimeDelta interval) { | 48 base::TimeDelta interval) { |
49 CommitVSyncParameters(timebase, interval); | 49 CommitVSyncParameters(timebase, interval); |
50 } | 50 } |
51 | 51 |
52 void BeginFrameForTesting() { | |
53 client_->BeginFrame(CreateExpiredBeginFrameArgsForTesting()); | |
54 } | |
55 | |
56 void DidSwapBuffersForTesting() { client_->DidSwapBuffers(); } | 52 void DidSwapBuffersForTesting() { client_->DidSwapBuffers(); } |
57 | 53 |
58 void OnSwapBuffersCompleteForTesting() { client_->DidSwapBuffersComplete(); } | 54 void OnSwapBuffersCompleteForTesting() { client_->DidSwapBuffersComplete(); } |
59 | 55 |
60 protected: | 56 protected: |
61 }; | 57 }; |
62 | 58 |
63 class TestSoftwareOutputDevice : public SoftwareOutputDevice { | 59 class TestSoftwareOutputDevice : public SoftwareOutputDevice { |
64 public: | 60 public: |
65 TestSoftwareOutputDevice(); | 61 TestSoftwareOutputDevice(); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); | 219 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); |
224 EXPECT_EQ(0, software_output_device->discard_backbuffer_count()); | 220 EXPECT_EQ(0, software_output_device->discard_backbuffer_count()); |
225 output_surface.DiscardBackbuffer(); | 221 output_surface.DiscardBackbuffer(); |
226 | 222 |
227 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); | 223 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); |
228 EXPECT_EQ(1, software_output_device->discard_backbuffer_count()); | 224 EXPECT_EQ(1, software_output_device->discard_backbuffer_count()); |
229 } | 225 } |
230 | 226 |
231 } // namespace | 227 } // namespace |
232 } // namespace cc | 228 } // namespace cc |
OLD | NEW |