Skip to content

Commit 9961f99

Browse files
authored
[engine] Sync Flutter 3.27.1 source code (#77)
1 parent b6d5690 commit 9961f99

File tree

4 files changed

+84
-15
lines changed

4 files changed

+84
-15
lines changed

DEPS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ deps = {
77
'src/third_party/libcxx': 'https://llvm.googlesource.com/llvm-project/libcxx@44079a4cc04cdeffb9cfe8067bfb3c276fb2bab0',
88
'src/third_party/libcxxabi': 'https://llvm.googlesource.com/llvm-project/libcxxabi@2ce528fb5e0f92e57c97ec3ff53b75359d33af12',
99
'src/third_party/googletest': 'https://github.com/google/googletest@7f036c5563af7d0329f20e8bb42effb04629f0c0',
10-
'src/third_party/dart': 'https://dart.googlesource.com/sdk.git@b9479eb440de7af2c9946931a1ecaabf457b31af',
10+
'src/third_party/dart': 'https://dart.googlesource.com/sdk.git@ae7ca5199a0559db0ae60533e9cedd3ce0d6ab04',
1111
'src/third_party/clang': {
1212
'packages': [
1313
{
1414
'package': 'fuchsia/third_party/clang/linux-amd64',
15-
'version': 'git_revision:20d06c833d833ef6b2d0f519cc4a7998d49a2803'
15+
'version': 'git_revision:725656bdd885483c39f482a01ea25d67acf39c46'
1616
}
1717
],
1818
'dep_type': 'cipd',

flutter/shell/platform/common/public/flutter_messenger.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ FLUTTER_EXPORT void FlutterDesktopMessengerSetCallback(
9595
// Operation is thread-safe.
9696
//
9797
// See also: |FlutterDesktopMessengerRelease|
98-
FLUTTER_EXPORT FlutterDesktopMessengerRef
99-
FlutterDesktopMessengerAddRef(FlutterDesktopMessengerRef messenger);
98+
FLUTTER_EXPORT FlutterDesktopMessengerRef FlutterDesktopMessengerAddRef(
99+
FlutterDesktopMessengerRef messenger);
100100

101101
// Decrements the reference count for the |messenger|.
102102
//
@@ -126,8 +126,8 @@ FLUTTER_EXPORT bool FlutterDesktopMessengerIsAvailable(
126126
// Returns the |messenger| value.
127127
//
128128
// See also: |FlutterDesktopMessengerUnlock|
129-
FLUTTER_EXPORT FlutterDesktopMessengerRef
130-
FlutterDesktopMessengerLock(FlutterDesktopMessengerRef messenger);
129+
FLUTTER_EXPORT FlutterDesktopMessengerRef FlutterDesktopMessengerLock(
130+
FlutterDesktopMessengerRef messenger);
131131

132132
// Unlocks the `FlutterDesktopMessengerRef`.
133133
//

flutter/shell/platform/embedder/embedder.h

Lines changed: 74 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,9 @@ typedef enum {
305305
/// Specifies an OpenGL frame-buffer target type. Framebuffers are specified
306306
/// using the FlutterOpenGLFramebuffer struct.
307307
kFlutterOpenGLTargetTypeFramebuffer,
308+
/// Specifies an OpenGL on-screen surface target type. Surfaces are specified
309+
/// using the FlutterOpenGLSurface struct.
310+
kFlutterOpenGLTargetTypeSurface,
308311
} FlutterOpenGLTargetType;
309312

310313
/// A pixel format to be used for software rendering.
@@ -401,9 +404,14 @@ typedef struct {
401404
} FlutterOpenGLTexture;
402405

403406
typedef struct {
404-
/// The target of the color attachment of the frame-buffer. For example,
405-
/// GL_TEXTURE_2D or GL_RENDERBUFFER. In case of ambiguity when dealing with
406-
/// Window bound frame-buffers, 0 may be used.
407+
/// The format of the color attachment of the frame-buffer. For example,
408+
/// GL_RGBA8.
409+
///
410+
/// In case of ambiguity when dealing with Window bound frame-buffers, 0 may
411+
/// be used.
412+
///
413+
/// @bug This field is incorrectly named as "target" when it actually
414+
/// refers to a format.
407415
uint32_t target;
408416

409417
/// The name of the framebuffer.
@@ -417,6 +425,62 @@ typedef struct {
417425
VoidCallback destruction_callback;
418426
} FlutterOpenGLFramebuffer;
419427

428+
typedef bool (*FlutterOpenGLSurfaceCallback)(void* /* user data */,
429+
bool* /* opengl state changed */);
430+
431+
typedef struct {
432+
/// The size of this struct. Must be sizeof(FlutterOpenGLSurface).
433+
size_t struct_size;
434+
435+
/// User data to be passed to the make_current, clear_current and
436+
/// destruction callbacks.
437+
void* user_data;
438+
439+
/// Callback invoked (on an engine-managed thread) that asks the embedder to
440+
/// make the surface current.
441+
///
442+
/// Should return true if the operation succeeded, false if the surface could
443+
/// not be made current and rendering should be cancelled.
444+
///
445+
/// The second parameter 'opengl state changed' should be set to true if
446+
/// any OpenGL API state is different than before this callback was called.
447+
/// In that case, Flutter will invalidate the internal OpenGL API state cache,
448+
/// which is a somewhat expensive operation.
449+
///
450+
/// @attention required. (non-null)
451+
FlutterOpenGLSurfaceCallback make_current_callback;
452+
453+
/// Callback invoked (on an engine-managed thread) when the current surface
454+
/// can be cleared.
455+
///
456+
/// Should return true if the operation succeeded, false if an error ocurred.
457+
/// That error will be logged but otherwise not handled by the engine.
458+
///
459+
/// The second parameter 'opengl state changed' is the same as with the
460+
/// @ref make_current_callback.
461+
///
462+
/// The embedder might clear the surface here after it was previously made
463+
/// current. That's not required however, it's also possible to clear it in
464+
/// the destruction callback. There's no way to signal OpenGL state
465+
/// changes in the destruction callback though.
466+
///
467+
/// @attention required. (non-null)
468+
FlutterOpenGLSurfaceCallback clear_current_callback;
469+
470+
/// Callback invoked (on an engine-managed thread) that asks the embedder to
471+
/// collect the surface.
472+
///
473+
/// @attention required. (non-null)
474+
VoidCallback destruction_callback;
475+
476+
/// The surface format.
477+
///
478+
/// Allowed values:
479+
/// - GL_RGBA8
480+
/// - GL_BGRA8_EXT
481+
uint32_t format;
482+
} FlutterOpenGLSurface;
483+
420484
typedef FlutterTransformation (*TransformationCallback)(void* /* user data */);
421485
typedef uint32_t (*UIntCallback)(void* /* user data */);
422486
typedef bool (*SoftwareSurfacePresentCallback)(void* /* user data */,
@@ -1546,7 +1610,7 @@ typedef void (*FlutterUpdateSemanticsCallback2)(
15461610

15471611
/// An update to whether a message channel has a listener set or not.
15481612
typedef struct {
1549-
// The size of the struct. Must be sizeof(FlutterChannelUpdate).
1613+
/// The size of the struct. Must be sizeof(FlutterChannelUpdate).
15501614
size_t struct_size;
15511615
/// The name of the channel.
15521616
const char* channel;
@@ -1627,6 +1691,9 @@ typedef struct {
16271691
/// A framebuffer for Flutter to render into. The embedder must ensure that
16281692
/// the framebuffer is complete.
16291693
FlutterOpenGLFramebuffer framebuffer;
1694+
/// A surface for Flutter to render into. Basically a wrapper around
1695+
/// a closure that'll be called when the surface should be made current.
1696+
FlutterOpenGLSurface surface;
16301697
};
16311698
} FlutterOpenGLBackingStore;
16321699

@@ -1648,6 +1715,7 @@ typedef struct {
16481715
} FlutterSoftwareBackingStore;
16491716

16501717
typedef struct {
1718+
/// The size of this struct. Must be sizeof(FlutterSoftwareBackingStore2).
16511719
size_t struct_size;
16521720
/// A pointer to the raw bytes of the allocation described by this software
16531721
/// backing store.
@@ -1821,6 +1889,7 @@ typedef struct {
18211889
/// Contains additional information about the backing store provided
18221890
/// during presentation to the embedder.
18231891
typedef struct {
1892+
/// The size of this struct. Must be sizeof(FlutterBackingStorePresentInfo).
18241893
size_t struct_size;
18251894

18261895
/// The area of the backing store that contains Flutter contents. Pixels
@@ -1982,7 +2051,7 @@ typedef const FlutterLocale* (*FlutterComputePlatformResolvedLocaleCallback)(
19822051
size_t /* Number of locales*/);
19832052

19842053
typedef struct {
1985-
/// This size of this struct. Must be sizeof(FlutterDisplay).
2054+
/// The size of this struct. Must be sizeof(FlutterEngineDisplay).
19862055
size_t struct_size;
19872056

19882057
FlutterEngineDisplayId display_id;

flutter/shell/platform/tizen/public/flutter_tizen.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ FlutterDesktopEngineGetPluginRegistrar(FlutterDesktopEngineRef engine,
126126
const char* plugin_name);
127127

128128
// Returns the messenger associated with the engine.
129-
FLUTTER_EXPORT FlutterDesktopMessengerRef
130-
FlutterDesktopEngineGetMessenger(FlutterDesktopEngineRef engine);
129+
FLUTTER_EXPORT FlutterDesktopMessengerRef FlutterDesktopEngineGetMessenger(
130+
FlutterDesktopEngineRef engine);
131131

132132
// Posts an app control to the engine instance.
133133
FLUTTER_EXPORT void FlutterDesktopEngineNotifyAppControl(
@@ -205,8 +205,8 @@ FLUTTER_EXPORT void* FlutterDesktopViewGetNativeHandle(
205205
FlutterDesktopViewRef view);
206206

207207
// Returns the resource id of current window.
208-
FLUTTER_EXPORT uint32_t
209-
FlutterDesktopViewGetResourceId(FlutterDesktopViewRef view);
208+
FLUTTER_EXPORT uint32_t FlutterDesktopViewGetResourceId(
209+
FlutterDesktopViewRef view);
210210

211211
// Resizes the view.
212212
// @warning This API is a work-in-progress and may change.

0 commit comments

Comments
 (0)