| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/test/test_delegating_output_surface.h" | 5 #include "cc/test/test_delegating_output_surface.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "cc/output/begin_frame_args.h" | 10 #include "cc/output/begin_frame_args.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 // false), we should not be listening for lost context callbacks on the | 85 // false), we should not be listening for lost context callbacks on the |
| 86 // context here. | 86 // context here. |
| 87 if (!capabilities_.delegated_sync_points_required && context_provider()) | 87 if (!capabilities_.delegated_sync_points_required && context_provider()) |
| 88 context_provider()->SetLostContextCallback(base::Closure()); | 88 context_provider()->SetLostContextCallback(base::Closure()); |
| 89 | 89 |
| 90 surface_manager_->RegisterSurfaceClientId(surface_id_allocator_->client_id()); | 90 surface_manager_->RegisterSurfaceClientId(surface_id_allocator_->client_id()); |
| 91 surface_manager_->RegisterSurfaceFactoryClient( | 91 surface_manager_->RegisterSurfaceFactoryClient( |
| 92 surface_id_allocator_->client_id(), this); | 92 surface_id_allocator_->client_id(), this); |
| 93 display_->Initialize(this, surface_manager_.get(), | 93 display_->Initialize(this, surface_manager_.get(), |
| 94 surface_id_allocator_->client_id()); | 94 surface_id_allocator_->client_id()); |
| 95 display_->SetVisible(true); |
| 95 bound_ = true; | 96 bound_ = true; |
| 96 return true; | 97 return true; |
| 97 } | 98 } |
| 98 | 99 |
| 99 void TestDelegatingOutputSurface::DetachFromClient() { | 100 void TestDelegatingOutputSurface::DetachFromClient() { |
| 100 // Some tests make BindToClient fail on purpose. ^__^ | 101 // Some tests make BindToClient fail on purpose. ^__^ |
| 101 if (bound_) { | 102 if (bound_) { |
| 102 if (!delegated_surface_id_.is_null()) | 103 if (!delegated_surface_id_.is_null()) |
| 103 surface_factory_->Destroy(delegated_surface_id_); | 104 surface_factory_->Destroy(delegated_surface_id_); |
| 104 surface_manager_->UnregisterSurfaceFactoryClient( | 105 surface_manager_->UnregisterSurfaceFactoryClient( |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 if (test_client_) | 205 if (test_client_) |
| 205 test_client_->DisplayWillDrawAndSwap(will_draw_and_swap, render_passes); | 206 test_client_->DisplayWillDrawAndSwap(will_draw_and_swap, render_passes); |
| 206 } | 207 } |
| 207 | 208 |
| 208 void TestDelegatingOutputSurface::DisplayDidDrawAndSwap() { | 209 void TestDelegatingOutputSurface::DisplayDidDrawAndSwap() { |
| 209 if (test_client_) | 210 if (test_client_) |
| 210 test_client_->DisplayDidDrawAndSwap(); | 211 test_client_->DisplayDidDrawAndSwap(); |
| 211 } | 212 } |
| 212 | 213 |
| 213 } // namespace cc | 214 } // namespace cc |
| OLD | NEW |