Soft revert of 3a0d0b6e36deebc6d477daee9a3cc4dbd09a7900 (flutter/engine#32465)

This commit is contained in:
Dan Field 2022-04-07 09:22:08 -07:00 committed by GitHub
parent 6253744e5b
commit ec99c09baf
5 changed files with 11 additions and 5 deletions

View File

@ -19,6 +19,12 @@ GrContextOptions MakeDefaultContextOptions(ContextType type,
options.fPersistentCache = PersistentCache::GetCacheForProcess();
if (api.has_value() && api.value() == GrBackendApi::kOpenGL) {
// Using stencil buffers has caused memory and performance regressions.
// See b/226484927 for internal customer regressions doc.
// Before enabling, we need to show a motivating case for where it will
// improve performance on OpenGL backend.
options.fAvoidStencilBuffers = true;
// To get video playback on the widest range of devices, we limit Skia to
// ES2 shading language when the ES3 external image extension is missing.
options.fPreferExternalImagesOverES3 = true;

View File

@ -9,10 +9,10 @@
namespace flutter {
namespace testing {
TEST(ContextOptionsTest, OpenGLAllowsStencilBuffers) {
TEST(ContextOptionsTest, OpenGLDisablesStencilBuffers) {
auto options = MakeDefaultContextOptions(flutter::ContextType::kRender,
GrBackendApi::kOpenGL);
EXPECT_FALSE(options.fAvoidStencilBuffers);
EXPECT_TRUE(options.fAvoidStencilBuffers);
}
} // namespace testing

View File

@ -139,7 +139,7 @@ static sk_sp<SkSurface> WrapOnscreenSurface(GrDirectContext* context,
GrBackendRenderTarget render_target(size.width(), // width
size.height(), // height
0, // sample count
8, // stencil bits
0, // stencil bits
framebuffer_info // framebuffer info
);

View File

@ -85,7 +85,7 @@ static EGLResult<EGLConfig> ChooseEGLConfiguration(EGLDisplay display,
EGL_BLUE_SIZE, 8,
EGL_ALPHA_SIZE, 8,
EGL_DEPTH_SIZE, 0,
EGL_STENCIL_SIZE, 8,
EGL_STENCIL_SIZE, 0,
EGL_SAMPLES, static_cast<EGLint>(msaa_samples),
EGL_SAMPLE_BUFFERS, sample_buffers,
EGL_NONE, // termination sentinel

View File

@ -621,7 +621,7 @@ static sk_sp<SkSurface> MakeSkSurfaceFromBackingStore(
config.size.width, // width
config.size.height, // height
1, // sample count
8, // stencil bits
0, // stencil bits
framebuffer_info // framebuffer info
);