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 14 matching lines...) Expand all Loading... |
25 explicit TestOutputSurface(scoped_refptr<ContextProvider> context_provider) | 25 explicit TestOutputSurface(scoped_refptr<ContextProvider> context_provider) |
26 : OutputSurface(context_provider) {} | 26 : OutputSurface(context_provider) {} |
27 | 27 |
28 explicit TestOutputSurface(scoped_ptr<SoftwareOutputDevice> software_device) | 28 explicit TestOutputSurface(scoped_ptr<SoftwareOutputDevice> software_device) |
29 : OutputSurface(software_device.Pass()) {} | 29 : OutputSurface(software_device.Pass()) {} |
30 | 30 |
31 TestOutputSurface(scoped_refptr<ContextProvider> context_provider, | 31 TestOutputSurface(scoped_refptr<ContextProvider> context_provider, |
32 scoped_ptr<SoftwareOutputDevice> software_device) | 32 scoped_ptr<SoftwareOutputDevice> software_device) |
33 : OutputSurface(context_provider, software_device.Pass()) {} | 33 : OutputSurface(context_provider, software_device.Pass()) {} |
34 | 34 |
| 35 virtual void SwapBuffers(CompositorFrame* frame) override { |
| 36 client_->DidSwapBuffers(); |
| 37 client_->DidSwapBuffersComplete(); |
| 38 } |
| 39 |
35 bool InitializeNewContext3d( | 40 bool InitializeNewContext3d( |
36 scoped_refptr<ContextProvider> new_context_provider) { | 41 scoped_refptr<ContextProvider> new_context_provider) { |
37 return InitializeAndSetContext3d(new_context_provider); | 42 return InitializeAndSetContext3d(new_context_provider); |
38 } | 43 } |
39 | 44 |
40 using OutputSurface::ReleaseGL; | 45 using OutputSurface::ReleaseGL; |
41 | 46 |
42 void CommitVSyncParametersForTesting(base::TimeTicks timebase, | 47 void CommitVSyncParametersForTesting(base::TimeTicks timebase, |
43 base::TimeDelta interval) { | 48 base::TimeDelta interval) { |
44 CommitVSyncParameters(timebase, interval); | 49 CommitVSyncParameters(timebase, interval); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); | 223 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); |
219 EXPECT_EQ(0, software_output_device->discard_backbuffer_count()); | 224 EXPECT_EQ(0, software_output_device->discard_backbuffer_count()); |
220 output_surface.DiscardBackbuffer(); | 225 output_surface.DiscardBackbuffer(); |
221 | 226 |
222 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); | 227 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); |
223 EXPECT_EQ(1, software_output_device->discard_backbuffer_count()); | 228 EXPECT_EQ(1, software_output_device->discard_backbuffer_count()); |
224 } | 229 } |
225 | 230 |
226 } // namespace | 231 } // namespace |
227 } // namespace cc | 232 } // namespace cc |
OLD | NEW |