Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[engine] Sync Flutter 3.13.1 source code #44

Merged
merged 4 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,13 @@ class EncodableValue : public internal::EncodableValueVariant {
}
return std::get<int64_t>(*this);
}

// Explicitly provide operator<, delegating to std::variant's operator<.
// There are issues with with the way the standard library-provided
// < and <=> comparisons interact with classes derived from variant.
friend bool operator<(const EncodableValue& lhs, const EncodableValue& rhs) {
return static_cast<const super&>(lhs) < static_cast<const super&>(rhs);
}
};

} // namespace flutter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class PluginRegistrar {
// Takes ownership of |plugin|.
//
// Plugins are not required to call this method if they have other lifetime
// management, but this is a convient place for plugins to be owned to ensure
// that they stay valid for any registered callbacks.
// management, but this is a convenient place for plugins to be owned to
// ensure that they stay valid for any registered callbacks.
void AddPlugin(std::unique_ptr<Plugin> plugin);

protected:
Expand Down
27 changes: 21 additions & 6 deletions flutter/shell/platform/embedder/embedder.h
Original file line number Diff line number Diff line change
Expand Up @@ -676,9 +676,13 @@ typedef struct {
FlutterMetalCommandQueueHandle present_command_queue;
/// The callback that gets invoked when the engine requests the embedder for a
/// texture to render to.
///
/// Not used if a FlutterCompositor is supplied in FlutterProjectArgs.
FlutterMetalTextureCallback get_next_drawable_callback;
/// The callback presented to the embedder to present a fully populated metal
/// texture to the user.
///
/// Not used if a FlutterCompositor is supplied in FlutterProjectArgs.
FlutterMetalPresentCallback present_drawable_callback;
/// When the embedder specifies that a texture has a frame available, the
/// engine will call this method (on an internal engine managed thread) so
Expand Down Expand Up @@ -805,6 +809,11 @@ typedef struct {
};
} FlutterRendererConfig;

/// Display refers to a graphics hardware system consisting of a framebuffer,
/// typically a monitor or a screen. This ID is unique per display and is
/// stable until the Flutter application restarts.
typedef uint64_t FlutterEngineDisplayId;

typedef struct {
/// The size of this struct. Must be sizeof(FlutterWindowMetricsEvent).
size_t struct_size;
Expand All @@ -826,6 +835,8 @@ typedef struct {
double physical_view_inset_bottom;
/// Left inset of window.
double physical_view_inset_left;
/// The identifier of the display the view is rendering on.
FlutterEngineDisplayId display_id;
} FlutterWindowMetricsEvent;

/// The phase of the pointer event.
Expand Down Expand Up @@ -896,7 +907,6 @@ typedef enum {
kFlutterPointerSignalKindScroll,
kFlutterPointerSignalKindScrollInertiaCancel,
kFlutterPointerSignalKindScale,
kFlutterPointerSignalKindStylusAuxiliaryAction,
} FlutterPointerSignalKind;

typedef struct {
Expand Down Expand Up @@ -1654,11 +1664,6 @@ typedef const FlutterLocale* (*FlutterComputePlatformResolvedLocaleCallback)(
const FlutterLocale** /* supported_locales*/,
size_t /* Number of locales*/);

/// Display refers to a graphics hardware system consisting of a framebuffer,
/// typically a monitor or a screen. This ID is unique per display and is
/// stable until the Flutter application restarts.
typedef uint64_t FlutterEngineDisplayId;

typedef struct {
/// This size of this struct. Must be sizeof(FlutterDisplay).
size_t struct_size;
Expand All @@ -1674,6 +1679,16 @@ typedef struct {
/// This represents the refresh period in frames per second. This value may be
/// zero if the device is not running or unavailable or unknown.
double refresh_rate;

/// The width of the display, in physical pixels.
size_t width;

/// The height of the display, in physical pixels.
size_t height;

/// The pixel ratio of the display, which is used to convert physical pixels
/// to logical pixels.
double device_pixel_ratio;
} FlutterEngineDisplay;

/// The update type parameter that is passed to
Expand Down