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).
This commit is contained in:
Brian Osman
2017-11-15 13:10:56 -05:00
committed by GitHub
parent 90988d60e1
commit 1d2ad93157

View File

@@ -33,8 +33,11 @@ GPUSurfaceGL::GPUSurfaceGL(GPUSurfaceGLDelegate* delegate)
auto backend_context =
reinterpret_cast<GrBackendContext>(GrGLCreateNativeInterface());
auto context =
sk_sp<GrContext>(GrContext::Create(kOpenGL_GrBackend, backend_context));
GrContextOptions options;
options.fAvoidStencilBuffers = true;
auto context = sk_sp<GrContext>(
GrContext::Create(kOpenGL_GrBackend, backend_context, options));
if (context == nullptr) {
FXL_LOG(ERROR) << "Failed to setup Skia Gr context.";