From 1d2ad9315714211db8467b49c07af13593cbbdb6 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Wed, 15 Nov 2017 13:10:56 -0500 Subject: [PATCH] Prevent Skia from trying to use stencil buffers (flutter/engine#4362) Fixes flutter/flutter#13018 When linear blending was disabled, we started rendering directly to FBO0 again. We can't attach stencil there, and the profile graph code triggers a path that (by default) uses it. This option forces us to use alternate rendering methods. Note that the graph rendering code is constructing a fairly complex path. It would probably be much faster to render as a simpler series of drawRect calls for each box (which would get batched inside Skia). --- engine/src/flutter/shell/gpu/gpu_surface_gl.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/shell/gpu/gpu_surface_gl.cc b/engine/src/flutter/shell/gpu/gpu_surface_gl.cc index 92cfd25f19..ee28c97f79 100644 --- a/engine/src/flutter/shell/gpu/gpu_surface_gl.cc +++ b/engine/src/flutter/shell/gpu/gpu_surface_gl.cc @@ -33,8 +33,11 @@ GPUSurfaceGL::GPUSurfaceGL(GPUSurfaceGLDelegate* delegate) auto backend_context = reinterpret_cast(GrGLCreateNativeInterface()); - auto context = - sk_sp(GrContext::Create(kOpenGL_GrBackend, backend_context)); + GrContextOptions options; + options.fAvoidStencilBuffers = true; + + auto context = sk_sp( + GrContext::Create(kOpenGL_GrBackend, backend_context, options)); if (context == nullptr) { FXL_LOG(ERROR) << "Failed to setup Skia Gr context.";