5#ifndef FLUTTER_IMPELLER_AIKS_EXPERIMENTAL_CANVAS_H_
6#define FLUTTER_IMPELLER_AIKS_EXPERIMENTAL_CANVAS_H_
32 bool requires_readback);
36 bool requires_readback,
41 bool requires_readback,
46 void Save(uint32_t total_content_depth)
override;
49 std::optional<Rect>
bounds,
50 const std::shared_ptr<ImageFilter>& backdrop_filter,
52 uint32_t total_content_depth,
53 bool can_distribute_opacity)
override;
59 void DrawTextFrame(
const std::shared_ptr<TextFrame>& text_frame,
70 size_t GetClipHeightFloor()
const {
77 ContentContext& renderer_;
79 const bool requires_readback_;
80 EntityPassClipStack clip_coverage_stack_;
81 std::vector<std::unique_ptr<InlinePassContext>> inline_pass_contexts_;
82 std::vector<std::unique_ptr<EntityPassTarget>> entity_pass_targets_;
83 std::vector<SaveLayerState> save_layer_state_;
84 std::vector<std::shared_ptr<RenderPass>> render_passes_;
86 void SetupRenderPass();
88 void AddRenderEntityToCurrentPass(Entity entity,
bool reuse_depth)
override;
89 void AddClipEntityToCurrentPass(Entity entity)
override;
90 bool BlitToOnscreen();
92 Point GetGlobalPassPosition() {
93 if (save_layer_state_.empty()) {
96 return save_layer_state_.back().coverage.GetOrigin();
std::deque< CanvasStackEntry > transform_stack_
void DrawTextFrame(const std::shared_ptr< TextFrame > &text_frame, Point position, const Paint &paint) override
ExperimentalCanvas(ContentContext &renderer, RenderTarget &render_target, bool requires_readback)
~ExperimentalCanvas() override=default
void Save(uint32_t total_content_depth) override
void SaveLayer(const Paint &paint, std::optional< Rect > bounds, const std::shared_ptr< ImageFilter > &backdrop_filter, ContentBoundsPromise bounds_promise, uint32_t total_content_depth, bool can_distribute_opacity) override
Optional< SkRect > bounds
SK_API sk_sp< SkSurface > RenderTarget(GrRecordingContext *context, skgpu::Budgeted budgeted, const SkImageInfo &imageInfo, int sampleCount, GrSurfaceOrigin surfaceOrigin, const SkSurfaceProps *surfaceProps, bool shouldCreateWithMips=false, bool isProtected=false)