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

Unified Diff: content/renderer/renderer_blink_platform_impl.cc

Issue 1936773002: Move attributes and context type out to ContextProviderCommandBuffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rmwgc3d
Patch Set: attributes: rebase 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
« no previous file with comments | « content/renderer/render_widget.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 eb5d4be22d9e8b8b1ae401e78b6fbca857f9efb3..d9c1890086be640f29f8347b494e9b3315742619 100644
--- a/content/renderer/renderer_blink_platform_impl.cc
+++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -1061,11 +1061,12 @@ RendererBlinkPlatformImpl::createOffscreenGraphicsContext3DProvider(
attributes.fail_if_major_perf_caveat =
web_attributes.failIfMajorPerformanceCaveat;
+ DCHECK_GT(web_attributes.webGLVersion, 0u);
DCHECK_LE(web_attributes.webGLVersion, 2u);
- if (web_attributes.webGLVersion == 1)
- attributes.context_type = gpu::gles2::CONTEXT_TYPE_WEBGL1;
- else if (web_attributes.webGLVersion == 2)
+ if (web_attributes.webGLVersion == 2)
attributes.context_type = gpu::gles2::CONTEXT_TYPE_WEBGL2;
+ else
+ attributes.context_type = gpu::gles2::CONTEXT_TYPE_WEBGL1;
bool automatic_flushes = true;
// Prefer discrete GPU for WebGL.
@@ -1076,10 +1077,9 @@ RendererBlinkPlatformImpl::createOffscreenGraphicsContext3DProvider(
new ContextProviderCommandBuffer(
base::WrapUnique(new WebGraphicsContext3DCommandBufferImpl(
gpu::kNullSurfaceHandle, GURL(top_document_web_url),
- std::move(gpu_channel_host), attributes, gpu_preference,
- automatic_flushes)),
- gpu::SharedMemoryLimits(), share_context,
- RENDERER_MAINTHREAD_CONTEXT));
+ std::move(gpu_channel_host), gpu_preference, automatic_flushes)),
+ gpu::SharedMemoryLimits(), attributes, share_context,
+ command_buffer_metrics::OFFSCREEN_CONTEXT_FOR_WEBGL));
if (!provider->BindToCurrentThread()) {
// Collect Graphicsinfo if there is a context failure or it is failed
// purposefully in case of layout tests.
« no previous file with comments | « content/renderer/render_widget.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698