mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Attach a stencil buffer
Skia can go faster (and crashes less) when we have a stencil buffer. Fixes https://github.com/flutter/flutter/issues/1931
This commit is contained in:
parent
ba2590bb29
commit
c773bcac44
@ -49,8 +49,9 @@ void RasterizerDirect::ConnectToRasterizer(
|
||||
}
|
||||
|
||||
void RasterizerDirect::OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget) {
|
||||
surface_ =
|
||||
gfx::GLSurface::CreateViewGLSurface(widget, gfx::SurfaceConfiguration());
|
||||
gfx::SurfaceConfiguration config;
|
||||
config.stencil_bits = 8;
|
||||
surface_ = gfx::GLSurface::CreateViewGLSurface(widget, config);
|
||||
CHECK(surface_) << "GLSurface required.";
|
||||
// Eagerly create the GL context. For a while after the accelerated widget
|
||||
// is first available (after startup), the process is busy setting up dart
|
||||
|
||||
@ -52,12 +52,8 @@ SkCanvas* GaneshCanvas::GetCanvas(int32_t fbo, const SkISize& size) {
|
||||
desc.fWidth = size.width();
|
||||
desc.fHeight = size.height();
|
||||
desc.fConfig = kSkia8888_GrPixelConfig;
|
||||
#if defined(FNL_MUSL)
|
||||
// TODO(kulakowski) This should be handled by MGL
|
||||
desc.fOrigin = kTopLeft_GrSurfaceOrigin;
|
||||
#else
|
||||
desc.fStencilBits = 8;
|
||||
desc.fOrigin = kBottomLeft_GrSurfaceOrigin;
|
||||
#endif
|
||||
desc.fRenderTargetHandle = fbo;
|
||||
|
||||
skia::RefPtr<GrRenderTarget> target = skia::AdoptRef(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user