Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
shell
common
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
9
namespace
flutter
{
10
11
GrContextOptions
MakeDefaultContextOptions
(
ContextType
type
,
12
std::optional<GrBackendApi> api) {
13
GrContextOptions
options
;
14
15
if
(
PersistentCache::cache_sksl
()) {
16
options
.
fShaderCacheStrategy
=
GrContextOptions::ShaderCacheStrategy::kSkSL
;
17
}
18
PersistentCache::MarkStrategySet
();
19
options
.fPersistentCache =
PersistentCache::GetCacheForProcess
();
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
options
const char * options
Definition
CommonFlagsConfig.cpp:43
GrBackendApi::kOpenGL
@ kOpenGL
flutter::PersistentCache::MarkStrategySet
static void MarkStrategySet()
Definition
persistent_cache.h:130
flutter::PersistentCache::GetCacheForProcess
static PersistentCache * GetCacheForProcess()
Definition
persistent_cache.cc:63
flutter::PersistentCache::cache_sksl
static bool cache_sksl()
Definition
persistent_cache.h:126
type
uint8_t type
Definition
fl_standard_message_codec_test.cc:1115
flutter
Definition
asset_manager.cc:10
flutter::MakeDefaultContextOptions
GrContextOptions MakeDefaultContextOptions(ContextType type, std::optional< GrBackendApi > api)
Initializes GrContextOptions with values suitable for Flutter. The options can be further tweaked bef...
Definition
context_options.cc:11
flutter::ContextType
ContextType
Definition
context_options.h:15
GrContextOptions
Definition
GrContextOptions.h:23
GrContextOptions::ShaderCacheStrategy::kSkSL
@ kSkSL
GrContextOptions::fShaderCacheStrategy
ShaderCacheStrategy fShaderCacheStrategy
Definition
GrContextOptions.h:221
GrContextOptions::Enable::kNo
@ kNo
Generated on Fri Apr 26 2024 06:14:18 for Flutter Engine by
1.9.8