Skip to content

Commit

Permalink
[engine] Sync Flutter 3.27.1 source code (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
JSUYA authored Dec 23, 2024
1 parent b6d5690 commit 9961f99
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 15 deletions.
4 changes: 2 additions & 2 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ deps = {
'src/third_party/libcxx': 'https://llvm.googlesource.com/llvm-project/libcxx@44079a4cc04cdeffb9cfe8067bfb3c276fb2bab0',
'src/third_party/libcxxabi': 'https://llvm.googlesource.com/llvm-project/libcxxabi@2ce528fb5e0f92e57c97ec3ff53b75359d33af12',
'src/third_party/googletest': 'https://github.com/google/googletest@7f036c5563af7d0329f20e8bb42effb04629f0c0',
'src/third_party/dart': 'https://dart.googlesource.com/sdk.git@b9479eb440de7af2c9946931a1ecaabf457b31af',
'src/third_party/dart': 'https://dart.googlesource.com/sdk.git@ae7ca5199a0559db0ae60533e9cedd3ce0d6ab04',
'src/third_party/clang': {
'packages': [
{
'package': 'fuchsia/third_party/clang/linux-amd64',
'version': 'git_revision:20d06c833d833ef6b2d0f519cc4a7998d49a2803'
'version': 'git_revision:725656bdd885483c39f482a01ea25d67acf39c46'
}
],
'dep_type': 'cipd',
Expand Down
8 changes: 4 additions & 4 deletions flutter/shell/platform/common/public/flutter_messenger.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ FLUTTER_EXPORT void FlutterDesktopMessengerSetCallback(
// Operation is thread-safe.
//
// See also: |FlutterDesktopMessengerRelease|
FLUTTER_EXPORT FlutterDesktopMessengerRef
FlutterDesktopMessengerAddRef(FlutterDesktopMessengerRef messenger);
FLUTTER_EXPORT FlutterDesktopMessengerRef FlutterDesktopMessengerAddRef(
FlutterDesktopMessengerRef messenger);

// Decrements the reference count for the |messenger|.
//
Expand Down Expand Up @@ -126,8 +126,8 @@ FLUTTER_EXPORT bool FlutterDesktopMessengerIsAvailable(
// Returns the |messenger| value.
//
// See also: |FlutterDesktopMessengerUnlock|
FLUTTER_EXPORT FlutterDesktopMessengerRef
FlutterDesktopMessengerLock(FlutterDesktopMessengerRef messenger);
FLUTTER_EXPORT FlutterDesktopMessengerRef FlutterDesktopMessengerLock(
FlutterDesktopMessengerRef messenger);

// Unlocks the `FlutterDesktopMessengerRef`.
//
Expand Down
79 changes: 74 additions & 5 deletions flutter/shell/platform/embedder/embedder.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,9 @@ typedef enum {
/// Specifies an OpenGL frame-buffer target type. Framebuffers are specified
/// using the FlutterOpenGLFramebuffer struct.
kFlutterOpenGLTargetTypeFramebuffer,
/// Specifies an OpenGL on-screen surface target type. Surfaces are specified
/// using the FlutterOpenGLSurface struct.
kFlutterOpenGLTargetTypeSurface,
} FlutterOpenGLTargetType;

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

typedef struct {
/// The target of the color attachment of the frame-buffer. For example,
/// GL_TEXTURE_2D or GL_RENDERBUFFER. In case of ambiguity when dealing with
/// Window bound frame-buffers, 0 may be used.
/// The format of the color attachment of the frame-buffer. For example,
/// GL_RGBA8.
///
/// In case of ambiguity when dealing with Window bound frame-buffers, 0 may
/// be used.
///
/// @bug This field is incorrectly named as "target" when it actually
/// refers to a format.
uint32_t target;

/// The name of the framebuffer.
Expand All @@ -417,6 +425,62 @@ typedef struct {
VoidCallback destruction_callback;
} FlutterOpenGLFramebuffer;

typedef bool (*FlutterOpenGLSurfaceCallback)(void* /* user data */,
bool* /* opengl state changed */);

typedef struct {
/// The size of this struct. Must be sizeof(FlutterOpenGLSurface).
size_t struct_size;

/// User data to be passed to the make_current, clear_current and
/// destruction callbacks.
void* user_data;

/// Callback invoked (on an engine-managed thread) that asks the embedder to
/// make the surface current.
///
/// Should return true if the operation succeeded, false if the surface could
/// not be made current and rendering should be cancelled.
///
/// The second parameter 'opengl state changed' should be set to true if
/// any OpenGL API state is different than before this callback was called.
/// In that case, Flutter will invalidate the internal OpenGL API state cache,
/// which is a somewhat expensive operation.
///
/// @attention required. (non-null)
FlutterOpenGLSurfaceCallback make_current_callback;

/// Callback invoked (on an engine-managed thread) when the current surface
/// can be cleared.
///
/// Should return true if the operation succeeded, false if an error ocurred.
/// That error will be logged but otherwise not handled by the engine.
///
/// The second parameter 'opengl state changed' is the same as with the
/// @ref make_current_callback.
///
/// The embedder might clear the surface here after it was previously made
/// current. That's not required however, it's also possible to clear it in
/// the destruction callback. There's no way to signal OpenGL state
/// changes in the destruction callback though.
///
/// @attention required. (non-null)
FlutterOpenGLSurfaceCallback clear_current_callback;

/// Callback invoked (on an engine-managed thread) that asks the embedder to
/// collect the surface.
///
/// @attention required. (non-null)
VoidCallback destruction_callback;

/// The surface format.
///
/// Allowed values:
/// - GL_RGBA8
/// - GL_BGRA8_EXT
uint32_t format;
} FlutterOpenGLSurface;

typedef FlutterTransformation (*TransformationCallback)(void* /* user data */);
typedef uint32_t (*UIntCallback)(void* /* user data */);
typedef bool (*SoftwareSurfacePresentCallback)(void* /* user data */,
Expand Down Expand Up @@ -1546,7 +1610,7 @@ typedef void (*FlutterUpdateSemanticsCallback2)(

/// An update to whether a message channel has a listener set or not.
typedef struct {
// The size of the struct. Must be sizeof(FlutterChannelUpdate).
/// The size of the struct. Must be sizeof(FlutterChannelUpdate).
size_t struct_size;
/// The name of the channel.
const char* channel;
Expand Down Expand Up @@ -1627,6 +1691,9 @@ typedef struct {
/// A framebuffer for Flutter to render into. The embedder must ensure that
/// the framebuffer is complete.
FlutterOpenGLFramebuffer framebuffer;
/// A surface for Flutter to render into. Basically a wrapper around
/// a closure that'll be called when the surface should be made current.
FlutterOpenGLSurface surface;
};
} FlutterOpenGLBackingStore;

Expand All @@ -1648,6 +1715,7 @@ typedef struct {
} FlutterSoftwareBackingStore;

typedef struct {
/// The size of this struct. Must be sizeof(FlutterSoftwareBackingStore2).
size_t struct_size;
/// A pointer to the raw bytes of the allocation described by this software
/// backing store.
Expand Down Expand Up @@ -1821,6 +1889,7 @@ typedef struct {
/// Contains additional information about the backing store provided
/// during presentation to the embedder.
typedef struct {
/// The size of this struct. Must be sizeof(FlutterBackingStorePresentInfo).
size_t struct_size;

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

typedef struct {
/// This size of this struct. Must be sizeof(FlutterDisplay).
/// The size of this struct. Must be sizeof(FlutterEngineDisplay).
size_t struct_size;

FlutterEngineDisplayId display_id;
Expand Down
8 changes: 4 additions & 4 deletions flutter/shell/platform/tizen/public/flutter_tizen.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ FlutterDesktopEngineGetPluginRegistrar(FlutterDesktopEngineRef engine,
const char* plugin_name);

// Returns the messenger associated with the engine.
FLUTTER_EXPORT FlutterDesktopMessengerRef
FlutterDesktopEngineGetMessenger(FlutterDesktopEngineRef engine);
FLUTTER_EXPORT FlutterDesktopMessengerRef FlutterDesktopEngineGetMessenger(
FlutterDesktopEngineRef engine);

// Posts an app control to the engine instance.
FLUTTER_EXPORT void FlutterDesktopEngineNotifyAppControl(
Expand Down Expand Up @@ -205,8 +205,8 @@ FLUTTER_EXPORT void* FlutterDesktopViewGetNativeHandle(
FlutterDesktopViewRef view);

// Returns the resource id of current window.
FLUTTER_EXPORT uint32_t
FlutterDesktopViewGetResourceId(FlutterDesktopViewRef view);
FLUTTER_EXPORT uint32_t FlutterDesktopViewGetResourceId(
FlutterDesktopViewRef view);

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

0 comments on commit 9961f99

Please sign in to comment.