5#include "flutter/shell/common/platform_view.h"
9#include "flutter/fml/make_copyable.h"
10#include "flutter/fml/synchronization/waitable_event.h"
11#include "flutter/shell/common/vsync_waiter_fallback.h"
23 <<
"This platform does not provide a Vsync waiter implementation. A "
24 "simple timer based fallback is being used.";
29 std::unique_ptr<PlatformMessage>
message) {
34 std::unique_ptr<PointerDataPacket> packet) {
60 std::unique_ptr<Surface>
surface;
68 surface = platform_view->CreateRenderingSurface();
69 if (surface && !surface->IsValid()) {
76 FML_LOG(
ERROR) <<
"Failed to create platform view rendering surface";
82void PlatformView::NotifyDestroyed() {
86void PlatformView::ScheduleFrame() {
90void PlatformView::AddView(int64_t view_id,
93 delegate_.OnPlatformViewAddView(view_id, viewport_metrics,
102 FML_DLOG(WARNING) <<
"This platform does not set up the resource "
103 "context on the IO thread for async texture uploads.";
107std::shared_ptr<impeller::Context> PlatformView::GetImpellerContext()
const {
111void PlatformView::ReleaseResourceContext()
const {}
115 return std::make_unique<DefaultPointerDataDispatcher>(delegate);
120 return weak_factory_.GetWeakPtr();
123void PlatformView::UpdateSemantics(
128void PlatformView::SendChannelUpdate(
const std::string&
name,
bool listening) {}
130void PlatformView::HandlePlatformMessage(
131 std::unique_ptr<PlatformMessage>
message) {
132 if (
auto response =
message->response()) {
133 response->CompleteEmpty();
137void PlatformView::OnPreEngineRestart()
const {}
139void PlatformView::RegisterTexture(std::shared_ptr<flutter::Texture>
texture) {
147void PlatformView::MarkTextureFrameAvailable(int64_t
texture_id) {
151std::unique_ptr<Surface> PlatformView::CreateRenderingSurface() {
154 FML_DCHECK(
false) <<
"This platform does not provide a rendering surface but "
155 "it was notified of surface rendering surface creation.";
159std::shared_ptr<ExternalViewEmbedder>
160PlatformView::CreateExternalViewEmbedder() {
162 <<
"This platform doesn't support embedding external views.";
171 delegate_.OnPlatformViewSetNextFrameCallback(closure);
174std::unique_ptr<std::vector<std::string>>
175PlatformView::ComputePlatformResolvedLocales(
176 const std::vector<std::string>& supported_locale_data) {
177 std::unique_ptr<std::vector<std::string>> out =
178 std::make_unique<std::vector<std::string>>();
182void PlatformView::RequestDartDeferredLibrary(intptr_t loading_unit_id) {}
184void PlatformView::LoadDartDeferredLibrary(
185 intptr_t loading_unit_id,
186 std::unique_ptr<const fml::Mapping> snapshot_data,
187 std::unique_ptr<const fml::Mapping> snapshot_instructions) {}
189void PlatformView::LoadDartDeferredLibraryError(
190 intptr_t loading_unit_id,
195void PlatformView::UpdateAssetResolverByType(
196 std::unique_ptr<AssetResolver> updated_asset_resolver,
198 delegate_.UpdateAssetResolverByType(std::move(updated_asset_resolver),
type);
201std::unique_ptr<SnapshotSurfaceProducer>
202PlatformView::CreateSnapshotSurfaceProducer() {
206std::shared_ptr<PlatformMessageHandler>
207PlatformView::GetPlatformMessageHandler()
const {
212 return delegate_.OnPlatformViewGetSettings();
215double PlatformView::GetScaledFontSize(
double unscaled_font_size,
216 int configuration_id)
const {
AssetResolverType
Identifies the type of AssetResolver an instance is.
The interface for Engine to implement.
std::unique_ptr< PointerDataPacket > Convert(std::unique_ptr< PointerDataPacket > packet)
Converts pointer data packet into a form that framework understands. The raw pointer data packet from...
fml::RefPtr< fml::TaskRunner > GetRasterTaskRunner() const
A Mapping like NonOwnedMapping, but uses Free as its release proc.
static void RunNowOrPostTask(const fml::RefPtr< fml::TaskRunner > &runner, const fml::closure &task)
TaskRunners task_runners_
FlutterSemanticsFlag flags
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
#define FML_DLOG(severity)
#define FML_LOG(severity)
#define FML_UNREACHABLE()
#define FML_DCHECK(condition)
std::unordered_map< int32_t, SemanticsNode > SemanticsNodeUpdates
std::unordered_map< int32_t, CustomAccessibilityAction > CustomAccessibilityActionUpdates
std::function< std::unique_ptr< PointerDataDispatcher >(PointerDataDispatcher::Delegate &)> PointerDataDispatcherMaker
Signature for constructing PointerDataDispatcher.
std::function< void()> closure