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

Unified Diff: content/renderer/renderer_blink_platform_impl.cc

Issue 1916923004: Request context sharing via content::ContextProviderCommandBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sharegroup: . Created 4 years, 8 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
Index: content/renderer/renderer_blink_platform_impl.cc
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc
index 5a15965bca4fc2599ba4df4c77029a070ebcb442..c9579d60ee0bbec911e01e9e1b93b8efac9abb28 100644
--- a/content/renderer/renderer_blink_platform_impl.cc
+++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -1031,10 +1031,8 @@ RendererBlinkPlatformImpl::createOffscreenGraphicsContext3DProvider(
return nullptr;
}
- WebGraphicsContext3DCommandBufferImpl* share_context =
- share_provider ? static_cast<WebGraphicsContext3DCommandBufferImpl*>(
- share_provider->context3d())
- : nullptr;
+ content::WebGraphicsContext3DProviderImpl* share_provider_impl =
+ static_cast<content::WebGraphicsContext3DProviderImpl*>(share_provider);
// This is an offscreen context, which doesn't use the default frame buffer,
// so don't request any alpha, depth, stencil, antialiasing.
@@ -1054,7 +1052,6 @@ RendererBlinkPlatformImpl::createOffscreenGraphicsContext3DProvider(
else if (web_attributes.webGLVersion == 2)
attributes.context_type = gpu::gles2::CONTEXT_TYPE_WEBGL2;
- bool share_resources = false;
bool automatic_flushes = true;
// Prefer discrete GPU for WebGL.
gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu;
@@ -1064,8 +1061,9 @@ RendererBlinkPlatformImpl::createOffscreenGraphicsContext3DProvider(
base::WrapUnique(new WebGraphicsContext3DCommandBufferImpl(
gpu::kNullSurfaceHandle, GURL(top_document_web_url),
gpu_channel_host.get(), attributes, gpu_preference,
- share_resources, automatic_flushes, share_context)),
- gpu::SharedMemoryLimits(), RENDERER_MAINTHREAD_CONTEXT));
+ automatic_flushes)),
+ gpu::SharedMemoryLimits(), share_provider_impl->context_provider(),
+ RENDERER_MAINTHREAD_CONTEXT));
if (!provider->BindToCurrentThread()) {
// Collect Graphicsinfo if there is a context failure or it is failed
// purposefully in case of layout tests.
@@ -1079,7 +1077,7 @@ RendererBlinkPlatformImpl::createOffscreenGraphicsContext3DProvider(
blink::WebGraphicsContext3DProvider*
RendererBlinkPlatformImpl::createSharedOffscreenGraphicsContext3DProvider() {
- scoped_refptr<cc_blink::ContextProviderWebContext> provider =
+ scoped_refptr<ContextProviderCommandBuffer> provider =
RenderThreadImpl::current()->SharedMainThreadContextProvider();
if (!provider)
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698