| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 FakeOutputSurfaceClient client; | 119 FakeOutputSurfaceClient client; |
| 120 EXPECT_FALSE(output_surface.BindToClient(&client)); | 120 EXPECT_FALSE(output_surface.BindToClient(&client)); |
| 121 EXPECT_FALSE(output_surface.HasClient()); | 121 EXPECT_FALSE(output_surface.HasClient()); |
| 122 } | 122 } |
| 123 | 123 |
| 124 class OutputSurfaceTestInitializeNewContext3d : public ::testing::Test { | 124 class OutputSurfaceTestInitializeNewContext3d : public ::testing::Test { |
| 125 public: | 125 public: |
| 126 OutputSurfaceTestInitializeNewContext3d() | 126 OutputSurfaceTestInitializeNewContext3d() |
| 127 : context_provider_(TestContextProvider::Create()), | 127 : context_provider_(TestContextProvider::Create()), |
| 128 output_surface_( | 128 output_surface_( |
| 129 scoped_ptr<SoftwareOutputDevice>(new SoftwareOutputDevice)) {} | 129 scoped_ptr<SoftwareOutputDevice>(new SoftwareOutputDevice)), |
| 130 client_(&output_surface_) {} |
| 130 | 131 |
| 131 protected: | 132 protected: |
| 132 void BindOutputSurface() { | 133 void BindOutputSurface() { |
| 133 EXPECT_TRUE(output_surface_.BindToClient(&client_)); | 134 EXPECT_TRUE(output_surface_.BindToClient(&client_)); |
| 134 EXPECT_TRUE(output_surface_.HasClient()); | 135 EXPECT_TRUE(output_surface_.HasClient()); |
| 135 } | 136 } |
| 136 | 137 |
| 137 void InitializeNewContextExpectFail() { | 138 void InitializeNewContextExpectFail() { |
| 138 EXPECT_FALSE(output_surface_.InitializeNewContext3d(context_provider_)); | 139 EXPECT_FALSE(output_surface_.InitializeNewContext3d(context_provider_)); |
| 139 EXPECT_TRUE(output_surface_.HasClient()); | 140 EXPECT_TRUE(output_surface_.HasClient()); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); | 220 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); |
| 220 EXPECT_EQ(0, software_output_device->discard_backbuffer_count()); | 221 EXPECT_EQ(0, software_output_device->discard_backbuffer_count()); |
| 221 output_surface.DiscardBackbuffer(); | 222 output_surface.DiscardBackbuffer(); |
| 222 | 223 |
| 223 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); | 224 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); |
| 224 EXPECT_EQ(1, software_output_device->discard_backbuffer_count()); | 225 EXPECT_EQ(1, software_output_device->discard_backbuffer_count()); |
| 225 } | 226 } |
| 226 | 227 |
| 227 } // namespace | 228 } // namespace |
| 228 } // namespace cc | 229 } // namespace cc |
| OLD | NEW |