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

Unified Diff: content/browser/gpu/gpu_ipc_browsertests.cc

Issue 1807813002: Remove WebGraphicsContext3D dependency in gpu_context_tests.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wgc3d-unused
Patch Set: Created 4 years, 9 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 | « no previous file | content/common/gpu/client/gpu_context_tests.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/gpu_ipc_browsertests.cc
diff --git a/content/browser/gpu/gpu_ipc_browsertests.cc b/content/browser/gpu/gpu_ipc_browsertests.cc
index 3862531389b66e7dd6f530f922ac5a4e211c53aa..9a3262dd880108094d7864d81f15a55d5703f123 100644
--- a/content/browser/gpu/gpu_ipc_browsertests.cc
+++ b/content/browser/gpu/gpu_ipc_browsertests.cc
@@ -39,36 +39,43 @@ class ContextTestBase : public content::ContentBrowserTest {
content::BrowserGpuChannelHostFactory* factory =
content::BrowserGpuChannelHostFactory::instance();
CHECK(factory);
- bool lose_context_when_out_of_memory = false;
base::RunLoop run_loop;
factory->EstablishGpuChannel(kInitCause, run_loop.QuitClosure());
run_loop.Run();
scoped_refptr<content::GpuChannelHost>
gpu_channel_host(factory->GetGpuChannel());
- DCHECK(gpu_channel_host.get());
- context_.reset(
+ CHECK(gpu_channel_host.get());
+
+ bool lose_context_when_out_of_memory = false;
+ scoped_ptr<WebGraphicsContext3DCommandBufferImpl> web_context(
WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext(
- gpu_channel_host.get(),
- blink::WebGraphicsContext3D::Attributes(),
- lose_context_when_out_of_memory,
- GURL(),
+ gpu_channel_host.get(), blink::WebGraphicsContext3D::Attributes(),
+ lose_context_when_out_of_memory, GURL(),
WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(),
- NULL));
- CHECK(context_.get());
- context_->InitializeOnCurrentThread();
- context_support_ = context_->GetContextSupport();
+ nullptr));
+
+ provider_ = content::ContextProviderCommandBuffer::Create(
+ std::move(web_context), content::OFFSCREEN_CONTEXT_FOR_TESTING);
+ bool bound = provider_->BindToCurrentThread();
+ CHECK(bound);
+ gl_ = provider_->ContextGL();
+ context_support_ = provider_->ContextSupport();
+
ContentBrowserTest::SetUpOnMainThread();
}
void TearDownOnMainThread() override {
// Must delete the context first.
- context_.reset(NULL);
+ provider_ = nullptr;
ContentBrowserTest::TearDownOnMainThread();
}
protected:
- scoped_ptr<content::WebGraphicsContext3DCommandBufferImpl> context_;
+ gpu::gles2::GLES2Interface* gl_;
gpu::ContextSupport* context_support_;
+
+ private:
+ scoped_refptr<content::ContextProviderCommandBuffer> provider_;
};
} // namespace
« no previous file with comments | « no previous file | content/common/gpu/client/gpu_context_tests.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698