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

Unified Diff: content/renderer/renderer_blink_platform_impl.cc

Issue 2698573002: Support offscreen contexts which own their backing surface (Closed)
Patch Set: Rebase and retry again Created 3 years, 10 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/public/common/content_features.cc ('k') | gpu/ipc/service/gpu_command_buffer_stub.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 02cff75661bdc9f08724e9d3f56e0f18d3a6ea6c..ed61cd8eea512033476ff67fa45198fe395d2e9b 100644
--- a/content/renderer/renderer_blink_platform_impl.cc
+++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -1013,13 +1013,16 @@ RendererBlinkPlatformImpl::createOffscreenGraphicsContext3DProvider(
bool is_software_rendering = gpu_channel_host->gpu_info().software_rendering;
- // This is an offscreen context, which doesn't use the default frame buffer,
- // so don't request any alpha, depth, stencil, antialiasing.
+ // This is an offscreen context. Generally it won't use the default
+ // frame buffer, in that case don't request any alpha, depth, stencil,
+ // antialiasing. But we do need those attributes for the "own
+ // offscreen surface" optimization which supports directly drawing
+ // to a custom surface backed frame buffer.
gpu::gles2::ContextCreationAttribHelper attributes;
- attributes.alpha_size = -1;
- attributes.depth_size = 0;
- attributes.stencil_size = 0;
- attributes.samples = 0;
+ attributes.alpha_size = web_attributes.supportAlpha ? 8 : -1;
+ attributes.depth_size = web_attributes.supportDepth ? 24 : 0;
+ attributes.stencil_size = web_attributes.supportStencil ? 8 : 0;
+ attributes.samples = web_attributes.supportAntialias ? 4 : 0;
attributes.sample_buffers = 0;
attributes.bind_generates_resource = false;
// Prefer discrete GPU for WebGL.
« no previous file with comments | « content/public/common/content_features.cc ('k') | gpu/ipc/service/gpu_command_buffer_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698