| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/surfaces/display.h" | 5 #include "cc/surfaces/display.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/test/null_task_runner.h" | 9 #include "base/test/null_task_runner.h" |
| 10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 id_allocator_(kArbitrarySurfaceNamespace), | 60 id_allocator_(kArbitrarySurfaceNamespace), |
| 61 software_output_device_(nullptr), | 61 software_output_device_(nullptr), |
| 62 task_runner_(new base::NullTaskRunner) { | 62 task_runner_(new base::NullTaskRunner) { |
| 63 id_allocator_.RegisterSurfaceIdNamespace(&manager_); | 63 id_allocator_.RegisterSurfaceIdNamespace(&manager_); |
| 64 } | 64 } |
| 65 | 65 |
| 66 protected: | 66 protected: |
| 67 void SetUpContext(std::unique_ptr<TestWebGraphicsContext3D> context) { | 67 void SetUpContext(std::unique_ptr<TestWebGraphicsContext3D> context) { |
| 68 if (context) { | 68 if (context) { |
| 69 output_surface_ = FakeOutputSurface::Create3d( | 69 output_surface_ = FakeOutputSurface::Create3d( |
| 70 TestContextProvider::Create(std::move(context))); | 70 base::MakeUnique<TestContextProvider::DeferredCreate>( |
| 71 std::move(context))); |
| 71 } else { | 72 } else { |
| 72 std::unique_ptr<TestSoftwareOutputDevice> output_device( | 73 std::unique_ptr<TestSoftwareOutputDevice> output_device( |
| 73 new TestSoftwareOutputDevice); | 74 new TestSoftwareOutputDevice); |
| 74 software_output_device_ = output_device.get(); | 75 software_output_device_ = output_device.get(); |
| 75 output_surface_ = | 76 output_surface_ = |
| 76 FakeOutputSurface::CreateSoftware(std::move(output_device)); | 77 FakeOutputSurface::CreateSoftware(std::move(output_device)); |
| 77 } | 78 } |
| 78 shared_bitmap_manager_.reset(new TestSharedBitmapManager); | 79 shared_bitmap_manager_.reset(new TestSharedBitmapManager); |
| 79 output_surface_ptr_ = output_surface_.get(); | 80 output_surface_ptr_ = output_surface_.get(); |
| 80 } | 81 } |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 | 510 |
| 510 EXPECT_CALL(*context_ptr, shallowFinishCHROMIUM()); | 511 EXPECT_CALL(*context_ptr, shallowFinishCHROMIUM()); |
| 511 display.Resize(gfx::Size(250, 250)); | 512 display.Resize(gfx::Size(250, 250)); |
| 512 testing::Mock::VerifyAndClearExpectations(context_ptr); | 513 testing::Mock::VerifyAndClearExpectations(context_ptr); |
| 513 | 514 |
| 514 factory_.Destroy(surface_id); | 515 factory_.Destroy(surface_id); |
| 515 } | 516 } |
| 516 | 517 |
| 517 } // namespace | 518 } // namespace |
| 518 } // namespace cc | 519 } // namespace cc |
| OLD | NEW |