diff --git a/engine/src/flutter/flow/scene_update_context.cc b/engine/src/flutter/flow/scene_update_context.cc index 0abf6d4c18..09ec25766e 100644 --- a/engine/src/flutter/flow/scene_update_context.cc +++ b/engine/src/flutter/flow/scene_update_context.cc @@ -23,8 +23,8 @@ void SceneUpdateContext::CurrentPaintTask::Clear() { } SceneUpdateContext::SceneUpdateContext(mozart::SceneUpdate* update, - mozart::BufferProducer* buffer_producer) - : update_(update), buffer_producer_(buffer_producer) {} + SurfaceProducer* surface_producer) + : update_(update), surface_producer_(surface_producer) {} SceneUpdateContext::~SceneUpdateContext() = default; @@ -60,7 +60,7 @@ mozart::NodePtr SceneUpdateContext::FinalizeCurrentPaintTask( mozart::ImagePtr image; PaintTask task; - task.surface = mozart::MakeSkSurface(physical_size, buffer_producer_, &image); + task.surface = surface_producer_->ProduceSurface(physical_size, &image); task.left = bounds.left(); task.top = bounds.top(); task.scaleX = scaleX; diff --git a/engine/src/flutter/flow/scene_update_context.h b/engine/src/flutter/flow/scene_update_context.h index 4ced4d88b7..34ac3f86d0 100644 --- a/engine/src/flutter/flow/scene_update_context.h +++ b/engine/src/flutter/flow/scene_update_context.h @@ -35,8 +35,15 @@ class SceneUpdateContext; class SceneUpdateContext { public: + class SurfaceProducer { + public: + virtual ~SurfaceProducer() {} + virtual sk_sp ProduceSurface(SkISize size, + mozart::ImagePtr* out_image) = 0; + }; + SceneUpdateContext(mozart::SceneUpdate* update, - mozart::BufferProducer* buffer_producer); + SurfaceProducer* surface_producer); ~SceneUpdateContext(); mozart::SceneUpdate* update() const { return update_; } @@ -71,7 +78,7 @@ class SceneUpdateContext { }; mozart::SceneUpdate* update_; - mozart::BufferProducer* buffer_producer_; + SurfaceProducer* surface_producer_; CurrentPaintTask current_paint_task_; std::vector paint_tasks_; diff --git a/engine/src/flutter/vulkan/vulkan_proc_table.cc b/engine/src/flutter/vulkan/vulkan_proc_table.cc index 5b6a3edc7f..2584c2861c 100644 --- a/engine/src/flutter/vulkan/vulkan_proc_table.cc +++ b/engine/src/flutter/vulkan/vulkan_proc_table.cc @@ -90,8 +90,12 @@ bool VulkanProcTable::SetupInstanceProcAddresses( #endif // OS_ANDROID #if OS_FUCHSIA - ACQUIRE_PROC(CreateMagmaSurfaceKHR, handle); - ACQUIRE_PROC(GetPhysicalDeviceMagmaPresentationSupportKHR, handle); + [this, &handle]() -> bool { + ACQUIRE_PROC(CreateMagmaSurfaceKHR, handle); + ACQUIRE_PROC(GetPhysicalDeviceMagmaPresentationSupportKHR, handle); + return true; + }(); + #endif // OS_FUCHSIA // The debug report functions are optional. We don't want proc acquisition to