mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Soft revert of 3a0d0b6e36deebc6d477daee9a3cc4dbd09a7900 (flutter/engine#32465)
This commit is contained in:
parent
6253744e5b
commit
ec99c09baf
@ -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;
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
);
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user