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

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

Issue 2443003004: cc: Make OutputSurface::BindToClient pure virtual and not return bool (Closed)
Patch Set: bindtoclient-pure-virtual: rebase Created 4 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 scoped_refptr<ContextProvider> compositor_context_provider) override { 133 scoped_refptr<ContextProvider> compositor_context_provider) override {
134 if (!use_gl_renderer_) { 134 if (!use_gl_renderer_) {
135 return FakeOutputSurface::CreateSoftware( 135 return FakeOutputSurface::CreateSoftware(
136 base::WrapUnique(new SoftwareOutputDevice)); 136 base::WrapUnique(new SoftwareOutputDevice));
137 } 137 }
138 138
139 scoped_refptr<TestContextProvider> display_context_provider = 139 scoped_refptr<TestContextProvider> display_context_provider =
140 TestContextProvider::Create(); 140 TestContextProvider::Create();
141 TestContextSupport* context_support = display_context_provider->support(); 141 TestContextSupport* context_support = display_context_provider->support();
142 context_support->set_out_of_order_callbacks(out_of_order_callbacks_); 142 context_support->set_out_of_order_callbacks(out_of_order_callbacks_);
143 display_context_provider->BindToCurrentThread();
143 144
144 return FakeOutputSurface::Create3d(std::move(display_context_provider)); 145 return FakeOutputSurface::Create3d(std::move(display_context_provider));
145 } 146 }
146 147
147 bool use_gl_renderer_; 148 bool use_gl_renderer_;
148 bool out_of_order_callbacks_ = false; 149 bool out_of_order_callbacks_ = false;
149 std::map<size_t, gfx::Size> callbacks_; 150 std::map<size_t, gfx::Size> callbacks_;
150 FakeContentLayerClient client_; 151 FakeContentLayerClient client_;
151 scoped_refptr<FakePictureLayer> root; 152 scoped_refptr<FakePictureLayer> root;
152 scoped_refptr<FakePictureLayer> child; 153 scoped_refptr<FakePictureLayer> child;
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 }; 728 };
728 729
729 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestAsyncTwoReadbacksWithoutDraw); 730 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestAsyncTwoReadbacksWithoutDraw);
730 731
731 class LayerTreeHostCopyRequestTestDeleteTexture 732 class LayerTreeHostCopyRequestTestDeleteTexture
732 : public LayerTreeHostCopyRequestTest { 733 : public LayerTreeHostCopyRequestTest {
733 protected: 734 protected:
734 std::unique_ptr<OutputSurface> CreateDisplayOutputSurfaceOnThread( 735 std::unique_ptr<OutputSurface> CreateDisplayOutputSurfaceOnThread(
735 scoped_refptr<ContextProvider> compositor_context_provider) override { 736 scoped_refptr<ContextProvider> compositor_context_provider) override {
736 display_context_provider_ = TestContextProvider::Create(); 737 display_context_provider_ = TestContextProvider::Create();
738 display_context_provider_->BindToCurrentThread();
737 return FakeOutputSurface::Create3d(display_context_provider_); 739 return FakeOutputSurface::Create3d(display_context_provider_);
738 } 740 }
739 741
740 void SetupTree() override { 742 void SetupTree() override {
741 root_ = FakePictureLayer::Create(&client_); 743 root_ = FakePictureLayer::Create(&client_);
742 root_->SetBounds(gfx::Size(20, 20)); 744 root_->SetBounds(gfx::Size(20, 20));
743 745
744 copy_layer_ = FakePictureLayer::Create(&client_); 746 copy_layer_ = FakePictureLayer::Create(&client_);
745 copy_layer_->SetBounds(gfx::Size(10, 10)); 747 copy_layer_->SetBounds(gfx::Size(10, 10));
746 root_->AddChild(copy_layer_); 748 root_->AddChild(copy_layer_);
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
1288 int num_draws_; 1290 int num_draws_;
1289 bool copy_happened_; 1291 bool copy_happened_;
1290 bool draw_happened_; 1292 bool draw_happened_;
1291 }; 1293 };
1292 1294
1293 SINGLE_AND_MULTI_THREAD_TEST_F( 1295 SINGLE_AND_MULTI_THREAD_TEST_F(
1294 LayerTreeHostCopyRequestTestMultipleDrawsHiddenCopyRequest); 1296 LayerTreeHostCopyRequestTestMultipleDrawsHiddenCopyRequest);
1295 1297
1296 } // namespace 1298 } // namespace
1297 } // namespace cc 1299 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | content/browser/compositor/browser_compositor_output_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698