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

Unified Diff: content/renderer/renderer_blink_platform_impl.cc

Issue 2107783003: Pass initial size and GPU preference via context attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gyp fix Created 4 years, 6 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_thread_impl.cc ('k') | content/test/layouttest_support.cc » ('j') | 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 bbce2eb1e8a7afb098738281d93b80a68e1b3877..3be83f9411f5dcad685348b30dabe5ac5947cc32 100644
--- a/content/renderer/renderer_blink_platform_impl.cc
+++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -1085,6 +1085,8 @@ RendererBlinkPlatformImpl::createOffscreenGraphicsContext3DProvider(
attributes.samples = 0;
attributes.sample_buffers = 0;
attributes.bind_generates_resource = false;
+ // Prefer discrete GPU for WebGL.
+ attributes.gpu_preference = gl::PreferDiscreteGpu;
attributes.fail_if_major_perf_caveat =
web_attributes.failIfMajorPerformanceCaveat;
@@ -1097,15 +1099,13 @@ RendererBlinkPlatformImpl::createOffscreenGraphicsContext3DProvider(
constexpr bool automatic_flushes = true;
constexpr bool support_locking = false;
- // Prefer discrete GPU for WebGL.
- constexpr gl::GpuPreference gpu_preference = gl::PreferDiscreteGpu;
scoped_refptr<ContextProviderCommandBuffer> provider(
new ContextProviderCommandBuffer(
std::move(gpu_channel_host), gpu::GPU_STREAM_DEFAULT,
gpu::GpuStreamPriority::NORMAL, gpu::kNullSurfaceHandle,
- GURL(top_document_web_url), gpu_preference, automatic_flushes,
- support_locking, gpu::SharedMemoryLimits(), attributes, share_context,
+ GURL(top_document_web_url), automatic_flushes, support_locking,
+ gpu::SharedMemoryLimits(), attributes, share_context,
command_buffer_metrics::OFFSCREEN_CONTEXT_FOR_WEBGL));
return new WebGraphicsContext3DProviderImpl(std::move(provider));
}
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | content/test/layouttest_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698