Flutter Engine
The Flutter Engine
embedded_views.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "flutter/flow/embedded_views.h"
6
7namespace flutter {
8
10 builder_ = std::make_unique<DisplayListBuilder>(
11 /*bounds=*/view_bounds,
12 /*prepare_rtree=*/true);
13}
14
16 return builder_ ? builder_.get() : nullptr;
17}
18
20 display_list_ = builder_->Build();
21 FML_DCHECK(display_list_->has_rtree());
22 builder_ = nullptr;
23}
24
26 return display_list_->rtree()->region();
27}
28
30 canvas->DrawDisplayList(display_list_);
31}
32
34 display_list_->Dispatch(receiver);
35}
36
38 return display_list_->bounds().isEmpty();
39}
40
42 return builder_ == nullptr;
43}
44
45void ExternalViewEmbedder::CollectView(int64_t view_id) {}
46
48 int64_t flutter_view_id,
49 GrDirectContext* context,
50 const std::shared_ptr<impeller::AiksContext>& aiks_context,
51 std::unique_ptr<SurfaceFrame> frame) {
52 frame->Submit();
53}
54
56 return false;
57}
58
60
62 std::shared_ptr<Mutator> element = std::make_shared<Mutator>(rect);
63 vector_.push_back(element);
64}
65
67 std::shared_ptr<Mutator> element = std::make_shared<Mutator>(rrect);
68 vector_.push_back(element);
69}
70
72 std::shared_ptr<Mutator> element = std::make_shared<Mutator>(path);
73 vector_.push_back(element);
74}
75
77 std::shared_ptr<Mutator> element = std::make_shared<Mutator>(matrix);
78 vector_.push_back(element);
79}
80
81void MutatorsStack::PushOpacity(const int& alpha) {
82 std::shared_ptr<Mutator> element = std::make_shared<Mutator>(alpha);
83 vector_.push_back(element);
84}
85
87 const std::shared_ptr<const DlImageFilter>& filter,
88 const SkRect& filter_rect) {
89 std::shared_ptr<Mutator> element =
90 std::make_shared<Mutator>(filter, filter_rect);
91 vector_.push_back(element);
92}
93
95 vector_.pop_back();
96}
97
98void MutatorsStack::PopTo(size_t stack_count) {
99 while (vector_.size() > stack_count) {
100 Pop();
101 }
102}
103
104const std::vector<std::shared_ptr<Mutator>>::const_reverse_iterator
106 return vector_.rend();
107}
108
109const std::vector<std::shared_ptr<Mutator>>::const_reverse_iterator
111 return vector_.rbegin();
112}
113
114const std::vector<std::shared_ptr<Mutator>>::const_iterator
116 return vector_.begin();
117}
118
119const std::vector<std::shared_ptr<Mutator>>::const_iterator MutatorsStack::End()
120 const {
121 return vector_.end();
122}
123
124} // namespace flutter
Definition: SkPath.h:59
void dispatch(DlOpReceiver &receiver)
const DlRegion & getRegion() const override
DisplayListEmbedderViewSlice(SkRect view_bounds)
void render_into(DlCanvas *canvas) override
Developer-facing API for rendering anything within the engine.
Definition: dl_canvas.h:38
virtual void DrawDisplayList(const sk_sp< DisplayList > display_list, SkScalar opacity=SK_Scalar1)=0
Internal API for rendering recorded display lists to backends.
virtual bool SupportsDynamicThreadMerging()
virtual void CollectView(int64_t view_id)
virtual void SubmitFlutterView(int64_t flutter_view_id, GrDirectContext *context, const std::shared_ptr< impeller::AiksContext > &aiks_context, std::unique_ptr< SurfaceFrame > frame)
size_t stack_count() const
void PushClipPath(const SkPath &path)
void PushOpacity(const int &alpha)
const std::vector< std::shared_ptr< Mutator > >::const_reverse_iterator Top() const
const std::vector< std::shared_ptr< Mutator > >::const_reverse_iterator Bottom() const
void PushBackdropFilter(const std::shared_ptr< const DlImageFilter > &filter, const SkRect &filter_rect)
const std::vector< std::shared_ptr< Mutator > >::const_iterator End() const
void PopTo(size_t stack_count)
void PushClipRect(const SkRect &rect)
void PushTransform(const SkMatrix &matrix)
const std::vector< std::shared_ptr< Mutator > >::const_iterator Begin() const
void PushClipRRect(const SkRRect &rrect)
double frame
Definition: examples.cpp:31
#define FML_DCHECK(condition)
Definition: logging.h:103
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258
SkRRect rrect
Definition: SkRecords.h:232
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350
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
Definition: switches.h:57