diff --git a/DEPS b/DEPS index 8cdea0c6b540d..4325121fb1953 100644 --- a/DEPS +++ b/DEPS @@ -18,7 +18,7 @@ vars = { 'llvm_git': 'https://llvm.googlesource.com', # OCMock is for testing only so there is no google clone 'ocmock_git': 'https://github.com/erikdoe/ocmock.git', - 'skia_revision': 'd0b84eceadc6a212c8fdeaec9abd9f33f6be56ca', + 'skia_revision': '07ba1f081f34f4220cc548c550b32535565cc774', # WARNING: DO NOT EDIT canvaskit_cipd_instance MANUALLY # See `lib/web_ui/README.md` for how to roll CanvasKit to a new version. diff --git a/ci/licenses_golden/licenses_skia b/ci/licenses_golden/licenses_skia index e60b435225117..0478b4203c06a 100644 --- a/ci/licenses_golden/licenses_skia +++ b/ci/licenses_golden/licenses_skia @@ -1,4 +1,4 @@ -Signature: ec08617195c2b6cb203add4cc22e3a9e +Signature: 5e3e01a3c41a493d385d6e01adae46f0 UNUSED LICENSES: diff --git a/flow/surface_frame.cc b/flow/surface_frame.cc index d3133daa07385..947cf0f201326 100644 --- a/flow/surface_frame.cc +++ b/flow/surface_frame.cc @@ -6,7 +6,6 @@ #include -#include "flutter/flow/layers/layer.h" #include "flutter/fml/logging.h" #include "flutter/fml/trace_event.h" #include "third_party/skia/include/utils/SkNWayCanvas.h" @@ -16,6 +15,7 @@ namespace flutter { SurfaceFrame::SurfaceFrame(sk_sp surface, FramebufferInfo framebuffer_info, const SubmitCallback& submit_callback, + SkISize frame_size, std::unique_ptr context_result, bool display_list_fallback) : surface_(surface), @@ -26,7 +26,9 @@ SurfaceFrame::SurfaceFrame(sk_sp surface, if (surface_) { canvas_ = surface_->getCanvas(); } else if (display_list_fallback) { - dl_recorder_ = sk_make_sp(kGiantRect); + FML_DCHECK(!frame_size.isEmpty()); + dl_recorder_ = + sk_make_sp(SkRect::Make(frame_size)); canvas_ = dl_recorder_.get(); } } diff --git a/flow/surface_frame.h b/flow/surface_frame.h index d630ab331be40..f97281ac9281c 100644 --- a/flow/surface_frame.h +++ b/flow/surface_frame.h @@ -57,6 +57,7 @@ class SurfaceFrame { SurfaceFrame(sk_sp surface, FramebufferInfo framebuffer_info, const SubmitCallback& submit_callback, + SkISize frame_size, std::unique_ptr context_result = nullptr, bool display_list_fallback = false); diff --git a/flow/surface_frame_unittests.cc b/flow/surface_frame_unittests.cc index 7bc4d07ef564f..c025c662bceaf 100644 --- a/flow/surface_frame_unittests.cc +++ b/flow/surface_frame_unittests.cc @@ -13,10 +13,12 @@ TEST(FlowTest, SurfaceFrameDoesNotSubmitInDtor) { SurfaceFrame::FramebufferInfo framebuffer_info; auto surface_frame = std::make_unique( /*surface=*/nullptr, framebuffer_info, - /*submit_callback=*/[](const SurfaceFrame&, SkCanvas*) { + /*submit_callback=*/ + [](const SurfaceFrame&, SkCanvas*) { EXPECT_FALSE(true); return true; - }); + }, + SkISize::Make(800, 600)); surface_frame.reset(); } @@ -25,6 +27,7 @@ TEST(FlowTest, SurfaceFrameDoesNotHaveEmptyCanvas) { SurfaceFrame frame( /*surface=*/nullptr, framebuffer_info, /*submit_callback=*/[](const SurfaceFrame&, SkCanvas*) { return true; }, + /*frame_size=*/SkISize::Make(800, 600), /*context_result=*/nullptr, /*display_list_fallback=*/true); EXPECT_FALSE(frame.SkiaCanvas()->getLocalClipBounds().isEmpty()); diff --git a/shell/common/rasterizer_unittests.cc b/shell/common/rasterizer_unittests.cc index e45b585a166e3..169e83a268210 100644 --- a/shell/common/rasterizer_unittests.cc +++ b/shell/common/rasterizer_unittests.cc @@ -158,7 +158,8 @@ TEST(RasterizerTest, auto surface_frame = std::make_unique( /*surface=*/nullptr, framebuffer_info, - /*submit_callback=*/[](const SurfaceFrame&, SkCanvas*) { return true; }); + /*submit_callback=*/[](const SurfaceFrame&, SkCanvas*) { return true; }, + /*frame_size=*/SkISize::Make(800, 600)); EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillOnce(Return(true)); EXPECT_CALL(*surface, AcquireFrame(SkISize())) .WillOnce(Return(ByMove(std::move(surface_frame)))); @@ -226,7 +227,8 @@ TEST( framebuffer_info.supports_readback = true; auto surface_frame = std::make_unique( /*surface=*/nullptr, framebuffer_info, - /*submit_callback=*/[](const SurfaceFrame&, SkCanvas*) { return true; }); + /*submit_callback=*/[](const SurfaceFrame&, SkCanvas*) { return true; }, + /*frame_size=*/SkISize::Make(800, 600)); EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillOnce(Return(true)); EXPECT_CALL(*surface, AcquireFrame(SkISize())) .WillOnce(Return(ByMove(std::move(surface_frame)))); @@ -295,7 +297,8 @@ TEST( auto surface_frame = std::make_unique( /*surface=*/nullptr, framebuffer_info, - /*submit_callback=*/[](const SurfaceFrame&, SkCanvas*) { return true; }); + /*submit_callback=*/[](const SurfaceFrame&, SkCanvas*) { return true; }, + /*frame_size=*/SkISize::Make(800, 600)); EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillOnce(Return(true)); EXPECT_CALL(*surface, AcquireFrame(SkISize())) .WillOnce(Return(ByMove(std::move(surface_frame)))); @@ -361,10 +364,12 @@ TEST(RasterizerTest, auto surface_frame1 = std::make_unique( /*surface=*/nullptr, framebuffer_info, - /*submit_callback=*/[](const SurfaceFrame&, SkCanvas*) { return true; }); + /*submit_callback=*/[](const SurfaceFrame&, SkCanvas*) { return true; }, + /*frame_size=*/SkISize::Make(800, 600)); auto surface_frame2 = std::make_unique( /*surface=*/nullptr, framebuffer_info, - /*submit_callback=*/[](const SurfaceFrame&, SkCanvas*) { return true; }); + /*submit_callback=*/[](const SurfaceFrame&, SkCanvas*) { return true; }, + /*frame_size=*/SkISize::Make(800, 600)); EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled()) .WillRepeatedly(Return(true)); // Prepare two frames for Draw() and DrawLastLayerTree(). @@ -580,7 +585,8 @@ TEST(RasterizerTest, framebuffer_info.supports_readback = true; auto surface_frame = std::make_unique( /*surface=*/nullptr, /*framebuffer_info=*/framebuffer_info, - /*submit_callback=*/[](const SurfaceFrame&, SkCanvas*) { return true; }); + /*submit_callback=*/[](const SurfaceFrame&, SkCanvas*) { return true; }, + /*frame_size=*/SkISize::Make(800, 600)); EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillOnce(Return(true)); ON_CALL(delegate, GetIsGpuDisabledSyncSwitch()) .WillByDefault(Return(is_gpu_disabled_sync_switch)); @@ -636,7 +642,8 @@ TEST( auto surface_frame = std::make_unique( /*surface=*/nullptr, /*framebuffer_info=*/framebuffer_info, - /*submit_callback=*/[](const SurfaceFrame&, SkCanvas*) { return true; }); + /*submit_callback=*/[](const SurfaceFrame&, SkCanvas*) { return true; }, + /*frame_size=*/SkISize::Make(800, 600)); EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillOnce(Return(true)); ON_CALL(delegate, GetIsGpuDisabledSyncSwitch()) .WillByDefault(Return(is_gpu_disabled_sync_switch)); @@ -693,7 +700,8 @@ TEST( auto surface_frame = std::make_unique( /*surface=*/nullptr, /*framebuffer_info=*/framebuffer_info, - /*submit_callback=*/[](const SurfaceFrame&, SkCanvas*) { return true; }); + /*submit_callback=*/[](const SurfaceFrame&, SkCanvas*) { return true; }, + /*frame_size=*/SkISize::Make(800, 600)); EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillOnce(Return(false)); EXPECT_CALL(delegate, GetIsGpuDisabledSyncSwitch()) .WillOnce(Return(is_gpu_disabled_sync_switch)); @@ -749,7 +757,8 @@ TEST( auto surface_frame = std::make_unique( /*surface=*/nullptr, /*framebuffer_info=*/framebuffer_info, - /*submit_callback=*/[](const SurfaceFrame&, SkCanvas*) { return true; }); + /*submit_callback=*/[](const SurfaceFrame&, SkCanvas*) { return true; }, + /*frame_size=*/SkISize::Make(800, 600)); EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillOnce(Return(false)); EXPECT_CALL(delegate, GetIsGpuDisabledSyncSwitch()) .WillOnce(Return(is_gpu_disabled_sync_switch)); @@ -809,9 +818,9 @@ TEST(RasterizerTest, framebuffer_info.supports_readback = true; return std::make_unique( /*surface=*/nullptr, framebuffer_info, - /*submit_callback=*/[](const SurfaceFrame& frame, SkCanvas*) { - return true; - }); + /*submit_callback=*/ + [](const SurfaceFrame& frame, SkCanvas*) { return true; }, + /*frame_size=*/SkISize::Make(800, 600)); })); ON_CALL(*surface, MakeRenderContextCurrent()) .WillByDefault(::testing::Invoke( @@ -987,7 +996,8 @@ TEST(RasterizerTest, presentationTimeSetWhenVsyncTargetInFuture) { framebuffer_info.supports_readback = true; return std::make_unique( /*surface=*/nullptr, framebuffer_info, - /*submit_callback=*/[&](const SurfaceFrame& frame, SkCanvas*) { + /*submit_callback=*/ + [&](const SurfaceFrame& frame, SkCanvas*) { const auto pres_time = *frame.submit_info().presentation_time; const auto diff = pres_time - first_timestamp; int num_frames_submitted = frames_submitted++; @@ -995,7 +1005,8 @@ TEST(RasterizerTest, presentationTimeSetWhenVsyncTargetInFuture) { num_frames_submitted * millis_16.ToMilliseconds()); submit_latch.CountDown(); return true; - }); + }, + /*frame_size=*/SkISize::Make(800, 600)); })); ON_CALL(*surface, MakeRenderContextCurrent()) @@ -1066,13 +1077,15 @@ TEST(RasterizerTest, presentationTimeNotSetWhenVsyncTargetInPast) { framebuffer_info.supports_readback = true; return std::make_unique( /*surface=*/nullptr, framebuffer_info, - /*submit_callback=*/[&](const SurfaceFrame& frame, SkCanvas*) { + /*submit_callback=*/ + [&](const SurfaceFrame& frame, SkCanvas*) { const std::optional pres_time = frame.submit_info().presentation_time; EXPECT_EQ(pres_time, std::nullopt); submit_latch.CountDown(); return true; - }); + }, + /*frame_size=*/SkISize::Make(800, 600)); })); ON_CALL(*surface, MakeRenderContextCurrent()) diff --git a/shell/common/shell_test_platform_view_vulkan.cc b/shell/common/shell_test_platform_view_vulkan.cc index 4068a9cb2ee79..a25c980e6ceee 100644 --- a/shell/common/shell_test_platform_view_vulkan.cc +++ b/shell/common/shell_test_platform_view_vulkan.cc @@ -193,7 +193,8 @@ ShellTestPlatformViewVulkan::OffScreenSurface::AcquireFrame( framebuffer_info.supports_readback = true; return std::make_unique( - std::move(surface), std::move(framebuffer_info), std::move(callback)); + std::move(surface), std::move(framebuffer_info), std::move(callback), + /*frame_size=*/SkISize::Make(800, 600)); } GrDirectContext* ShellTestPlatformViewVulkan::OffScreenSurface::GetContext() { diff --git a/shell/gpu/gpu_surface_gl_impeller.cc b/shell/gpu/gpu_surface_gl_impeller.cc index 119e2fcb27321..e5d6a8324a0d5 100644 --- a/shell/gpu/gpu_surface_gl_impeller.cc +++ b/shell/gpu/gpu_surface_gl_impeller.cc @@ -120,6 +120,7 @@ std::unique_ptr GPUSurfaceGLImpeller::AcquireFrame( nullptr, // surface SurfaceFrame::FramebufferInfo{}, // framebuffer info submit_callback, // submit callback + size, // frame size std::move(context_switch), // context result true // display list fallback ); diff --git a/shell/gpu/gpu_surface_gl_skia.cc b/shell/gpu/gpu_surface_gl_skia.cc index 06b3d5d3c5748..c377e87cddb19 100644 --- a/shell/gpu/gpu_surface_gl_skia.cc +++ b/shell/gpu/gpu_surface_gl_skia.cc @@ -229,7 +229,8 @@ std::unique_ptr GPUSurfaceGLSkia::AcquireFrame( nullptr, std::move(framebuffer_info), [](const SurfaceFrame& surface_frame, SkCanvas* canvas) { return true; - }); + }, + size); } const auto root_surface_transformation = GetRootTransformation(); @@ -253,7 +254,7 @@ std::unique_ptr GPUSurfaceGLSkia::AcquireFrame( framebuffer_info.existing_damage = existing_damage_; } return std::make_unique(surface, std::move(framebuffer_info), - submit_callback, + submit_callback, size, std::move(context_switch)); } diff --git a/shell/gpu/gpu_surface_metal_impeller.mm b/shell/gpu/gpu_surface_metal_impeller.mm index f0faab099cdd9..307a94a93e162 100644 --- a/shell/gpu/gpu_surface_metal_impeller.mm +++ b/shell/gpu/gpu_surface_metal_impeller.mm @@ -88,6 +88,7 @@ return std::make_unique(nullptr, // surface SurfaceFrame::FramebufferInfo{}, // framebuffer info submit_callback, // submit callback + frame_info, // frame size nullptr, // context result true // display list fallback ); diff --git a/shell/gpu/gpu_surface_metal_skia.mm b/shell/gpu/gpu_surface_metal_skia.mm index 9ebe7f17c8ed2..7acfb1f6051d0 100644 --- a/shell/gpu/gpu_surface_metal_skia.mm +++ b/shell/gpu/gpu_surface_metal_skia.mm @@ -95,7 +95,7 @@ if (!render_to_surface_) { return std::make_unique( nullptr, SurfaceFrame::FramebufferInfo(), - [](const SurfaceFrame& surface_frame, SkCanvas* canvas) { return true; }); + [](const SurfaceFrame& surface_frame, SkCanvas* canvas) { return true; }, frame_size); } PrecompileKnownSkSLsIfNecessary(); @@ -187,7 +187,8 @@ framebuffer_info.supports_partial_repaint = true; } - return std::make_unique(std::move(surface), framebuffer_info, submit_callback); + return std::make_unique(std::move(surface), framebuffer_info, submit_callback, + frame_info); } std::unique_ptr GPUSurfaceMetalSkia::AcquireFrameFromMTLTexture( @@ -229,7 +230,7 @@ framebuffer_info.supports_readback = true; return std::make_unique(std::move(surface), std::move(framebuffer_info), - submit_callback); + submit_callback, frame_info); } // |Surface| diff --git a/shell/gpu/gpu_surface_software.cc b/shell/gpu/gpu_surface_software.cc index 252f47fad16c2..babf988fa2039 100644 --- a/shell/gpu/gpu_surface_software.cc +++ b/shell/gpu/gpu_surface_software.cc @@ -35,7 +35,8 @@ std::unique_ptr GPUSurfaceSoftware::AcquireFrame( nullptr, std::move(framebuffer_info), [](const SurfaceFrame& surface_frame, SkCanvas* canvas) { return true; - }); + }, + logical_size); } if (!IsValid()) { @@ -73,8 +74,8 @@ std::unique_ptr GPUSurfaceSoftware::AcquireFrame( return self->delegate_->PresentBackingStore(surface_frame.SkiaSurface()); }; - return std::make_unique(backing_store, - std::move(framebuffer_info), on_submit); + return std::make_unique( + backing_store, std::move(framebuffer_info), on_submit, logical_size); } // |Surface| diff --git a/shell/gpu/gpu_surface_vulkan.cc b/shell/gpu/gpu_surface_vulkan.cc index 51b7b87357f8e..afe458ac7fa46 100644 --- a/shell/gpu/gpu_surface_vulkan.cc +++ b/shell/gpu/gpu_surface_vulkan.cc @@ -43,7 +43,8 @@ std::unique_ptr GPUSurfaceVulkan::AcquireFrame( nullptr, SurfaceFrame::FramebufferInfo(), [](const SurfaceFrame& surface_frame, SkCanvas* canvas) { return true; - }); + }, + frame_size); } FlutterVulkanImage image = delegate_->AcquireImage(frame_size); @@ -77,8 +78,9 @@ std::unique_ptr GPUSurfaceVulkan::AcquireFrame( SurfaceFrame::FramebufferInfo framebuffer_info{.supports_readback = true}; - return std::make_unique( - std::move(surface), std::move(framebuffer_info), std::move(callback)); + return std::make_unique(std::move(surface), + std::move(framebuffer_info), + std::move(callback), frame_size); } SkMatrix GPUSurfaceVulkan::GetRootTransformation() const { diff --git a/shell/platform/android/external_view_embedder/external_view_embedder_unittests.cc b/shell/platform/android/external_view_embedder/external_view_embedder_unittests.cc index 3005024bb9fe3..b174cd92703f9 100644 --- a/shell/platform/android/external_view_embedder/external_view_embedder_unittests.cc +++ b/shell/platform/android/external_view_embedder/external_view_embedder_unittests.cc @@ -326,12 +326,14 @@ TEST(AndroidExternalViewEmbedder, SubmitFrame) { SkSurface::MakeNull(1000, 1000), framebuffer_info, [](const SurfaceFrame& surface_frame, SkCanvas* canvas) { return true; - }); + }, + /*frame_size=*/SkISize::Make(800, 600)); auto surface_frame_2 = std::make_unique( SkSurface::MakeNull(1000, 1000), framebuffer_info, [](const SurfaceFrame& surface_frame, SkCanvas* canvas) { return true; - }); + }, + /*frame_size=*/SkISize::Make(800, 600)); auto surface_mock = std::make_unique(); EXPECT_CALL(*surface_mock, AcquireFrame(frame_size)) @@ -366,7 +368,8 @@ TEST(AndroidExternalViewEmbedder, SubmitFrame) { did_submit_frame = true; } return true; - }); + }, + /*frame_size=*/SkISize::Make(800, 600)); embedder->SubmitFrame(gr_context.get(), std::move(surface_frame)); // Submits frame if no Android view in the current frame. @@ -433,7 +436,8 @@ TEST(AndroidExternalViewEmbedder, SubmitFrame) { did_submit_frame = true; } return true; - }); + }, + /*frame_size=*/SkISize::Make(800, 600)); embedder->SubmitFrame(gr_context.get(), std::move(surface_frame)); // Doesn't submit frame if there aren't Android views in the previous frame. @@ -498,7 +502,8 @@ TEST(AndroidExternalViewEmbedder, SubmitFrame) { did_submit_frame = true; } return true; - }); + }, + /*frame_size=*/SkISize::Make(800, 600)); embedder->SubmitFrame(gr_context.get(), std::move(surface_frame)); // Submits frame if there are Android views in the previous frame. EXPECT_TRUE(did_submit_frame); @@ -526,7 +531,8 @@ TEST(AndroidExternalViewEmbedder, SubmitFrameOverlayComposition) { SkSurface::MakeNull(1000, 1000), framebuffer_info, [](const SurfaceFrame& surface_frame, SkCanvas* canvas) { return true; - }); + }, + /*frame_size=*/SkISize::Make(800, 600)); auto surface_mock = std::make_unique(); EXPECT_CALL(*surface_mock, AcquireFrame(frame_size)) @@ -605,7 +611,8 @@ TEST(AndroidExternalViewEmbedder, SubmitFrameOverlayComposition) { SkSurface::MakeNull(1000, 1000), framebuffer_info, [](const SurfaceFrame& surface_frame, SkCanvas* canvas) mutable { return true; - }); + }, + /*frame_size=*/SkISize::Make(800, 600)); embedder->SubmitFrame(gr_context.get(), std::move(surface_frame)); @@ -628,7 +635,8 @@ TEST(AndroidExternalViewEmbedder, SubmitFramePlatformViewWithoutAnyOverlay) { SkSurface::MakeNull(1000, 1000), framebuffer_info, [](const SurfaceFrame& surface_frame, SkCanvas* canvas) { return true; - }); + }, + /*frame_size=*/SkISize::Make(800, 600)); auto surface_mock = std::make_unique(); EXPECT_CALL(*surface_mock, AcquireFrame(frame_size)) @@ -672,7 +680,8 @@ TEST(AndroidExternalViewEmbedder, SubmitFramePlatformViewWithoutAnyOverlay) { SkSurface::MakeNull(1000, 1000), framebuffer_info, [](const SurfaceFrame& surface_frame, SkCanvas* canvas) mutable { return true; - }); + }, + /*frame_size=*/SkISize::Make(800, 600)); embedder->SubmitFrame(gr_context.get(), std::move(surface_frame)); @@ -715,7 +724,8 @@ TEST(AndroidExternalViewEmbedder, DestroyOverlayLayersOnSizeChange) { SkSurface::MakeNull(1000, 1000), framebuffer_info, [](const SurfaceFrame& surface_frame, SkCanvas* canvas) { return true; - }); + }, + /*frame_size=*/SkISize::Make(800, 600)); auto surface_mock = std::make_unique(); EXPECT_CALL(*surface_mock, AcquireFrame(frame_size)) @@ -773,7 +783,8 @@ TEST(AndroidExternalViewEmbedder, DestroyOverlayLayersOnSizeChange) { SkSurface::MakeNull(1000, 1000), framebuffer_info, [](const SurfaceFrame& surface_frame, SkCanvas* canvas) { return true; - }); + }, + /*frame_size=*/SkISize::Make(800, 600)); embedder->SubmitFrame(gr_context.get(), std::move(surface_frame)); EXPECT_CALL(*jni_mock, FlutterViewEndFrame()); @@ -802,7 +813,8 @@ TEST(AndroidExternalViewEmbedder, DoesNotDestroyOverlayLayersOnSizeChange) { SkSurface::MakeNull(1000, 1000), framebuffer_info, [](const SurfaceFrame& surface_frame, SkCanvas* canvas) { return true; - }); + }, + /*frame_size=*/SkISize::Make(800, 600)); auto surface_mock = std::make_unique(); EXPECT_CALL(*surface_mock, AcquireFrame(frame_size)) @@ -859,7 +871,8 @@ TEST(AndroidExternalViewEmbedder, DoesNotDestroyOverlayLayersOnSizeChange) { SkSurface::MakeNull(1000, 1000), framebuffer_info, [](const SurfaceFrame& surface_frame, SkCanvas* canvas) { return true; - }); + }, + /*frame_size=*/SkISize::Make(800, 600)); embedder->SubmitFrame(gr_context.get(), std::move(surface_frame)); EXPECT_CALL(*jni_mock, FlutterViewEndFrame()); @@ -926,7 +939,8 @@ TEST(AndroidExternalViewEmbedder, Teardown) { SkSurface::MakeNull(1000, 1000), framebuffer_info, [](const SurfaceFrame& surface_frame, SkCanvas* canvas) { return true; - }); + }, + /*frame_size=*/SkISize::Make(800, 600)); auto surface_mock = std::make_unique(); EXPECT_CALL(*surface_mock, AcquireFrame(frame_size)) @@ -969,7 +983,8 @@ TEST(AndroidExternalViewEmbedder, Teardown) { SurfaceFrame::FramebufferInfo framebuffer_info; auto surface_frame = std::make_unique( SkSurface::MakeNull(1000, 1000), framebuffer_info, - [](const SurfaceFrame& surface_frame, SkCanvas* canvas) { return true; }); + [](const SurfaceFrame& surface_frame, SkCanvas* canvas) { return true; }, + /*frame_size=*/SkISize::Make(800, 600)); embedder->SubmitFrame(gr_context.get(), std::move(surface_frame)); embedder->EndFrame(/*should_resubmit_frame=*/false, raster_thread_merger); diff --git a/shell/platform/darwin/ios/framework/Source/FlutterPlatformViewsTest.mm b/shell/platform/darwin/ios/framework/Source/FlutterPlatformViewsTest.mm index 5c6c8d0653797..b73373760c106 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterPlatformViewsTest.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterPlatformViewsTest.mm @@ -1851,7 +1851,8 @@ - (void)testFlutterPlatformViewControllerSubmitFrameWithoutFlutterViewNotCrashin flutter::SurfaceFrame::FramebufferInfo framebuffer_info; auto mock_surface = std::make_unique( nullptr, framebuffer_info, - [](const flutter::SurfaceFrame& surface_frame, SkCanvas* canvas) { return false; }); + [](const flutter::SurfaceFrame& surface_frame, SkCanvas* canvas) { return false; }, + /*frame_size=*/SkISize::Make(800, 600)); XCTAssertFalse( flutterPlatformViewsController->SubmitFrame(nullptr, nullptr, std::move(mock_surface))); @@ -1861,7 +1862,8 @@ - (void)testFlutterPlatformViewControllerSubmitFrameWithoutFlutterViewNotCrashin flutterPlatformViewsController->CompositeEmbeddedView(2); auto mock_surface_submit_true = std::make_unique( nullptr, framebuffer_info, - [](const flutter::SurfaceFrame& surface_frame, SkCanvas* canvas) { return true; }); + [](const flutter::SurfaceFrame& surface_frame, SkCanvas* canvas) { return true; }, + /*frame_size=*/SkISize::Make(800, 600)); XCTAssertTrue(flutterPlatformViewsController->SubmitFrame(nullptr, nullptr, std::move(mock_surface_submit_true))); } diff --git a/shell/platform/fuchsia/flutter/surface.cc b/shell/platform/fuchsia/flutter/surface.cc index 0919d3e908163..5b9c5be50e4d0 100644 --- a/shell/platform/fuchsia/flutter/surface.cc +++ b/shell/platform/fuchsia/flutter/surface.cc @@ -36,7 +36,8 @@ std::unique_ptr Surface::AcquireFrame( nullptr, std::move(framebuffer_info), [](const flutter::SurfaceFrame& surface_frame, SkCanvas* canvas) { return true; - }); + }, + size); } // |flutter::Surface| diff --git a/shell/platform/fuchsia/flutter/tests/flatland_external_view_embedder_unittests.cc b/shell/platform/fuchsia/flutter/tests/flatland_external_view_embedder_unittests.cc index 5ac7705ada835..a387ba2c1ef2a 100644 --- a/shell/platform/fuchsia/flutter/tests/flatland_external_view_embedder_unittests.cc +++ b/shell/platform/fuchsia/flutter/tests/flatland_external_view_embedder_unittests.cc @@ -288,7 +288,8 @@ void DrawSimpleFrame(FlatlandExternalViewEmbedder& external_view_embedder, nullptr, std::make_unique( nullptr, std::move(framebuffer_info), [](const flutter::SurfaceFrame& surface_frame, - SkCanvas* canvas) { return true; })); + SkCanvas* canvas) { return true; }, + frame_size)); } void DrawFrameWithView(FlatlandExternalViewEmbedder& external_view_embedder, @@ -316,7 +317,8 @@ void DrawFrameWithView(FlatlandExternalViewEmbedder& external_view_embedder, nullptr, std::make_unique( nullptr, std::move(framebuffer_info), [](const flutter::SurfaceFrame& surface_frame, - SkCanvas* canvas) { return true; })); + SkCanvas* canvas) { return true; }, + frame_size)); } }; // namespace diff --git a/shell/platform/fuchsia/flutter/tests/gfx_external_view_embedder_unittests.cc b/shell/platform/fuchsia/flutter/tests/gfx_external_view_embedder_unittests.cc index adbcc643e1af1..ef0569d5c8a5c 100644 --- a/shell/platform/fuchsia/flutter/tests/gfx_external_view_embedder_unittests.cc +++ b/shell/platform/fuchsia/flutter/tests/gfx_external_view_embedder_unittests.cc @@ -462,7 +462,8 @@ void DrawSimpleFrame(GfxExternalViewEmbedder& external_view_embedder, nullptr, std::make_unique( nullptr, framebuffer_info, [](const flutter::SurfaceFrame& surface_frame, - SkCanvas* canvas) { return true; })); + SkCanvas* canvas) { return true; }, + frame_size)); } void DrawFrameWithView(GfxExternalViewEmbedder& external_view_embedder, @@ -489,7 +490,8 @@ void DrawFrameWithView(GfxExternalViewEmbedder& external_view_embedder, nullptr, std::make_unique( nullptr, framebuffer_info, [](const flutter::SurfaceFrame& surface_frame, - SkCanvas* canvas) { return true; })); + SkCanvas* canvas) { return true; }, + frame_size)); } FramePresentedInfo MakeFramePresentedInfoForOnePresent(