92 {
94 TryEndRecording();
96 << "Unnecessarily asked to render into a render target when there was "
97 "nothing to render.";
98
99#ifdef IMPELLER_SUPPORTS_RENDERING
100 auto* impeller_target = render_target.GetImpellerRenderTarget();
101 if (impeller_target) {
102 auto aiks_context = render_target.GetAiksContext();
103
104 auto dl_builder = DisplayListBuilder();
105 dl_builder.SetTransform(&surface_transformation_);
106 slice_->render_into(&dl_builder);
107 auto display_list = dl_builder.Build();
108
109#if ENABLE_EXPERIMENTAL_CANVAS
110 auto cull_rect =
114
117
119 aiks_context->GetContentContext(), *impeller_target,
120 display_list->root_has_backdrop_filter(),
121 display_list->max_root_blend_mode(), cull_rect);
122 display_list->Dispatch(impeller_dispatcher, sk_cull_rect);
123 impeller_dispatcher.FinishRecording();
124 aiks_context->GetContentContext().GetTransientsBuffer().Reset();
125 aiks_context->GetContentContext().GetLazyGlyphAtlas()->ResetTextFrames();
126
127 return true;
128#else
130 dispatcher.drawDisplayList(display_list, 1);
131 return aiks_context->Render(dispatcher.EndRecordingAsPicture(),
132 *impeller_target, true);
133#endif
134 }
135#endif
136
137#if SLIMPELLER
139 return false;
140#else
141 auto skia_surface = render_target.GetSkiaSurface();
142 if (!skia_surface) {
143 return false;
144 }
145
146 FML_DCHECK(render_target.GetRenderTargetSize() == render_surface_size_);
147
148 auto canvas = skia_surface->getCanvas();
149 if (!canvas) {
150 return false;
151 }
152 DlSkCanvasAdapter dl_canvas(canvas);
153 int restore_count = dl_canvas.GetSaveCount();
154 dl_canvas.SetTransform(surface_transformation_);
155 if (clear_surface) {
157 }
158 slice_->render_into(&dl_canvas);
159 dl_canvas.RestoreToCount(restore_count);
160 dl_canvas.Flush();
161#endif
162
163 return true;
164}
bool HasEngineRenderedContents()
Performs a first pass over the display list to collect all text frames.
#define FML_LOG(severity)
#define FML_DCHECK(condition)
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
static constexpr DlColor kTransparent()
A 4x4 matrix using column-major storage.
static constexpr TRect MakeSize(const TSize< U > &size)
#define TRACE_EVENT0(category_group, name)