Skip to content

Commit 8bdfbfc

Browse files
authored
[engine] Sync Flutter 3.13.1 source code (#44)
1 parent 6f94b9c commit 8bdfbfc

File tree

3 files changed

+30
-8
lines changed

3 files changed

+30
-8
lines changed

flutter/shell/platform/common/client_wrapper/include/flutter/encodable_value.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,13 @@ class EncodableValue : public internal::EncodableValueVariant {
215215
}
216216
return std::get<int64_t>(*this);
217217
}
218+
219+
// Explicitly provide operator<, delegating to std::variant's operator<.
220+
// There are issues with with the way the standard library-provided
221+
// < and <=> comparisons interact with classes derived from variant.
222+
friend bool operator<(const EncodableValue& lhs, const EncodableValue& rhs) {
223+
return static_cast<const super&>(lhs) < static_cast<const super&>(rhs);
224+
}
218225
};
219226

220227
} // namespace flutter

flutter/shell/platform/common/client_wrapper/include/flutter/plugin_registrar.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ class PluginRegistrar {
4949
// Takes ownership of |plugin|.
5050
//
5151
// Plugins are not required to call this method if they have other lifetime
52-
// management, but this is a convient place for plugins to be owned to ensure
53-
// that they stay valid for any registered callbacks.
52+
// management, but this is a convenient place for plugins to be owned to
53+
// ensure that they stay valid for any registered callbacks.
5454
void AddPlugin(std::unique_ptr<Plugin> plugin);
5555

5656
protected:

flutter/shell/platform/embedder/embedder.h

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -676,9 +676,13 @@ typedef struct {
676676
FlutterMetalCommandQueueHandle present_command_queue;
677677
/// The callback that gets invoked when the engine requests the embedder for a
678678
/// texture to render to.
679+
///
680+
/// Not used if a FlutterCompositor is supplied in FlutterProjectArgs.
679681
FlutterMetalTextureCallback get_next_drawable_callback;
680682
/// The callback presented to the embedder to present a fully populated metal
681683
/// texture to the user.
684+
///
685+
/// Not used if a FlutterCompositor is supplied in FlutterProjectArgs.
682686
FlutterMetalPresentCallback present_drawable_callback;
683687
/// When the embedder specifies that a texture has a frame available, the
684688
/// engine will call this method (on an internal engine managed thread) so
@@ -805,6 +809,11 @@ typedef struct {
805809
};
806810
} FlutterRendererConfig;
807811

812+
/// Display refers to a graphics hardware system consisting of a framebuffer,
813+
/// typically a monitor or a screen. This ID is unique per display and is
814+
/// stable until the Flutter application restarts.
815+
typedef uint64_t FlutterEngineDisplayId;
816+
808817
typedef struct {
809818
/// The size of this struct. Must be sizeof(FlutterWindowMetricsEvent).
810819
size_t struct_size;
@@ -826,6 +835,8 @@ typedef struct {
826835
double physical_view_inset_bottom;
827836
/// Left inset of window.
828837
double physical_view_inset_left;
838+
/// The identifier of the display the view is rendering on.
839+
FlutterEngineDisplayId display_id;
829840
} FlutterWindowMetricsEvent;
830841

831842
/// The phase of the pointer event.
@@ -896,7 +907,6 @@ typedef enum {
896907
kFlutterPointerSignalKindScroll,
897908
kFlutterPointerSignalKindScrollInertiaCancel,
898909
kFlutterPointerSignalKindScale,
899-
kFlutterPointerSignalKindStylusAuxiliaryAction,
900910
} FlutterPointerSignalKind;
901911

902912
typedef struct {
@@ -1654,11 +1664,6 @@ typedef const FlutterLocale* (*FlutterComputePlatformResolvedLocaleCallback)(
16541664
const FlutterLocale** /* supported_locales*/,
16551665
size_t /* Number of locales*/);
16561666

1657-
/// Display refers to a graphics hardware system consisting of a framebuffer,
1658-
/// typically a monitor or a screen. This ID is unique per display and is
1659-
/// stable until the Flutter application restarts.
1660-
typedef uint64_t FlutterEngineDisplayId;
1661-
16621667
typedef struct {
16631668
/// This size of this struct. Must be sizeof(FlutterDisplay).
16641669
size_t struct_size;
@@ -1674,6 +1679,16 @@ typedef struct {
16741679
/// This represents the refresh period in frames per second. This value may be
16751680
/// zero if the device is not running or unavailable or unknown.
16761681
double refresh_rate;
1682+
1683+
/// The width of the display, in physical pixels.
1684+
size_t width;
1685+
1686+
/// The height of the display, in physical pixels.
1687+
size_t height;
1688+
1689+
/// The pixel ratio of the display, which is used to convert physical pixels
1690+
/// to logical pixels.
1691+
double device_pixel_ratio;
16771692
} FlutterEngineDisplay;
16781693

16791694
/// The update type parameter that is passed to

0 commit comments

Comments
 (0)