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

Side by Side Diff: cc/surfaces/display_unittest.cc

Issue 1985973002: Defer compositor context creation to the thread. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: contextfactory: . Created 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/surfaces/display.h" 5 #include "cc/surfaces/display.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/test/null_task_runner.h" 9 #include "base/test/null_task_runner.h"
10 #include "cc/output/compositor_frame.h" 10 #include "cc/output/compositor_frame.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 id_allocator_(kArbitrarySurfaceNamespace), 60 id_allocator_(kArbitrarySurfaceNamespace),
61 software_output_device_(nullptr), 61 software_output_device_(nullptr),
62 task_runner_(new base::NullTaskRunner) { 62 task_runner_(new base::NullTaskRunner) {
63 id_allocator_.RegisterSurfaceIdNamespace(&manager_); 63 id_allocator_.RegisterSurfaceIdNamespace(&manager_);
64 } 64 }
65 65
66 protected: 66 protected:
67 void SetUpContext(std::unique_ptr<TestWebGraphicsContext3D> context) { 67 void SetUpContext(std::unique_ptr<TestWebGraphicsContext3D> context) {
68 if (context) { 68 if (context) {
69 output_surface_ = FakeOutputSurface::Create3d( 69 output_surface_ = FakeOutputSurface::Create3d(
70 TestContextProvider::Create(std::move(context))); 70 base::MakeUnique<TestContextProvider::Factory>(std::move(context)));
71 } else { 71 } else {
72 std::unique_ptr<TestSoftwareOutputDevice> output_device( 72 std::unique_ptr<TestSoftwareOutputDevice> output_device(
73 new TestSoftwareOutputDevice); 73 new TestSoftwareOutputDevice);
74 software_output_device_ = output_device.get(); 74 software_output_device_ = output_device.get();
75 output_surface_ = 75 output_surface_ =
76 FakeOutputSurface::CreateSoftware(std::move(output_device)); 76 FakeOutputSurface::CreateSoftware(std::move(output_device));
77 } 77 }
78 shared_bitmap_manager_.reset(new TestSharedBitmapManager); 78 shared_bitmap_manager_.reset(new TestSharedBitmapManager);
79 output_surface_ptr_ = output_surface_.get(); 79 output_surface_ptr_ = output_surface_.get();
80 } 80 }
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 509
510 EXPECT_CALL(*context_ptr, shallowFinishCHROMIUM()); 510 EXPECT_CALL(*context_ptr, shallowFinishCHROMIUM());
511 display.Resize(gfx::Size(250, 250)); 511 display.Resize(gfx::Size(250, 250));
512 testing::Mock::VerifyAndClearExpectations(context_ptr); 512 testing::Mock::VerifyAndClearExpectations(context_ptr);
513 513
514 factory_.Destroy(surface_id); 514 factory_.Destroy(surface_id);
515 } 515 }
516 516
517 } // namespace 517 } // namespace
518 } // namespace cc 518 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698