5#ifndef FLUTTER_FLOW_EMBEDDED_VIEWS_H_
6#define FLUTTER_FLOW_EMBEDDED_VIEWS_H_
19#if IMPELLER_SUPPORTS_RENDERING
50 : filter_(
std::move(filter)), filter_rect_(filter_rect) {}
56 return *filter_ == *other.filter_ && filter_rect_ == other.filter_rect_;
60 std::shared_ptr<DlImageFilter> filter_;
79 explicit Mutator(
const uint8_t& alpha) : data_(alpha) {}
80 explicit Mutator(
const std::shared_ptr<DlImageFilter>& filter,
91 return std::get<DlRoundSuperellipse>(data_);
99 return std::get<ImageFilterMutation>(data_);
101 const uint8_t&
GetAlpha()
const {
return std::get<uint8_t>(data_); }
152 const DlRect& filter_rect);
162 const std::vector<std::shared_ptr<Mutator>>::const_reverse_iterator
Top()
166 const std::vector<std::shared_ptr<Mutator>>::const_reverse_iterator
Bottom()
171 const std::vector<std::shared_ptr<Mutator>>::const_iterator
Begin()
const;
175 const std::vector<std::shared_ptr<Mutator>>::const_iterator
End()
const;
181 if (vector_.size() != other.vector_.size()) {
184 for (
size_t i = 0;
i < vector_.size();
i++) {
185 if (*vector_[
i] != *other.vector_[
i]) {
193 if (vector_.size() != other.size()) {
196 for (
size_t i = 0;
i < vector_.size();
i++) {
197 if (*vector_[
i] != other[
i]) {
213 std::vector<std::shared_ptr<Mutator>> vector_;
224 size_points_(size_points),
225 mutators_stack_(
std::move(mutators_stack)) {
226 final_bounding_rect_ =
248 const DlRect& filter_rect) {
253 return size_points_ == other.size_points_ &&
254 mutators_stack_ == other.mutators_stack_ &&
255 final_bounding_rect_ == other.final_bounding_rect_ &&
256 matrix_ == other.matrix_;
263 DlRect final_bounding_rect_;
310 std::unique_ptr<DisplayListBuilder> builder_;
311 sk_sp<DisplayList> display_list_;
373 GrDirectContext* context,
377 int64_t platform_view_id,
378 std::unique_ptr<EmbeddedViewParams>
params) = 0;
394 double device_pixel_ratio) = 0;
405 int64_t flutter_view_id,
406 GrDirectContext* context,
407 const std::shared_ptr<impeller::AiksContext>& aiks_context,
408 std::unique_ptr<SurfaceFrame> frame);
422 bool should_resubmit_frame,
440 used_this_frame_ = used_this_frame;
459 const std::shared_ptr<DlImageFilter>& filter,
460 const DlRect& filter_rect) {}
463 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)
const DlSize & sizePoints() const
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 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
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 DlMatrix & GetMatrix() const
float GetAlphaFloat() const
const ImageFilterMutation & GetFilterMutation() const
const uint8_t & GetAlpha() const
Mutator(const DlRoundSuperellipse &rrect)
MutatorType GetType() const
const DlRoundRect GetRSEApproximation() const
const DlPath & GetPath() const
Mutator(const DlRect &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)
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
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
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)
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
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)