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/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/test/test_simple_task_runner.h" | 8 #include "base/test/test_simple_task_runner.h" |
9 #include "cc/output/managed_memory_policy.h" | 9 #include "cc/output/managed_memory_policy.h" |
10 #include "cc/output/output_surface_client.h" | 10 #include "cc/output/output_surface_client.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 TestOutputSurface(scoped_refptr<ContextProvider> context_provider, | 36 TestOutputSurface(scoped_refptr<ContextProvider> context_provider, |
37 std::unique_ptr<SoftwareOutputDevice> software_device) | 37 std::unique_ptr<SoftwareOutputDevice> software_device) |
38 : OutputSurface(context_provider, std::move(software_device)) {} | 38 : OutputSurface(context_provider, std::move(software_device)) {} |
39 | 39 |
40 void SwapBuffers(CompositorFrame* frame) override { | 40 void SwapBuffers(CompositorFrame* frame) override { |
41 client_->DidSwapBuffers(); | 41 client_->DidSwapBuffers(); |
42 client_->DidSwapBuffersComplete(); | 42 client_->DidSwapBuffersComplete(); |
43 } | 43 } |
44 | 44 |
45 void CommitVSyncParametersForTesting(base::TimeTicks timebase, | |
46 base::TimeDelta interval) { | |
47 CommitVSyncParameters(timebase, interval); | |
48 } | |
49 | |
50 void DidSwapBuffersForTesting() { client_->DidSwapBuffers(); } | 45 void DidSwapBuffersForTesting() { client_->DidSwapBuffers(); } |
51 | 46 |
52 void OnSwapBuffersCompleteForTesting() { client_->DidSwapBuffersComplete(); } | 47 void OnSwapBuffersCompleteForTesting() { client_->DidSwapBuffersComplete(); } |
53 | 48 |
54 protected: | 49 protected: |
55 }; | 50 }; |
56 | 51 |
57 class TestSoftwareOutputDevice : public SoftwareOutputDevice { | 52 class TestSoftwareOutputDevice : public SoftwareOutputDevice { |
58 public: | 53 public: |
59 TestSoftwareOutputDevice(); | 54 TestSoftwareOutputDevice(); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); | 164 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); |
170 EXPECT_EQ(0, software_output_device->discard_backbuffer_count()); | 165 EXPECT_EQ(0, software_output_device->discard_backbuffer_count()); |
171 output_surface.DiscardBackbuffer(); | 166 output_surface.DiscardBackbuffer(); |
172 | 167 |
173 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); | 168 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); |
174 EXPECT_EQ(1, software_output_device->discard_backbuffer_count()); | 169 EXPECT_EQ(1, software_output_device->discard_backbuffer_count()); |
175 } | 170 } |
176 | 171 |
177 } // namespace | 172 } // namespace |
178 } // namespace cc | 173 } // namespace cc |
OLD | NEW |