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 11 matching lines...) Expand all Loading... |
22 class TestOutputSurface : public OutputSurface { | 22 class TestOutputSurface : public OutputSurface { |
23 public: | 23 public: |
24 explicit TestOutputSurface(scoped_refptr<ContextProvider> context_provider) | 24 explicit TestOutputSurface(scoped_refptr<ContextProvider> context_provider) |
25 : OutputSurface(context_provider) {} | 25 : OutputSurface(context_provider) {} |
26 | 26 |
27 TestOutputSurface(scoped_refptr<ContextProvider> context_provider, | 27 TestOutputSurface(scoped_refptr<ContextProvider> context_provider, |
28 scoped_refptr<ContextProvider> worker_context_provider) | 28 scoped_refptr<ContextProvider> worker_context_provider) |
29 : OutputSurface(worker_context_provider) {} | 29 : OutputSurface(worker_context_provider) {} |
30 | 30 |
31 explicit TestOutputSurface(scoped_ptr<SoftwareOutputDevice> software_device) | 31 explicit TestOutputSurface(scoped_ptr<SoftwareOutputDevice> software_device) |
32 : OutputSurface(software_device.Pass()) {} | 32 : OutputSurface(std::move(software_device)) {} |
33 | 33 |
34 TestOutputSurface(scoped_refptr<ContextProvider> context_provider, | 34 TestOutputSurface(scoped_refptr<ContextProvider> context_provider, |
35 scoped_ptr<SoftwareOutputDevice> software_device) | 35 scoped_ptr<SoftwareOutputDevice> software_device) |
36 : OutputSurface(context_provider, software_device.Pass()) {} | 36 : OutputSurface(context_provider, std::move(software_device)) {} |
37 | 37 |
38 void SwapBuffers(CompositorFrame* frame) override { | 38 void SwapBuffers(CompositorFrame* frame) override { |
39 client_->DidSwapBuffers(); | 39 client_->DidSwapBuffers(); |
40 client_->DidSwapBuffersComplete(); | 40 client_->DidSwapBuffersComplete(); |
41 } | 41 } |
42 | 42 |
43 void CommitVSyncParametersForTesting(base::TimeTicks timebase, | 43 void CommitVSyncParametersForTesting(base::TimeTicks timebase, |
44 base::TimeDelta interval) { | 44 base::TimeDelta interval) { |
45 CommitVSyncParameters(timebase, interval); | 45 CommitVSyncParameters(timebase, interval); |
46 } | 46 } |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); | 167 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); |
168 EXPECT_EQ(0, software_output_device->discard_backbuffer_count()); | 168 EXPECT_EQ(0, software_output_device->discard_backbuffer_count()); |
169 output_surface.DiscardBackbuffer(); | 169 output_surface.DiscardBackbuffer(); |
170 | 170 |
171 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); | 171 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); |
172 EXPECT_EQ(1, software_output_device->discard_backbuffer_count()); | 172 EXPECT_EQ(1, software_output_device->discard_backbuffer_count()); |
173 } | 173 } |
174 | 174 |
175 } // namespace | 175 } // namespace |
176 } // namespace cc | 176 } // namespace cc |
OLD | NEW |