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

Unified Diff: cc/test/test_context_provider.cc

Issue 2208693003: Revert of cc: Make LayerTreeTests use a DelegatingRenderer and Display. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/test_context_provider.h ('k') | cc/test/test_delegating_output_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/test_context_provider.cc
diff --git a/cc/test/test_context_provider.cc b/cc/test/test_context_provider.cc
index 2634aff5cb567bf4757caefef8c23a8219b7f07a..31ef12e9c55164bc791d9460204204a0358d7f60 100644
--- a/cc/test/test_context_provider.cc
+++ b/cc/test/test_context_provider.cc
@@ -23,17 +23,13 @@
// static
scoped_refptr<TestContextProvider> TestContextProvider::Create() {
- return new TestContextProvider(base::MakeUnique<TestContextSupport>(),
- base::MakeUnique<TestGLES2Interface>(),
- TestWebGraphicsContext3D::Create());
+ return Create(TestWebGraphicsContext3D::Create());
}
// static
scoped_refptr<TestContextProvider> TestContextProvider::CreateWorker() {
- scoped_refptr<TestContextProvider> worker_context_provider(
- new TestContextProvider(base::MakeUnique<TestContextSupport>(),
- base::MakeUnique<TestGLES2Interface>(),
- TestWebGraphicsContext3D::Create()));
+ scoped_refptr<TestContextProvider> worker_context_provider =
+ Create(TestWebGraphicsContext3D::Create());
// Worker contexts are bound to the thread they are created on.
if (!worker_context_provider->BindToCurrentThread())
return nullptr;
@@ -44,8 +40,7 @@
scoped_refptr<TestContextProvider> TestContextProvider::Create(
std::unique_ptr<TestWebGraphicsContext3D> context) {
DCHECK(context);
- return new TestContextProvider(base::MakeUnique<TestContextSupport>(),
- base::MakeUnique<TestGLES2Interface>(),
+ return new TestContextProvider(base::MakeUnique<TestGLES2Interface>(),
std::move(context));
}
@@ -53,36 +48,23 @@
scoped_refptr<TestContextProvider> TestContextProvider::Create(
std::unique_ptr<TestGLES2Interface> gl) {
DCHECK(gl);
- return new TestContextProvider(base::MakeUnique<TestContextSupport>(),
- std::move(gl),
+ return new TestContextProvider(std::move(gl),
TestWebGraphicsContext3D::Create());
}
-// static
-scoped_refptr<TestContextProvider> TestContextProvider::Create(
- std::unique_ptr<TestWebGraphicsContext3D> context,
- std::unique_ptr<TestContextSupport> support) {
- DCHECK(context);
- DCHECK(support);
- return new TestContextProvider(std::move(support),
- base::MakeUnique<TestGLES2Interface>(),
- std::move(context));
-}
-
TestContextProvider::TestContextProvider(
- std::unique_ptr<TestContextSupport> support,
std::unique_ptr<TestGLES2Interface> gl,
std::unique_ptr<TestWebGraphicsContext3D> context)
- : support_(std::move(support)),
- context3d_(std::move(context)),
+ : context3d_(std::move(context)),
context_gl_(std::move(gl)),
+ bound_(false),
weak_ptr_factory_(this) {
DCHECK(main_thread_checker_.CalledOnValidThread());
DCHECK(context3d_);
DCHECK(context_gl_);
context_thread_checker_.DetachFromThread();
context_gl_->set_test_context(context3d_.get());
- context3d_->set_test_support(support_.get());
+ context3d_->set_test_support(&support_);
}
TestContextProvider::~TestContextProvider() {
@@ -128,7 +110,7 @@
}
gpu::ContextSupport* TestContextProvider::ContextSupport() {
- return support();
+ return &support_;
}
class GrContext* TestContextProvider::GrContext() {
« no previous file with comments | « cc/test/test_context_provider.h ('k') | cc/test/test_delegating_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698