5#ifndef FLUTTER_FLOW_EMBEDDED_VIEWS_H_
6#define FLUTTER_FLOW_EMBEDDED_VIEWS_H_
21#if IMPELLER_SUPPORTS_RENDERING
56 : filter_(
std::move(filter)), filter_rect_(filter_rect) {}
62 return *filter_ == *other.filter_ && filter_rect_ == other.filter_rect_;
66 std::shared_ptr<DlImageFilter> filter_;
121 explicit Mutator(
const uint8_t& alpha) : data_(alpha) {}
122 explicit Mutator(
const std::shared_ptr<DlImageFilter>& filter,
123 const DlRect& filter_rect)
127 : data_(backdrop_rect) {}
129 : data_(backdrop_rrect) {}
131 : data_(backdrop_rse) {}
133 : data_(backdrop_path) {}
142 return std::get<DlRoundSuperellipse>(data_);
150 return std::get<ImageFilterMutation>(data_);
153 return std::get<BackdropClipRect>(data_);
156 return std::get<BackdropClipRRect>(data_);
159 return std::get<BackdropClipRSuperellipse>(data_);
162 return std::get<BackdropClipPath>(data_);
164 const uint8_t&
GetAlpha()
const {
return std::get<uint8_t>(data_); }
223 const DlRect& filter_rect);
237 const std::vector<std::shared_ptr<Mutator>>::const_reverse_iterator
Top()
241 const std::vector<std::shared_ptr<Mutator>>::const_reverse_iterator
Bottom()
246 const std::vector<std::shared_ptr<Mutator>>::const_iterator
Begin()
const;
250 const std::vector<std::shared_ptr<Mutator>>::const_iterator
End()
const;
256 if (vector_.size() != other.vector_.size()) {
259 for (
size_t i = 0;
i < vector_.size();
i++) {
260 if (*vector_[
i] != *other.vector_[
i]) {
268 if (vector_.size() != other.size()) {
271 for (
size_t i = 0;
i < vector_.size();
i++) {
272 if (*vector_[
i] != other[
i]) {
288 std::vector<std::shared_ptr<Mutator>> vector_;
299 size_points_(size_points),
300 mutators_stack_(
std::move(mutators_stack)) {
301 final_bounding_rect_ =
323 const DlRect& filter_rect) {
344 return size_points_ == other.size_points_ &&
345 mutators_stack_ == other.mutators_stack_ &&
346 final_bounding_rect_ == other.final_bounding_rect_ &&
347 matrix_ == other.matrix_;
354 DlRect final_bounding_rect_;
401 std::unique_ptr<DisplayListBuilder> builder_;
402 sk_sp<DisplayList> display_list_;
464 GrDirectContext* context,
468 int64_t platform_view_id,
469 std::unique_ptr<EmbeddedViewParams>
params) = 0;
485 double device_pixel_ratio) = 0;
496 int64_t flutter_view_id,
497 GrDirectContext* context,
498 const std::shared_ptr<impeller::AiksContext>& aiks_context,
499 std::unique_ptr<SurfaceFrame> frame);
513 bool should_resubmit_frame,
531 used_this_frame_ = used_this_frame;
550 const std::shared_ptr<DlImageFilter>& filter,
551 const DlRect& filter_rect) {}
561 bool used_this_frame_ =
false;
void dispatch(DlOpReceiver &receiver)
DlCanvas * canvas() override
~DisplayListEmbedderViewSlice() override=default
const DlRegion & getRegion() const override
void end_recording() override
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
void PushImageFilter(const std::shared_ptr< DlImageFilter > &filter, const DlRect &filter_rect)
void PushPlatformViewClipRRect(const DlRoundRect &clip_rrect)
void PushPlatformViewClipPath(const DlPath &clip_path)
void PushPlatformViewClipRSuperellipse(const DlRoundSuperellipse &clip_rse)
const DlSize & sizePoints() const
void PushPlatformViewClipRect(const DlRect &clip_rect)
const DlRect & finalBoundingRect() const
EmbeddedViewParams(DlMatrix matrix, DlSize size_points, MutatorsStack mutators_stack)
bool operator==(const EmbeddedViewParams &other) const
const MutatorsStack & mutatorsStack() const
const DlMatrix & transformMatrix() const
DlRegion region(const DlRect &query) const
virtual void render_into(DlCanvas *canvas)=0
virtual DlCanvas * canvas()=0
virtual ~EmbedderViewSlice()=default
virtual void end_recording()=0
virtual const DlRegion & getRegion() const =0
virtual bool SupportsDynamicThreadMerging()
virtual void PrepareFlutterView(DlISize frame_size, double device_pixel_ratio)=0
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 PushClipRRectToVisitedPlatformViews(const DlRoundRect &clip_rrect)
virtual void PushClipRectToVisitedPlatformViews(const DlRect &clip_rect)
virtual DlCanvas * GetRootCanvas()=0
virtual void PushClipRSuperellipseToVisitedPlatformViews(const DlRoundSuperellipse &clip_rse)
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
virtual void PushClipPathToVisitedPlatformViews(const DlPath &clip_path)
virtual void PushFilterToVisitedPlatformViews(const std::shared_ptr< DlImageFilter > &filter, const DlRect &filter_rect)
ImageFilterMutation(std::shared_ptr< DlImageFilter > filter, const DlRect &filter_rect)
bool operator==(const ImageFilterMutation &other) const
const DlRect & GetFilterRect() const
const DlImageFilter & GetFilter() const
Mutator(const DlPath &path)
const BackdropClipRRect & GetBackdropClipRRect() const
const DlMatrix & GetMatrix() const
float GetAlphaFloat() const
const BackdropClipRect & GetBackdropClipRect() const
const ImageFilterMutation & GetFilterMutation() const
const uint8_t & GetAlpha() const
Mutator(const DlRoundSuperellipse &rrect)
MutatorType GetType() const
const BackdropClipRSuperellipse & GetBackdropClipRSuperellipse() const
const DlRoundRect GetRSEApproximation() const
const BackdropClipPath & GetBackdropClipPath() const
Mutator(const BackdropClipPath &backdrop_path)
const DlPath & GetPath() const
Mutator(const BackdropClipRRect &backdrop_rrect)
Mutator(const DlRect &rect)
Mutator(const BackdropClipRect &backdrop_rect)
bool operator==(const Mutator &other) const
Mutator(const DlMatrix &matrix)
Mutator(const std::shared_ptr< DlImageFilter > &filter, const DlRect &filter_rect)
Mutator(const DlRoundRect &rrect)
Mutator(const Mutator &other)
Mutator(const BackdropClipRSuperellipse &backdrop_rse)
const DlRoundSuperellipse & GetRSE() const
Mutator(const uint8_t &alpha)
const DlRect & GetRect() const
const DlRoundRect & GetRRect() const
size_t stack_count() const
void PushTransform(const DlMatrix &matrix)
void PushBackdropFilter(const std::shared_ptr< DlImageFilter > &filter, const DlRect &filter_rect)
void PushClipRect(const DlRect &rect)
void PushClipPath(const DlPath &path)
bool operator==(const MutatorsStack &other) const
void PushPlatformViewClipRect(const DlRect &rect)
bool operator==(const std::vector< Mutator > &other) const
const std::vector< std::shared_ptr< Mutator > >::const_reverse_iterator Top() const
bool operator!=(const std::vector< Mutator > &other) const
const std::vector< std::shared_ptr< Mutator > >::const_reverse_iterator Bottom() const
void PushPlatformViewClipRRect(const DlRoundRect &rrect)
void PushPlatformViewClipPath(const DlPath &path)
const std::vector< std::shared_ptr< Mutator > >::const_iterator End() const
void PopTo(size_t stack_count)
void PushClipRRect(const DlRoundRect &rrect)
void PushOpacity(const uint8_t &alpha)
void PushClipRSE(const DlRoundSuperellipse &rrect)
void PushPlatformViewClipRSuperellipse(const DlRoundSuperellipse &rse)
const std::vector< std::shared_ptr< Mutator > >::const_iterator Begin() const
bool operator!=(const MutatorsStack &other) const
const EmbeddedViewParams * params
G_BEGIN_DECLS FlutterViewId view_id
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
impeller::RoundRect DlRoundRect
impeller::Matrix DlMatrix
impeller::RoundSuperellipse DlRoundSuperellipse
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
@ kBackdropClipRSuperellipse
BackdropClipPath(const DlPath &r)
bool operator==(const BackdropClipPath &other) const
bool operator==(const BackdropClipRRect &other) const
BackdropClipRRect(const DlRoundRect &r)
bool operator==(const BackdropClipRSuperellipse &other) const
BackdropClipRSuperellipse(const DlRoundSuperellipse &r)
bool operator==(const BackdropClipRect &other) const
BackdropClipRect(const DlRect &r)
static constexpr DlScalar toOpacity(uint8_t alpha)
A 4x4 matrix using column-major storage.
RoundRect ToApproximateRoundRect() const
RoundOut(const TRect< U > &r)
constexpr TRect TransformAndClipBounds(const Matrix &transform) const
Creates a new bounding box that contains this transformed rectangle, clipped against the near clippin...
static constexpr TRect MakeSize(const TSize< U > &size)