Flutter Engine
The Flutter Engine
context_options.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#if !SLIMPELLER
6
7#include "flutter/shell/common/context_options.h"
8
9#include "flutter/common/graphics/persistent_cache.h"
10
11namespace flutter {
12
14 std::optional<GrBackendApi> api) {
16
19 }
22
23 if (api.has_value() && api.value() == GrBackendApi::kOpenGL) {
24 // Using stencil buffers has caused memory and performance regressions.
25 // See b/226484927 for internal customer regressions doc.
26 // Before enabling, we need to show a motivating case for where it will
27 // improve performance on OpenGL backend.
28 options.fAvoidStencilBuffers = true;
29
30 // To get video playback on the widest range of devices, we limit Skia to
31 // ES2 shading language when the ES3 external image extension is missing.
32 options.fPreferExternalImagesOverES3 = true;
33 }
34
35 // TODO(goderbauer): remove option when skbug.com/7523 is fixed.
36 options.fDisableGpuYUVConversion = true;
37
38 options.fReduceOpsTaskSplitting = GrContextOptions::Enable::kNo;
39
40 options.fReducedShaderVariations = false;
41
42 return options;
43};
44
45} // namespace flutter
46
47#endif // !SLIMPELLER
const char * options
GLenum type
static PersistentCache * GetCacheForProcess()
GrContextOptions MakeDefaultContextOptions(ContextType type, std::optional< GrBackendApi > api)
Initializes GrContextOptions with values suitable for Flutter. The options can be further tweaked bef...