| 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 12 matching lines...) Expand all Loading... |
| 23 class TestOutputSurface : public OutputSurface { | 23 class TestOutputSurface : public OutputSurface { |
| 24 public: | 24 public: |
| 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, |
| 34 scoped_refptr<ContextProvider>(), |
| 35 software_device.Pass()) {} |
| 34 | 36 |
| 35 void SwapBuffers(CompositorFrame* frame) override { | 37 void SwapBuffers(CompositorFrame* frame) override { |
| 36 client_->DidSwapBuffers(); | 38 client_->DidSwapBuffers(); |
| 37 client_->DidSwapBuffersComplete(); | 39 client_->DidSwapBuffersComplete(); |
| 38 } | 40 } |
| 39 | 41 |
| 40 bool InitializeNewContext3d( | 42 bool InitializeNewContext3d( |
| 41 scoped_refptr<ContextProvider> new_context_provider) { | 43 scoped_refptr<ContextProvider> new_context_provider) { |
| 42 return InitializeAndSetContext3d(new_context_provider); | 44 return InitializeAndSetContext3d(new_context_provider); |
| 43 } | 45 } |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); | 221 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); |
| 220 EXPECT_EQ(0, software_output_device->discard_backbuffer_count()); | 222 EXPECT_EQ(0, software_output_device->discard_backbuffer_count()); |
| 221 output_surface.DiscardBackbuffer(); | 223 output_surface.DiscardBackbuffer(); |
| 222 | 224 |
| 223 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); | 225 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); |
| 224 EXPECT_EQ(1, software_output_device->discard_backbuffer_count()); | 226 EXPECT_EQ(1, software_output_device->discard_backbuffer_count()); |
| 225 } | 227 } |
| 226 | 228 |
| 227 } // namespace | 229 } // namespace |
| 228 } // namespace cc | 230 } // namespace cc |
| OLD | NEW |