12 bool support_thread_merging)
13 : end_frame_call_back_(end_frame_call_back),
14 post_preroll_result_(post_preroll_result),
15 support_thread_merging_(support_thread_merging),
16 submitted_frame_count_(0) {}
20 post_preroll_result_ = post_preroll_result;
24 return submitted_frame_count_;
28 return last_submitted_frame_size_;
32 return visited_platform_views_;
36 return mutators_stacks_[view_id];
40void ShellTestExternalViewEmbedder::CancelFrame() {}
43void ShellTestExternalViewEmbedder::BeginFrame(
48void ShellTestExternalViewEmbedder::PrepareFlutterView(
50 double device_pixel_ratio) {
51 visited_platform_views_.clear();
52 mutators_stacks_.clear();
53 current_composition_params_.clear();
57void ShellTestExternalViewEmbedder::PrerollCompositeEmbeddedView(
59 std::unique_ptr<EmbeddedViewParams>
params) {
61 auto view = std::make_unique<DisplayListEmbedderViewSlice>(view_bounds);
62 slices_.insert_or_assign(view_id, std::move(view));
69 return post_preroll_result_;
73void ShellTestExternalViewEmbedder::PushVisitedPlatformView(int64_t view_id) {
74 visited_platform_views_.push_back(view_id);
78void ShellTestExternalViewEmbedder::PushFilterToVisitedPlatformViews(
79 const std::shared_ptr<const DlImageFilter>& filter,
80 const SkRect& filter_rect) {
81 for (int64_t
id : visited_platform_views_) {
82 EmbeddedViewParams
params = current_composition_params_[
id];
83 params.PushImageFilter(filter, filter_rect);
84 current_composition_params_[
id] =
params;
85 mutators_stacks_[
id] =
params.mutatorsStack();
89DlCanvas* ShellTestExternalViewEmbedder::CompositeEmbeddedView(
91 return slices_[view_id]->canvas();
95void ShellTestExternalViewEmbedder::SubmitFlutterView(
96 int64_t flutter_view_id,
98 const std::shared_ptr<impeller::AiksContext>& aiks_context,
99 std::unique_ptr<SurfaceFrame>
frame) {
104 if (
frame->SkiaSurface()) {
106 frame->SkiaSurface()->height());
110 submitted_frame_count_++;
114void ShellTestExternalViewEmbedder::EndFrame(
115 bool should_resubmit_frame,
117 end_frame_call_back_(should_resubmit_frame, raster_thread_merger);
121DlCanvas* ShellTestExternalViewEmbedder::GetRootCanvas() {
125bool ShellTestExternalViewEmbedder::SupportsDynamicThreadMerging() {
126 return support_thread_merging_;
int GetSubmittedFrameCount()
void UpdatePostPrerollResult(PostPrerollResult post_preroll_result)
MutatorsStack GetStack(int64_t)
std::vector< int64_t > GetVisitedPlatformViews()
SkISize GetLastSubmittedFrameSize()
std::function< void(bool, fml::RefPtr< fml::RasterThreadMerger >)> EndFrameCallBack
ShellTestExternalViewEmbedder(const EndFrameCallBack &end_frame_call_back, PostPrerollResult post_preroll_result, bool support_thread_merging)
const EmbeddedViewParams * params
#define FML_DCHECK(condition)
flutter::DlCanvas DlCanvas
static constexpr SkISize MakeEmpty()
static constexpr SkISize Make(int32_t w, int32_t h)
static SkRect Make(const SkISize &size)