Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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#include "flutter/shell/common/context_options.h"
6
7#include "flutter/common/graphics/persistent_cache.h"
8
9namespace flutter {
10
12 std::optional<GrBackendApi> api) {
14
17 }
20
21 if (api.has_value() && api.value() == GrBackendApi::kOpenGL) {
22 // Using stencil buffers has caused memory and performance regressions.
23 // See b/226484927 for internal customer regressions doc.
24 // Before enabling, we need to show a motivating case for where it will
25 // improve performance on OpenGL backend.
26 options.fAvoidStencilBuffers = true;
27
28 // To get video playback on the widest range of devices, we limit Skia to
29 // ES2 shading language when the ES3 external image extension is missing.
30 options.fPreferExternalImagesOverES3 = true;
31 }
32
33 // TODO(goderbauer): remove option when skbug.com/7523 is fixed.
34 options.fDisableGpuYUVConversion = true;
35
36 options.fReduceOpsTaskSplitting = GrContextOptions::Enable::kNo;
37
38 options.fReducedShaderVariations = false;
39
40 return options;
41};
42
43} // namespace flutter
const char * options
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...
ShaderCacheStrategy fShaderCacheStrategy