Skip to content

Commit 0cbaa80

Browse files
authored
Disable Skia reduceOpsTaskSplitting option (#26568)
This option will be the default in Skia soon. Per discussion in #26067, let’s be explicit about disabling it for the time being, and we can revisit the flag in the future if desirable.
1 parent 86dacc0 commit 0cbaa80

6 files changed

Lines changed: 16 additions & 2 deletions

File tree

shell/common/shell_io_manager.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ sk_sp<GrDirectContext> ShellIOManager::CreateCompatibleResourceLoadingContext(
3939
// ES2 shading language when the ES3 external image extension is missing.
4040
options.fPreferExternalImagesOverES3 = true;
4141

42+
// Enabling this flag can increase VRAM consumption. Turn it off until
43+
// further notice.
44+
options.fReduceOpsTaskSplitting = GrContextOptions::Enable::kNo;
45+
4246
#if !OS_FUCHSIA
4347
if (auto context = GrDirectContext::MakeGL(gl_interface, options)) {
4448
// Do not cache textures created by the image decoder. These textures

shell/common/shell_test_platform_view_vulkan.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ bool ShellTestPlatformViewVulkan::OffScreenSurface::CreateSkiaGrContext() {
119119
}
120120
PersistentCache::MarkStrategySet();
121121
options.fPersistentCache = PersistentCache::GetCacheForProcess();
122+
options.fReduceOpsTaskSplitting = GrContextOptions::Enable::kNo;
122123

123124
sk_sp<GrDirectContext> context =
124125
GrDirectContext::MakeVulkan(backend_context, options);

shell/gpu/gpu_surface_gl.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ sk_sp<GrDirectContext> GPUSurfaceGL::MakeGLContext(
6161
// TODO(goderbauer): remove option when skbug.com/7523 is fixed.
6262
// A similar work-around is also used in shell/common/io_manager.cc.
6363
options.fDisableGpuYUVConversion = true;
64+
65+
options.fReduceOpsTaskSplitting = GrContextOptions::Enable::kNo;
66+
6467
auto context = GrDirectContext::MakeGL(delegate->GetGLInterface(), options);
6568

6669
if (!context) {

shell/platform/darwin/graphics/FlutterDarwinContextMetal.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ static GrContextOptions CreateMetalGrContextOptions() {
1818
}
1919
flutter::PersistentCache::MarkStrategySet();
2020
options.fPersistentCache = flutter::PersistentCache::GetCacheForProcess();
21+
options.fReduceOpsTaskSplitting = GrContextOptions::Enable::kNo;
2122
return options;
2223
}
2324

shell/platform/fuchsia/flutter/vulkan_surface_producer.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,10 @@ bool VulkanSurfaceProducer::Initialize(scenic::Session* scenic_session) {
137137
backend_context.fPhysicalDevice, 0, nullptr,
138138
countof(device_extensions), device_extensions);
139139
backend_context.fVkExtensions = &vk_extensions;
140+
GrContextOptions options;
141+
options.fReduceOpsTaskSplitting = GrContextOptions::Enable::kNo;
140142

141-
context_ = GrDirectContext::MakeVulkan(backend_context);
143+
context_ = GrDirectContext::MakeVulkan(backend_context, options);
142144

143145
if (context_ == nullptr) {
144146
FML_LOG(ERROR)

vulkan/vulkan_window.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,10 @@ bool VulkanWindow::CreateSkiaGrContext() {
119119
return false;
120120
}
121121

122-
sk_sp<GrDirectContext> context = GrDirectContext::MakeVulkan(backend_context);
122+
GrContextOptions options;
123+
options.fReduceOpsTaskSplitting = GrContextOptions::Enable::kNo;
124+
sk_sp<GrDirectContext> context =
125+
GrDirectContext::MakeVulkan(backend_context, options);
123126

124127
if (context == nullptr) {
125128
return false;

0 commit comments

Comments
 (0)