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

Unified Diff: content/renderer/renderer_blink_platform_impl.cc

Issue 2698573002: Support offscreen contexts which own their backing surface (Closed)
Patch Set: Add missing alpha_size setting 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
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 b267bdba1ce0be729373a7b86a9d650a22d388ce..d3e0fb4f2e7b03c4ae014035f50a7a11a5fc50ef 100644
--- a/content/renderer/renderer_blink_platform_impl.cc
+++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -1017,17 +1017,28 @@ RendererBlinkPlatformImpl::createOffscreenGraphicsContext3DProvider(
// This is an offscreen context, which doesn't use the default frame buffer,
// so don't request any alpha, depth, stencil, antialiasing.
gpu::gles2::ContextCreationAttribHelper attributes;
- attributes.alpha_size = -1;
- attributes.depth_size = 0;
- attributes.stencil_size = 0;
- attributes.samples = 0;
- attributes.sample_buffers = 0;
+
+ if (web_attributes.supportOwnOffscreenSurface) {
aelias_OOO_until_Jul13 2017/02/16 03:25:51 It doesn't look like this outer if statement is ne
klausw 2017/02/16 20:06:57 Done, and also updated the comment above to match
+ attributes.own_offscreen_surface = true;
+ 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;
+ } else {
+ attributes.alpha_size = -1;
+ attributes.depth_size = 0;
+ attributes.stencil_size = 0;
+ 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;
+
aelias_OOO_until_Jul13 2017/02/16 03:25:51 nit: unnecessary newline
klausw 2017/02/16 20:06:57 Done.
DCHECK_GT(web_attributes.webGLVersion, 0u);
DCHECK_LE(web_attributes.webGLVersion, 2u);
if (web_attributes.webGLVersion == 2)

Powered by Google App Engine
This is Rietveld 408576698