| 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" |
| 11 #include "cc/output/copy_output_request.h" | 11 #include "cc/output/copy_output_request.h" |
| 12 #include "cc/output/direct_renderer.h" |
| 12 #include "cc/output/texture_mailbox_deleter.h" | 13 #include "cc/output/texture_mailbox_deleter.h" |
| 13 | 14 |
| 14 static constexpr uint32_t kCompositorClientId = 1; | 15 static constexpr uint32_t kCompositorClientId = 1; |
| 15 | 16 |
| 16 namespace cc { | 17 namespace cc { |
| 17 | 18 |
| 18 TestDelegatingOutputSurface::TestDelegatingOutputSurface( | 19 TestDelegatingOutputSurface::TestDelegatingOutputSurface( |
| 19 scoped_refptr<ContextProvider> compositor_context_provider, | 20 scoped_refptr<ContextProvider> compositor_context_provider, |
| 20 scoped_refptr<ContextProvider> worker_context_provider, | 21 scoped_refptr<ContextProvider> worker_context_provider, |
| 21 std::unique_ptr<OutputSurface> display_output_surface, | 22 std::unique_ptr<OutputSurface> display_output_surface, |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 // false), we should not be listening for lost context callbacks on the | 86 // false), we should not be listening for lost context callbacks on the |
| 86 // context here. | 87 // context here. |
| 87 if (!capabilities_.delegated_sync_points_required && context_provider()) | 88 if (!capabilities_.delegated_sync_points_required && context_provider()) |
| 88 context_provider()->SetLostContextCallback(base::Closure()); | 89 context_provider()->SetLostContextCallback(base::Closure()); |
| 89 | 90 |
| 90 surface_manager_->RegisterSurfaceClientId(surface_id_allocator_->client_id()); | 91 surface_manager_->RegisterSurfaceClientId(surface_id_allocator_->client_id()); |
| 91 surface_manager_->RegisterSurfaceFactoryClient( | 92 surface_manager_->RegisterSurfaceFactoryClient( |
| 92 surface_id_allocator_->client_id(), this); | 93 surface_id_allocator_->client_id(), this); |
| 93 display_->Initialize(this, surface_manager_.get(), | 94 display_->Initialize(this, surface_manager_.get(), |
| 94 surface_id_allocator_->client_id()); | 95 surface_id_allocator_->client_id()); |
| 96 display_->renderer_for_testing()->SetEnlargePassTextureAmountForTesting( |
| 97 enlarge_pass_texture_amount_); |
| 95 display_->SetVisible(true); | 98 display_->SetVisible(true); |
| 96 bound_ = true; | 99 bound_ = true; |
| 97 return true; | 100 return true; |
| 98 } | 101 } |
| 99 | 102 |
| 100 void TestDelegatingOutputSurface::DetachFromClient() { | 103 void TestDelegatingOutputSurface::DetachFromClient() { |
| 101 // Some tests make BindToClient fail on purpose. ^__^ | 104 // Some tests make BindToClient fail on purpose. ^__^ |
| 102 if (bound_) { | 105 if (bound_) { |
| 103 if (!delegated_surface_id_.is_null()) | 106 if (!delegated_surface_id_.is_null()) |
| 104 surface_factory_->Destroy(delegated_surface_id_); | 107 surface_factory_->Destroy(delegated_surface_id_); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 if (test_client_) | 208 if (test_client_) |
| 206 test_client_->DisplayWillDrawAndSwap(will_draw_and_swap, render_passes); | 209 test_client_->DisplayWillDrawAndSwap(will_draw_and_swap, render_passes); |
| 207 } | 210 } |
| 208 | 211 |
| 209 void TestDelegatingOutputSurface::DisplayDidDrawAndSwap() { | 212 void TestDelegatingOutputSurface::DisplayDidDrawAndSwap() { |
| 210 if (test_client_) | 213 if (test_client_) |
| 211 test_client_->DisplayDidDrawAndSwap(); | 214 test_client_->DisplayDidDrawAndSwap(); |
| 212 } | 215 } |
| 213 | 216 |
| 214 } // namespace cc | 217 } // namespace cc |
| OLD | NEW |