5#ifndef FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_EXTERNAL_VIEW_EMBEDDER_H_
6#define FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_EXTERNAL_VIEW_EMBEDDER_H_
10#include <unordered_map>
12#include "flutter/flow/embedded_views.h"
13#include "flutter/fml/hash_combine.h"
14#include "flutter/fml/macros.h"
15#include "flutter/shell/platform/embedder/embedder_external_view.h"
16#include "flutter/shell/platform/embedder/embedder_render_target_cache.h"
33 std::function<std::unique_ptr<EmbedderRenderTarget>(
35 const std::shared_ptr<impeller::AiksContext>& aiks_context,
39 const std::vector<const FlutterLayer*>& layers)>;
60 bool avoid_backing_store_cache,
85 void CancelFrame()
override;
90 raster_thread_merger)
override;
93 void PrepareFlutterView(
SkISize frame_size,
94 double device_pixel_ratio)
override;
97 void PrerollCompositeEmbeddedView(
99 std::unique_ptr<EmbeddedViewParams>
params)
override;
102 DlCanvas* CompositeEmbeddedView(int64_t view_id)
override;
105 void SubmitFlutterView(
106 int64_t flutter_view_id,
108 const std::shared_ptr<impeller::AiksContext>& aiks_context,
109 std::unique_ptr<SurfaceFrame>
frame)
override;
115 const bool avoid_backing_store_cache_;
120 double pending_device_pixel_ratio_ = 1.0;
121 SkMatrix pending_surface_transformation_;
123 std::vector<EmbedderExternalView::ViewIdentifier> composition_order_;
125 std::unordered_map<int64_t, EmbedderRenderTargetCache> render_target_caches_;
129 SkMatrix GetSurfaceTransformation()
const;
Developer-facing API for rendering anything within the engine.
The external view embedder used by the generic embedder API. This class acts a proxy between the rast...
void CollectView(int64_t view_id) override
EmbedderExternalViewEmbedder(bool avoid_backing_store_cache, const CreateRenderTargetCallback &create_render_target_callback, const PresentCallback &present_callback)
Creates an external view embedder used by the generic embedder API.
std::function< SkMatrix(void)> SurfaceTransformationCallback
~EmbedderExternalViewEmbedder() override
Collects the external view embedder.
std::function< bool(FlutterViewId view_id, const std::vector< const FlutterLayer * > &layers)> PresentCallback
std::function< std::unique_ptr< EmbedderRenderTarget >(GrDirectContext *context, const std::shared_ptr< impeller::AiksContext > &aiks_context, const FlutterBackingStoreConfig &config)> CreateRenderTargetCallback
void SetSurfaceTransformationCallback(SurfaceTransformationCallback surface_transformation_callback)
Sets the surface transformation callback used by the external view embedder to ask the platform for t...
std::unordered_map< ViewIdentifier, std::unique_ptr< EmbedderExternalView >, ViewIdentifier::Hash, ViewIdentifier::Equal > PendingViews
const EmbeddedViewParams * params
Dart_NativeFunction function
static constexpr SkISize Make(int32_t w, int32_t h)