From f50ea2aeccb38be53df7401ad22434b74f1a870f Mon Sep 17 00:00:00 2001 From: Swift Kim Date: Thu, 25 May 2023 11:11:34 +0900 Subject: [PATCH] [Tizen] Revert "Make the context current before accessing GL in MakeSkiaGpuImage" (#363) This reverts commit c7894a662ae10b3a203c2c608aa5f5529478e3af. --- shell/common/fixtures/shell_test.dart | 4 ---- shell/common/rasterizer.cc | 17 +++++++---------- shell/common/shell_unittests.cc | 5 ----- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/shell/common/fixtures/shell_test.dart b/shell/common/fixtures/shell_test.dart index a7727903af352..256b7163e79ff 100644 --- a/shell/common/fixtures/shell_test.dart +++ b/shell/common/fixtures/shell_test.dart @@ -343,9 +343,6 @@ void scene_with_red_box() { PlatformDispatcher.instance.scheduleFrame(); } -@pragma('vm:external-name', 'NativeOnBeforeToImageSync') -external void onBeforeToImageSync(); - @pragma('vm:entry-point') Future toImageSync() async { @@ -354,7 +351,6 @@ Future toImageSync() async { canvas.drawPaint(Paint()..color = const Color(0xFFAAAAAA)); final Picture picture = recorder.endRecording(); - onBeforeToImageSync(); final Image image = picture.toImageSync(20, 25); expect(image.width, 20); expect(image.height, 25); diff --git a/shell/common/rasterizer.cc b/shell/common/rasterizer.cc index 060d928f10bca..3b0114a3a3542 100644 --- a/shell/common/rasterizer.cc +++ b/shell/common/rasterizer.cc @@ -356,12 +356,17 @@ std::unique_ptr 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 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, @@ -369,14 +374,6 @@ std::unique_ptr Rasterizer::MakeSkiaGpuImage( 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; } diff --git a/shell/common/shell_unittests.cc b/shell/common/shell_unittests.cc index 70dfdb4da95b2..365ce2af8147f 100644 --- a/shell/common/shell_unittests.cc +++ b/shell/common/shell_unittests.cc @@ -4074,11 +4074,6 @@ TEST_F(ShellTest, PictureToImageSync) { }), }); - AddNativeCallback("NativeOnBeforeToImageSync", - CREATE_NATIVE_ENTRY([&](auto args) { - // nop - })); - fml::CountDownLatch latch(2); AddNativeCallback("NotifyNative", CREATE_NATIVE_ENTRY([&](auto args) { // Teardown and set up rasterizer again.