Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Side by Side Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 2854953006: Move disable_display_vsync out of RendererSettings (Closed)
Patch Set: Fix LayoutTestSupport Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 8737 matching lines...) Expand 10 before | Expand all | Expand 10 after
8748 void DisplayReceivedCompositorFrame(const CompositorFrame& frame) override {} 8748 void DisplayReceivedCompositorFrame(const CompositorFrame& frame) override {}
8749 void DisplayWillDrawAndSwap(bool will_draw_and_swap, 8749 void DisplayWillDrawAndSwap(bool will_draw_and_swap,
8750 const RenderPassList& render_passes) override {} 8750 const RenderPassList& render_passes) override {}
8751 void DisplayDidDrawAndSwap() override {} 8751 void DisplayDidDrawAndSwap() override {}
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 constexpr bool kSynchronousComposite = true;
danakj 2017/05/04 15:36:35 can you put these beside where they are used
Alex Z. 2017/05/04 18:41:55 Done.
8759 constexpr bool kDisableDisplayVsync = false;
8758 scoped_refptr<TestContextProvider> context_provider = 8760 scoped_refptr<TestContextProvider> context_provider =
8759 TestContextProvider::Create(); 8761 TestContextProvider::Create();
8760 FrameSinkClient test_client_(context_provider); 8762 FrameSinkClient test_client_(context_provider);
8761 8763
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 kSynchronousComposite, kDisableDisplayVsync);
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698