| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <cmath> | 10 #include <cmath> |
| (...skipping 8741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8752 | 8752 |
| 8753 private: | 8753 private: |
| 8754 scoped_refptr<ContextProvider> display_context_provider_; | 8754 scoped_refptr<ContextProvider> display_context_provider_; |
| 8755 }; | 8755 }; |
| 8756 | 8756 |
| 8757 TEST_F(LayerTreeHostImplTest, ShutdownReleasesContext) { | 8757 TEST_F(LayerTreeHostImplTest, ShutdownReleasesContext) { |
| 8758 scoped_refptr<TestContextProvider> context_provider = | 8758 scoped_refptr<TestContextProvider> context_provider = |
| 8759 TestContextProvider::Create(); | 8759 TestContextProvider::Create(); |
| 8760 FrameSinkClient test_client_(context_provider); | 8760 FrameSinkClient test_client_(context_provider); |
| 8761 | 8761 |
| 8762 constexpr bool synchronous_composite = true; |
| 8763 constexpr bool disable_display_vsync = false; |
| 8762 auto compositor_frame_sink = base::MakeUnique<TestCompositorFrameSink>( | 8764 auto compositor_frame_sink = base::MakeUnique<TestCompositorFrameSink>( |
| 8763 context_provider, TestContextProvider::CreateWorker(), nullptr, nullptr, | 8765 context_provider, TestContextProvider::CreateWorker(), nullptr, nullptr, |
| 8764 RendererSettings(), base::ThreadTaskRunnerHandle::Get().get(), | 8766 RendererSettings(), base::ThreadTaskRunnerHandle::Get().get(), |
| 8765 true /* synchronous_composite */); | 8767 synchronous_composite, disable_display_vsync); |
| 8766 compositor_frame_sink->SetClient(&test_client_); | 8768 compositor_frame_sink->SetClient(&test_client_); |
| 8767 | 8769 |
| 8768 CreateHostImpl(DefaultSettings(), std::move(compositor_frame_sink)); | 8770 CreateHostImpl(DefaultSettings(), std::move(compositor_frame_sink)); |
| 8769 | 8771 |
| 8770 SetupRootLayerImpl(LayerImpl::Create(host_impl_->active_tree(), 1)); | 8772 SetupRootLayerImpl(LayerImpl::Create(host_impl_->active_tree(), 1)); |
| 8771 | 8773 |
| 8772 LayerImpl* root = host_impl_->active_tree()->root_layer_for_testing(); | 8774 LayerImpl* root = host_impl_->active_tree()->root_layer_for_testing(); |
| 8773 root->test_properties()->copy_requests.push_back( | 8775 root->test_properties()->copy_requests.push_back( |
| 8774 CopyOutputRequest::CreateRequest( | 8776 CopyOutputRequest::CreateRequest( |
| 8775 base::Bind(&ShutdownReleasesContext_Callback))); | 8777 base::Bind(&ShutdownReleasesContext_Callback))); |
| (...skipping 3589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12365 else | 12367 else |
| 12366 EXPECT_FALSE(tile->HasRasterTask()); | 12368 EXPECT_FALSE(tile->HasRasterTask()); |
| 12367 } | 12369 } |
| 12368 Region expected_invalidation( | 12370 Region expected_invalidation( |
| 12369 raster_source->GetRectForImage(checkerable_image->uniqueID())); | 12371 raster_source->GetRectForImage(checkerable_image->uniqueID())); |
| 12370 EXPECT_EQ(expected_invalidation, *(root->GetPendingInvalidation())); | 12372 EXPECT_EQ(expected_invalidation, *(root->GetPendingInvalidation())); |
| 12371 } | 12373 } |
| 12372 | 12374 |
| 12373 } // namespace | 12375 } // namespace |
| 12374 } // namespace cc | 12376 } // namespace cc |
| OLD | NEW |