5#include "flutter/flow/surface_frame.h"
10#include "flutter/fml/logging.h"
11#include "flutter/fml/trace_event.h"
22 std::unique_ptr<GLContextResult> context_result,
23 bool display_list_fallback)
25 framebuffer_info_(framebuffer_info),
26 submit_callback_(submit_callback),
27 context_result_(
std::move(context_result)) {
37 }
else if (display_list_fallback) {
44 dl_builder_ = sk_make_sp<DisplayListBuilder>(
SkRect::Make(frame_size),
46 canvas_ = dl_builder_.get();
56 submitted_ = PerformSubmit();
73bool SurfaceFrame::PerformSubmit() {
74 if (submit_callback_ ==
nullptr) {
78 if (submit_callback_(*
this,
Canvas())) {
86 TRACE_EVENT0(
"impeller",
"SurfaceFrame::BuildDisplayList");
87 return dl_builder_ ? dl_builder_->Build() :
nullptr;
Developer-facing API for rendering anything within the engine.
void set_canvas(SkCanvas *canvas)
std::function< bool(SurfaceFrame &surface_frame, DlCanvas *canvas)> SubmitCallback
SurfaceFrame(sk_sp< SkSurface > surface, FramebufferInfo framebuffer_info, const SubmitCallback &submit_callback, SkISize frame_size, std::unique_ptr< GLContextResult > context_result=nullptr, bool display_list_fallback=false)
sk_sp< DisplayList > BuildDisplayList()
sk_sp< SkSurface > SkiaSurface() const
#define FML_LOG(severity)
#define FML_DCHECK(condition)
static SkRect Make(const SkISize &size)
#define TRACE_EVENT0(category_group, name)