5#include "flutter/shell/gpu/gpu_surface_vulkan_impeller.h"
7#include "flutter/fml/make_copyable.h"
16#define ENABLE_EXPERIMENTAL_CANVAS false
19 std::shared_ptr<impeller::Context> context) {
20 if (!context || !context->IsValid()) {
24 auto renderer = std::make_shared<impeller::Renderer>(context);
29 auto aiks_context = std::make_shared<impeller::AiksContext>(
31 if (!aiks_context->IsValid()) {
35 impeller_context_ = std::move(context);
36 impeller_renderer_ = std::move(
renderer);
37 aiks_context_ = std::move(aiks_context);
50std::unique_ptr<SurfaceFrame> GPUSurfaceVulkanImpeller::AcquireFrame(
58 FML_LOG(
ERROR) <<
"Vulkan surface was asked for an empty frame.";
63 std::unique_ptr<impeller::Surface>
surface = context_vk.AcquireNextSurface();
72 aiks_context = aiks_context_,
74 ](SurfaceFrame& surface_frame,
DlCanvas* canvas)
mutable ->
bool {
79 auto display_list = surface_frame.BuildDisplayList();
81 FML_LOG(
ERROR) <<
"Could not build display list for surface frame.";
86 surface->GetTargetRenderPassDescriptor().GetRenderTargetSize();
92#if ENABLE_EXPERIMENTAL_CANVAS
95 display_list->Dispatch(
99 aiks_context->GetContentContext(), render_target,
100 display_list->root_has_backdrop_filter(),
101 display_list->max_root_blend_mode(),
104 display_list->Dispatch(
107 impeller_dispatcher.FinishRecording();
108 aiks_context->GetContentContext().GetTransientsBuffer().Reset();
109 aiks_context->GetContentContext()
116 display_list->Dispatch(
119 auto picture = impeller_dispatcher.EndRecordingAsPicture();
121 return aiks_context->Render(
picture, render_target,
127 return std::make_unique<SurfaceFrame>(
129 SurfaceFrame::FramebufferInfo{},
138SkMatrix GPUSurfaceVulkanImpeller::GetRootTransformation()
const {
151std::unique_ptr<GLContextResult>
152GPUSurfaceVulkanImpeller::MakeRenderContextCurrent() {
154 return std::make_unique<GLContextDefaultResult>(
true);
158bool GPUSurfaceVulkanImpeller::EnableRasterCache()
const {
163std::shared_ptr<impeller::AiksContext>
164GPUSurfaceVulkanImpeller::GetAiksContext()
const {
165 return aiks_context_;
~GPUSurfaceVulkanImpeller() override
GPUSurfaceVulkanImpeller(std::shared_ptr< impeller::Context > context)
std::function< bool(SurfaceFrame &surface_frame, DlCanvas *canvas)> SubmitCallback
static SurfaceContextVK & Cast(Context &base)
Performs a first pass over the display list to collect all text frames.
static std::shared_ptr< TypographerContext > Make()
#define FML_LOG(severity)
sk_sp< const SkPicture > picture
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
internal::CopyableLambda< T > MakeCopyable(T lambda)
flutter::DlCanvas DlCanvas
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
A 4x4 matrix using column-major storage.
RoundOut(const TRect< U > &r)
static constexpr TRect MakeSize(const TSize< U > &size)