16 : context_(
Ref(&context)), surface_(
std::move(surface)) {
18 context_ && context_->IsValid() && surface_ && surface_->IsValid();
34 context.
GetContext(), []() { return true; }, fbo, color_format, size);
35 if (!impeller_surface || !impeller_surface->IsValid()) {
40 auto surface = Create<Surface>(context, std::move(impeller_surface));
41 if (!surface->IsValid()) {
58 auto& content_context = context_->GetAiksContext().GetContentContext();
59 auto render_target = surface_->GetRenderTarget();
63 SkIRect::MakeWH(cull_rect.GetWidth(), cull_rect.GetHeight());
65 auto result =
RenderToTarget(content_context, render_target, display_list,
66 skia_cull_rect,
true);
67 context_->GetContext()->ResetThreadLocalState();
static std::unique_ptr< Surface > WrapFBO(const std::shared_ptr< Context > &context, SwapCallback swap_callback, GLuint fbo, PixelFormat color_format, ISize fbo_size)
std::shared_ptr< impeller::Context > GetContext() const
const sk_sp< flutter::DisplayList > GetDisplayList() const
Surface(Context &context, std::shared_ptr< impeller::Surface > surface)
static ScopedObject< Surface > WrapFBO(Context &context, uint64_t fbo, PixelFormat color_format, ISize size)
bool DrawDisplayList(const DisplayList &dl) const
ScopedObject< Object > Ref(Object *object)
bool RenderToTarget(ContentContext &context, RenderTarget render_target, const sk_sp< flutter::DisplayList > &display_list, SkIRect cull_rect, bool reset_host_buffer, bool is_onscreen)
Render the provided display list to the render target.
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
constexpr static TRect MakeSize(const TSize< U > &size)