5#ifndef FLUTTER_FLOW_EMBEDDED_VIEWS_H_
6#define FLUTTER_FLOW_EMBEDDED_VIEWS_H_
12#include "flutter/display_list/dl_builder.h"
13#include "flutter/display_list/skia/dl_sk_canvas.h"
14#include "flutter/flow/surface_frame.h"
15#include "flutter/fml/memory/ref_counted.h"
16#include "flutter/fml/raster_thread_merger.h"
23#if IMPELLER_SUPPORTS_RENDERING
24#include "flutter/impeller/aiks/aiks_context.h"
25#include "flutter/impeller/renderer/context.h"
55 : filter_(
std::move(filter)), filter_rect_(filter_rect) {}
61 return *filter_ == *other.filter_ && filter_rect_ == other.filter_rect_;
69 std::shared_ptr<const DlImageFilter> filter_;
83 switch (other.type_) {
100 filter_mutation_ = other.filter_mutation_;
114 explicit Mutator(
const std::shared_ptr<const DlImageFilter>& filter,
115 const SkRect& filter_rect)
126 return *filter_mutation_;
132 if (type_ != other.type_) {
147 return *filter_mutation_ == *other.filter_mutation_;
178 std::shared_ptr<ImageFilterMutation> filter_mutation_;
201 const SkRect& filter_rect);
211 const std::vector<std::shared_ptr<Mutator>>::const_reverse_iterator
Top()
215 const std::vector<std::shared_ptr<Mutator>>::const_reverse_iterator
Bottom()
220 const std::vector<std::shared_ptr<Mutator>>::const_iterator
Begin()
const;
224 const std::vector<std::shared_ptr<Mutator>>::const_iterator
End()
const;
230 if (vector_.size() != other.vector_.size()) {
233 for (
size_t i = 0;
i < vector_.size();
i++) {
234 if (*vector_[
i] != *other.vector_[
i]) {
242 if (vector_.size() != other.size()) {
245 for (
size_t i = 0;
i < vector_.size();
i++) {
246 if (*vector_[
i] != other[
i]) {
262 std::vector<std::shared_ptr<Mutator>> vector_;
273 size_points_(size_points),
274 mutators_stack_(
std::move(mutators_stack)) {
277 path.addRect(starting_rect);
279 final_bounding_rect_ =
path.getBounds();
300 const SkRect& filter_rect) {
305 return size_points_ == other.size_points_ &&
306 mutators_stack_ == other.mutators_stack_ &&
307 final_bounding_rect_ == other.final_bounding_rect_ &&
308 matrix_ == other.matrix_;
315 SkRect final_bounding_rect_;
364 std::unique_ptr<DisplayListBuilder> builder_;
431 int64_t platform_view_id,
432 std::unique_ptr<EmbeddedViewParams>
params) = 0;
448 double device_pixel_ratio) = 0;
459 int64_t flutter_view_id,
461 const std::shared_ptr<impeller::AiksContext>& aiks_context,
462 std::unique_ptr<SurfaceFrame>
frame);
476 bool should_resubmit_frame,
494 used_this_frame_ = used_this_frame;
513 const std::shared_ptr<const DlImageFilter>& filter,
514 const SkRect& filter_rect) {}
517 bool used_this_frame_ =
false;
void dispatch(DlOpReceiver &receiver)
DlCanvas * canvas() override
~DisplayListEmbedderViewSlice() override=default
const DlRegion & getRegion() const override
void end_recording() override
DisplayListEmbedderViewSlice(SkRect view_bounds)
void render_into(DlCanvas *canvas) override
Developer-facing API for rendering anything within the engine.
Internal API for rendering recorded display lists to backends.
static DlRegion MakeIntersection(const DlRegion &a, const DlRegion &b)
EmbeddedViewParams()=default
const SkSize & sizePoints() const
void PushImageFilter(const std::shared_ptr< const DlImageFilter > &filter, const SkRect &filter_rect)
const SkRect & finalBoundingRect() const
const SkMatrix & transformMatrix() const
EmbeddedViewParams(SkMatrix matrix, SkSize size_points, MutatorsStack mutators_stack)
bool operator==(const EmbeddedViewParams &other) const
const MutatorsStack & mutatorsStack() const
virtual void render_into(DlCanvas *canvas)=0
virtual DlCanvas * canvas()=0
virtual ~EmbedderViewSlice()=default
virtual void end_recording()=0
DlRegion region(const SkRect &query) const
virtual const DlRegion & getRegion() const =0
virtual void PushFilterToVisitedPlatformViews(const std::shared_ptr< const DlImageFilter > &filter, const SkRect &filter_rect)
virtual bool SupportsDynamicThreadMerging()
virtual void EndFrame(bool should_resubmit_frame, const fml::RefPtr< fml::RasterThreadMerger > &raster_thread_merger)
virtual void BeginFrame(GrDirectContext *context, const fml::RefPtr< fml::RasterThreadMerger > &raster_thread_merger)=0
bool GetUsedThisFrame() const
virtual void PrerollCompositeEmbeddedView(int64_t platform_view_id, std::unique_ptr< EmbeddedViewParams > params)=0
virtual void PushVisitedPlatformView(int64_t platform_view_id)
virtual void CollectView(int64_t view_id)
virtual DlCanvas * CompositeEmbeddedView(int64_t platform_view_id)=0
void SetUsedThisFrame(bool used_this_frame)
virtual void PrepareFlutterView(SkISize frame_size, double device_pixel_ratio)=0
virtual DlCanvas * GetRootCanvas()=0
virtual ~ExternalViewEmbedder()=default
virtual PostPrerollResult PostPrerollAction(const fml::RefPtr< fml::RasterThreadMerger > &raster_thread_merger)
virtual void SubmitFlutterView(int64_t flutter_view_id, GrDirectContext *context, const std::shared_ptr< impeller::AiksContext > &aiks_context, std::unique_ptr< SurfaceFrame > frame)
ExternalViewEmbedder()=default
virtual void CancelFrame()=0
bool operator!=(const ImageFilterMutation &other) const
bool operator==(const ImageFilterMutation &other) const
const SkRect & GetFilterRect() const
ImageFilterMutation(std::shared_ptr< const DlImageFilter > filter, const SkRect &filter_rect)
const DlImageFilter & GetFilter() const
float GetAlphaFloat() const
const SkMatrix & GetMatrix() const
Mutator(const SkRRect &rrect)
const ImageFilterMutation & GetFilterMutation() const
const MutatorType & GetType() const
Mutator(const std::shared_ptr< const DlImageFilter > &filter, const SkRect &filter_rect)
const SkPath & GetPath() const
const SkRRect & GetRRect() const
bool operator==(const Mutator &other) const
Mutator(const SkMatrix &matrix)
const int & GetAlpha() const
Mutator(const Mutator &other)
bool operator!=(const Mutator &other) const
Mutator(const int &alpha)
Mutator(const SkRect &rect)
Mutator(const SkPath &path)
const SkRect & GetRect() const
const EmbeddedViewParams * params
unsigned useCenter Optional< SkMatrix > matrix
sk_sp< SkBlender > blender SkRect rect
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
void roundOut(SkIRect *dst) const
static constexpr SkRect MakeSize(const SkSize &size)