58 {
61 return nullptr;
62 }
63
64 auto swap_callback = [weak = weak_factory_.GetWeakPtr(),
65 delegate = delegate_]() -> bool {
66 if (weak) {
67 GLPresentInfo present_info = {
68 .fbo_id = 0u,
69 .frame_damage = std::nullopt,
70
71
72 .presentation_time = std::nullopt,
73 .buffer_damage = std::nullopt,
74 };
75 delegate->GLContextPresent(present_info);
76 }
77 return true;
78 };
79
81 if (!context_switch->GetResult()) {
83 << "Could not make the context current to acquire the frame.";
84 return nullptr;
85 }
86
87 if (!render_to_surface_) {
88 return std::make_unique<SurfaceFrame>(
89 nullptr, SurfaceFrame::FramebufferInfo{.supports_readback = true},
90 [](const SurfaceFrame& surface_frame, DlCanvas* canvas) {
91 return true;
92 },
94 }
95
96 GLFrameInfo frame_info = {
static_cast<uint32_t
>(
size.width()),
97 static_cast<uint32_t
>(
size.height())};
98 const GLFBOInfo fbo_info = delegate_->
GLContextFBO(frame_info);
100 impeller_context_,
101 swap_callback,
102 fbo_info.fbo_id,
105 );
106
109 aiks_context = aiks_context_,
111 ](SurfaceFrame& surface_frame, DlCanvas* canvas) mutable -> bool {
112 if (!aiks_context) {
113 return false;
114 }
115
116 auto display_list = surface_frame.BuildDisplayList();
117 if (!display_list) {
118 FML_LOG(
ERROR) <<
"Could not build display list for surface frame.";
119 return false;
120 }
121
122 auto cull_rect =
123 surface->GetTargetRenderPassDescriptor().GetRenderTargetSize();
126 display_list->Dispatch(
127 impeller_dispatcher,
129 auto picture = impeller_dispatcher.EndRecordingAsPicture();
130
134 [aiks_context, picture = std::move(picture)](
136 return aiks_context->Render(picture, render_target,
137 true);
138 }));
139 });
140
141 return std::make_unique<SurfaceFrame>(
142 nullptr,
144 submit_callback,
146 std::move(context_switch),
147 true
148 );
149}
virtual std::unique_ptr< GLContextResult > GLContextMakeCurrent()=0
virtual SurfaceFrame::FramebufferInfo GLContextFramebufferInfo() const
virtual GLFBOInfo GLContextFBO(GLFrameInfo frame_info) const =0
std::function< bool(SurfaceFrame &surface_frame, DlCanvas *canvas)> SubmitCallback
static std::unique_ptr< Surface > WrapFBO(const std::shared_ptr< Context > &context, SwapCallback swap_callback, GLuint fbo, PixelFormat color_format, ISize fbo_size)
#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)
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
static constexpr TRect MakeSize(const TSize< U > &size)