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

Unified Diff: cc/test/test_context_provider.cc

Issue 2161323002: cc: Make LayerTreeHostImpl unittests use a delegating output surface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: display-lthi-tests: . Created 4 years, 5 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 b2683aed5f33611fa296b9b09fa8efdcfacd8e36..31ef12e9c55164bc791d9460204204a0358d7f60 100644
--- a/cc/test/test_context_provider.cc
+++ b/cc/test/test_context_provider.cc
@@ -13,6 +13,7 @@
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "cc/test/test_gles2_interface.h"
#include "cc/test/test_web_graphics_context_3d.h"
#include "third_party/skia/include/gpu/GrContext.h"
@@ -38,20 +39,31 @@ scoped_refptr<TestContextProvider> TestContextProvider::CreateWorker() {
// static
scoped_refptr<TestContextProvider> TestContextProvider::Create(
std::unique_ptr<TestWebGraphicsContext3D> context) {
- if (!context)
- return NULL;
- return new TestContextProvider(std::move(context));
+ DCHECK(context);
+ return new TestContextProvider(base::MakeUnique<TestGLES2Interface>(),
+ std::move(context));
+}
+
+// static
+scoped_refptr<TestContextProvider> TestContextProvider::Create(
+ std::unique_ptr<TestGLES2Interface> gl) {
+ DCHECK(gl);
+ return new TestContextProvider(std::move(gl),
+ TestWebGraphicsContext3D::Create());
}
TestContextProvider::TestContextProvider(
+ std::unique_ptr<TestGLES2Interface> gl,
std::unique_ptr<TestWebGraphicsContext3D> context)
: context3d_(std::move(context)),
- context_gl_(new TestGLES2Interface(context3d_.get())),
+ 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_);
}
« 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