Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions shell/common/rasterizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -289,24 +289,27 @@ std::unique_ptr<Rasterizer::GpuImageResult> Rasterizer::MakeSkiaGpuImage(
TRACE_EVENT0("flutter", "Rasterizer::MakeGpuImage");
FML_DCHECK(display_list);

// TODO(dnfield): the Linux embedding is in a rough state right now and
// I can't seem to get the GPU path working on it.
// https://github.com/flutter/flutter/issues/108835
#if FML_OS_LINUX
return MakeBitmapImage(display_list, image_info);
#endif

std::unique_ptr<SnapshotDelegate::GpuImageResult> result;
delegate_.GetIsGpuDisabledSyncSwitch()->Execute(
fml::SyncSwitch::Handlers()
.SetIfTrue([&result, &image_info, &display_list] {
// TODO(dnfield): This isn't safe if display_list contains any GPU
// resources like an SkImage_gpu.
result = MakeBitmapImage(display_list, image_info);
})
.SetIfFalse([&result, &image_info, &display_list,
surface = surface_.get(),
gpu_image_behavior = gpu_image_behavior_] {
if (!surface ||
gpu_image_behavior == MakeGpuImageBehavior::kBitmap) {
// TODO(dnfield): This isn't safe if display_list contains any GPU
// resources like an SkImage_gpu.
result = MakeBitmapImage(display_list, image_info);
return;
}

auto context_switch = surface->MakeRenderContextCurrent();
if (!context_switch->GetResult()) {
result = MakeBitmapImage(display_list, image_info);
return;
}
Expand Down