From 7081e738332c111ca4b6ed4115f15b21e91fdb34 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Thu, 13 Mar 2025 19:35:35 +0900 Subject: [PATCH 1/4] Update dart version --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 20956ab..5846b3d 100644 --- a/DEPS +++ b/DEPS @@ -7,7 +7,7 @@ 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@ae7ca5199a0559db0ae60533e9cedd3ce0d6ab04', + 'src/third_party/dart': 'https://dart.googlesource.com/sdk.git@f6ed8d7df6bfdf6fb08b38dd93c2ee1eba476b5a', 'src/third_party/clang': { 'packages': [ { From 6c29aa18ef4a5813c460da7914a30f1454aabd2b Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Thu, 13 Mar 2025 19:36:03 +0900 Subject: [PATCH 2/4] Update embedder.h --- flutter/shell/platform/embedder/embedder.h | 88 ++++++++++++++----- .../external_texture_pixel_egl_impeller.cc | 2 - .../external_texture_surface_egl_impeller.cc | 2 - 3 files changed, 64 insertions(+), 28 deletions(-) diff --git a/flutter/shell/platform/embedder/embedder.h b/flutter/shell/platform/embedder/embedder.h index 7001925..80b43e1 100644 --- a/flutter/shell/platform/embedder/embedder.h +++ b/flutter/shell/platform/embedder/embedder.h @@ -164,6 +164,9 @@ typedef enum { kFlutterSemanticsActionSetText = 1 << 21, /// Request that the respective focusable widget gain input focus. kFlutterSemanticsActionFocus = 1 << 22, + /// Request that scrolls the current scrollable container to a given scroll + /// offset. + kFlutterSemanticsActionScrollToOffset = 1 << 23, } FlutterSemanticsAction; /// The set of properties that may be associated with a semantics node. @@ -243,6 +246,9 @@ typedef enum { kFlutterSemanticsFlagHasExpandedState = 1 << 26, /// Whether a semantic node that hasExpandedState is currently expanded. kFlutterSemanticsFlagIsExpanded = 1 << 27, + /// The semantics node has the quality of either being "selected" or + /// "not selected". + kFlutterSemanticsFlagHasSelectedState = 1 << 28, } FlutterSemanticsFlag; typedef enum { @@ -322,9 +328,10 @@ typedef enum { /// occupying the lowest memory address. /// /// - all other formats are called packed formats, and the component order -/// as specified in the format name refers to the order in the native type. -/// for example, for kFlutterSoftwarePixelFormatRGB565, the R component -/// uses the 5 least significant bits of the uint16_t pixel value. +/// as specified in the format name refers to the order from most +/// significant to least significant bits in the native type. for example, +/// for kFlutterSoftwarePixelFormatRGB565, R occupies the 5 most significant +/// bits, G the middle 6 bits, and B the 5 least significant bits. /// /// Each pixel format in this list is documented with an example on how to get /// the color components from the pixel. @@ -337,41 +344,64 @@ typedef enum { /// can get the p for a RGBA8888 formatted buffer like this: /// const uint8_t *p = ((const uint8_t*) allocation) + row_bytes*y + x*4; typedef enum { - /// pixel with 8 bit grayscale value. + /// Pixel with 8 bit grayscale value. /// The grayscale value is the luma value calculated from r, g, b /// according to BT.709. (gray = r*0.2126 + g*0.7152 + b*0.0722) kFlutterSoftwarePixelFormatGray8, - /// pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word. - /// r = p & 0x3F; g = (p>>5) & 0x3F; b = p>>11; + /// Pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word. + /// r = (p >> 11) & 0x1F; + /// g = (p >> 5) & 0x3F; + /// b = p & 0x1F; + /// + /// On most (== little-endian) systems, this is equivalent to wayland format + /// RGB565 (WL_DRM_FORMAT_RGB565, WL_SHM_FORMAT_RGB565). kFlutterSoftwarePixelFormatRGB565, - /// pixel with 4 bits for alpha, red, green, blue; in 16-bit word. - /// r = p & 0xF; g = (p>>4) & 0xF; b = (p>>8) & 0xF; a = p>>12; + /// Pixel with 4 bits each for alpha, red, green, blue; in 16-bit word. + /// r = (p >> 8) & 0xF; + /// g = (p >> 4) & 0xF; + /// b = p & 0xF; + /// a = (p >> 12) & 0xF; + /// + /// On most (== little-endian) systems, this is equivalent to wayland format + /// RGBA4444 (WL_DRM_FORMAT_RGBA4444, WL_SHM_FORMAT_RGBA4444). kFlutterSoftwarePixelFormatRGBA4444, - /// pixel with 8 bits for red, green, blue, alpha. - /// r = p[0]; g = p[1]; b = p[2]; a = p[3]; + /// Pixel with 8 bits each for red, green, blue, alpha. + /// r = p[0]; + /// g = p[1]; + /// b = p[2]; + /// a = p[3]; + /// + /// This is equivalent to wayland format ABGR8888 (WL_DRM_FORMAT_ABGR8888, + /// WL_SHM_FORMAT_ABGR8888). kFlutterSoftwarePixelFormatRGBA8888, - /// pixel with 8 bits for red, green and blue and 8 unused bits. - /// r = p[0]; g = p[1]; b = p[2]; + /// Pixel with 8 bits each for red, green and blue and 8 unused bits. + /// r = p[0]; + /// g = p[1]; + /// b = p[2]; + /// + /// This is equivalent to wayland format XBGR8888 (WL_DRM_FORMAT_XBGR8888, + /// WL_SHM_FORMAT_XBGR8888). kFlutterSoftwarePixelFormatRGBX8888, - /// pixel with 8 bits for blue, green, red and alpha. - /// r = p[2]; g = p[1]; b = p[0]; a = p[3]; + /// Pixel with 8 bits each for blue, green, red and alpha. + /// r = p[2]; + /// g = p[1]; + /// b = p[0]; + /// a = p[3]; + /// + /// This is equivalent to wayland format ARGB8888 (WL_DRM_FORMAT_ARGB8888, + /// WL_SHM_FORMAT_ARGB8888). kFlutterSoftwarePixelFormatBGRA8888, - /// either kFlutterSoftwarePixelFormatBGRA8888 or - /// kFlutterSoftwarePixelFormatRGBA8888 depending on CPU endianess and OS + /// Either kFlutterSoftwarePixelFormatBGRA8888 or + /// kFlutterSoftwarePixelFormatRGBA8888 depending on CPU endianess and OS. kFlutterSoftwarePixelFormatNative32, } FlutterSoftwarePixelFormat; -typedef enum { - kFlutterGLImpellerTexturePixelBuffer, - kFlutterGLImpellerTextureGpuSurface, -} FlutterGLImpellerTextureType; - typedef struct { /// Target texture of the active texture unit (example GL_TEXTURE_2D or /// GL_TEXTURE_RECTANGLE). @@ -386,8 +416,7 @@ typedef struct { size_t buffer_size; /// Callback invoked that the gpu surface texture start binding. BoolCallback bind_callback; - /// The type of the texture. - FlutterGLImpellerTextureType impeller_texture_type; + /// User data to be returned on the invocation of the destruction callback. void* user_data; /// Callback invoked (on an engine managed thread) that asks the embedder to @@ -1661,6 +1690,8 @@ typedef struct { /// A unique identifier for the task runner. If multiple task runners service /// tasks on the same thread, their identifiers must match. size_t identifier; + /// The callback invoked when the task runner is destroyed. + VoidCallback destruction_callback; } FlutterTaskRunnerDescription; typedef struct { @@ -1732,7 +1763,8 @@ typedef struct { /// store. VoidCallback destruction_callback; /// The pixel format that the engine should use to render into the allocation. - /// In most cases, kR + /// + /// On Linux, kFlutterSoftwarePixelFormatBGRA8888 is most commonly used. FlutterSoftwarePixelFormat pixel_format; } FlutterSoftwareBackingStore2; @@ -2002,6 +2034,14 @@ typedef struct { /// The callback should return true if the operation was successful. FlutterLayersPresentCallback present_layers_callback; /// Avoid caching backing stores provided by this compositor. + /// + /// The engine has an internal backing store cache. Instead of + /// creating & destroying backing stores for every frame, created + /// backing stores are automatically reused for subsequent frames. + /// + /// If you wish to change this behavior and destroy backing stores after + /// they've been used once, and create new backing stores for every frame, + /// you can set this bool to true. bool avoid_backing_store_cache; /// Callback invoked by the engine to composite the contents of each layer /// onto the specified view. diff --git a/flutter/shell/platform/tizen/external_texture_pixel_egl_impeller.cc b/flutter/shell/platform/tizen/external_texture_pixel_egl_impeller.cc index 7240793..1020e8f 100755 --- a/flutter/shell/platform/tizen/external_texture_pixel_egl_impeller.cc +++ b/flutter/shell/platform/tizen/external_texture_pixel_egl_impeller.cc @@ -31,8 +31,6 @@ bool ExternalTexturePixelEGLImpeller::PopulateTexture( height = pixel_buffer->height; // Populate the texture object used by the engine. - opengl_texture->impeller_texture_type = - FlutterGLImpellerTextureType::kFlutterGLImpellerTexturePixelBuffer; opengl_texture->buffer = pixel_buffer->buffer; opengl_texture->buffer_size = size_t(pixel_buffer->width) * size_t(pixel_buffer->height) * 4; diff --git a/flutter/shell/platform/tizen/external_texture_surface_egl_impeller.cc b/flutter/shell/platform/tizen/external_texture_surface_egl_impeller.cc index 3106ab2..887b752 100755 --- a/flutter/shell/platform/tizen/external_texture_surface_egl_impeller.cc +++ b/flutter/shell/platform/tizen/external_texture_surface_egl_impeller.cc @@ -59,8 +59,6 @@ bool ExternalTextureSurfaceEGLImpeller::PopulateTexture( return false; } - opengl_texture->impeller_texture_type = - FlutterGLImpellerTextureType::kFlutterGLImpellerTextureGpuSurface; opengl_texture->bind_callback = OnBindCallback; opengl_texture->destruction_callback = nullptr; opengl_texture->user_data = this; From 255ccd3beade5b57f04222e1ecfea1064770f666 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Thu, 13 Mar 2025 19:54:38 +0900 Subject: [PATCH 3/4] Sync engine 3.29.0 source code --- flutter/shell/platform/common/BUILD.gn | 2 ++ flutter/shell/platform/common/accessibility_bridge.cc | 11 +++++++++++ flutter/shell/platform/common/accessibility_bridge.h | 5 +++++ .../client_wrapper/include/flutter/event_channel.h | 6 +++--- .../platform/common/flutter_platform_node_delegate.h | 6 ++++++ .../embedder/test_utils/proc_table_replacement.h | 5 +++++ 6 files changed, 32 insertions(+), 3 deletions(-) diff --git a/flutter/shell/platform/common/BUILD.gn b/flutter/shell/platform/common/BUILD.gn index 4a5f948..1e9dd19 100644 --- a/flutter/shell/platform/common/BUILD.gn +++ b/flutter/shell/platform/common/BUILD.gn @@ -57,11 +57,13 @@ source_set("common_cpp_input") { source_set("common_cpp_accessibility") { public = [ "accessibility_bridge.h", + "alert_platform_node_delegate.h", "flutter_platform_node_delegate.h", ] sources = [ "accessibility_bridge.cc", + "alert_platform_node_delegate.cc", "flutter_platform_node_delegate.cc", ] diff --git a/flutter/shell/platform/common/accessibility_bridge.cc b/flutter/shell/platform/common/accessibility_bridge.cc index 9a6e020..1913a58 100644 --- a/flutter/shell/platform/common/accessibility_bridge.cc +++ b/flutter/shell/platform/common/accessibility_bridge.cc @@ -163,6 +163,17 @@ void AccessibilityBridge::OnRoleChanged(ui::AXTree* tree, ax::mojom::Role old_role, ax::mojom::Role new_role) {} +void AccessibilityBridge::OnNodeDataChanged( + ui::AXTree* tree, + const ui::AXNodeData& old_node_data, + const ui::AXNodeData& new_node_data) { + auto platform_view = + GetFlutterPlatformNodeDelegateFromID(new_node_data.id).lock(); + if (platform_view) { + platform_view->NodeDataChanged(old_node_data, new_node_data); + } +} + void AccessibilityBridge::OnNodeCreated(ui::AXTree* tree, ui::AXNode* node) { BASE_DCHECK(node); id_wrapper_map_[node->id()] = CreateFlutterPlatformNodeDelegate(); diff --git a/flutter/shell/platform/common/accessibility_bridge.h b/flutter/shell/platform/common/accessibility_bridge.h index 7e66980..8126c1c 100644 --- a/flutter/shell/platform/common/accessibility_bridge.h +++ b/flutter/shell/platform/common/accessibility_bridge.h @@ -260,6 +260,11 @@ class AccessibilityBridge ax::mojom::Role old_role, ax::mojom::Role new_role) override; + // |AXTreeObserver| + void OnNodeDataChanged(ui::AXTree* tree, + const ui::AXNodeData& old_node_data, + const ui::AXNodeData& new_node_data) override; + // |AXTreeObserver| void OnAtomicUpdateFinished( ui::AXTree* tree, diff --git a/flutter/shell/platform/common/client_wrapper/include/flutter/event_channel.h b/flutter/shell/platform/common/client_wrapper/include/flutter/event_channel.h index 1754596..6887dff 100644 --- a/flutter/shell/platform/common/client_wrapper/include/flutter/event_channel.h +++ b/flutter/shell/platform/common/client_wrapper/include/flutter/event_channel.h @@ -67,9 +67,9 @@ class EventChannel { BinaryMessageHandler binary_handler = [shared_handler, codec, channel_name, messenger, // Mutable state to track the handler's listening status. - is_listening = bool(false)](const uint8_t* message, - const size_t message_size, - const BinaryReply& reply) mutable { + is_listening = false](const uint8_t* message, + const size_t message_size, + const BinaryReply& reply) mutable { constexpr char kOnListenMethod[] = "listen"; constexpr char kOnCancelMethod[] = "cancel"; diff --git a/flutter/shell/platform/common/flutter_platform_node_delegate.h b/flutter/shell/platform/common/flutter_platform_node_delegate.h index 6172f4f..9c90d5a 100644 --- a/flutter/shell/platform/common/flutter_platform_node_delegate.h +++ b/flutter/shell/platform/common/flutter_platform_node_delegate.h @@ -139,6 +139,12 @@ class FlutterPlatformNodeDelegate : public ui::AXPlatformNodeDelegateBase { /// Subclasses must call super. virtual void Init(std::weak_ptr bridge, ui::AXNode* node); + //------------------------------------------------------------------------------ + // @brief Called when node was updated. Subclasses can override this + // to update platform nodes. + virtual void NodeDataChanged(const ui::AXNodeData& old_node_data, + const ui::AXNodeData& new_node_data) {} + //------------------------------------------------------------------------------ /// @brief Gets the underlying ax node for this platform node delegate. ui::AXNode* GetAXNode() const; diff --git a/flutter/shell/platform/embedder/test_utils/proc_table_replacement.h b/flutter/shell/platform/embedder/test_utils/proc_table_replacement.h index 711557a..b05b1bb 100644 --- a/flutter/shell/platform/embedder/test_utils/proc_table_replacement.h +++ b/flutter/shell/platform/embedder/test_utils/proc_table_replacement.h @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#ifndef FLUTTER_SHELL_PLATFORM_EMBEDDER_TEST_UTILS_PROC_TABLE_REPLACEMENT_H_ +#define FLUTTER_SHELL_PLATFORM_EMBEDDER_TEST_UTILS_PROC_TABLE_REPLACEMENT_H_ + #include "flutter/shell/platform/embedder/embedder.h" // Wraps capturing lambas with non-capturing version that can be assigned to @@ -22,3 +25,5 @@ static auto non_capturing = [](auto... args) { return closure(args...); }; \ return non_capturing; \ })() + +#endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_TEST_UTILS_PROC_TABLE_REPLACEMENT_H_ From e5e93aefa527fe3dcadeba50df7fc6ddaeae570f Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Thu, 13 Mar 2025 19:39:54 +0900 Subject: [PATCH 4/4] Remove gles3 code --- .../shell/platform/tizen/external_texture_pixel_egl.cc | 9 +++++---- .../tizen/external_texture_pixel_egl_impeller.cc | 1 - .../shell/platform/tizen/external_texture_surface_egl.cc | 7 +++---- .../tizen/external_texture_surface_egl_impeller.cc | 1 - 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/flutter/shell/platform/tizen/external_texture_pixel_egl.cc b/flutter/shell/platform/tizen/external_texture_pixel_egl.cc index 997c5cb..018755c 100644 --- a/flutter/shell/platform/tizen/external_texture_pixel_egl.cc +++ b/flutter/shell/platform/tizen/external_texture_pixel_egl.cc @@ -6,7 +6,8 @@ #include #include -#include +#include +#include namespace flutter { @@ -21,7 +22,7 @@ bool ExternalTexturePixelEGL::PopulateTexture( // Populate the texture object used by the engine. opengl_texture->target = GL_TEXTURE_2D; opengl_texture->name = state_->gl_texture; - opengl_texture->format = GL_RGBA8; + opengl_texture->format = GL_RGBA8_OES; opengl_texture->destruction_callback = nullptr; opengl_texture->user_data = nullptr; opengl_texture->width = width; @@ -54,8 +55,8 @@ bool ExternalTexturePixelEGL::CopyPixelBuffer(size_t& width, size_t& height) { if (state_->gl_texture == 0) { glGenTextures(1, static_cast(&state_->gl_texture)); glBindTexture(GL_TEXTURE_2D, static_cast(state_->gl_texture)); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER_OES); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER_OES); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); } else { diff --git a/flutter/shell/platform/tizen/external_texture_pixel_egl_impeller.cc b/flutter/shell/platform/tizen/external_texture_pixel_egl_impeller.cc index 1020e8f..7cf7899 100755 --- a/flutter/shell/platform/tizen/external_texture_pixel_egl_impeller.cc +++ b/flutter/shell/platform/tizen/external_texture_pixel_egl_impeller.cc @@ -6,7 +6,6 @@ #include #include -#include #include "flutter/shell/platform/tizen/logger.h" diff --git a/flutter/shell/platform/tizen/external_texture_surface_egl.cc b/flutter/shell/platform/tizen/external_texture_surface_egl.cc index 1b8f1c2..f89d515 100644 --- a/flutter/shell/platform/tizen/external_texture_surface_egl.cc +++ b/flutter/shell/platform/tizen/external_texture_surface_egl.cc @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -141,9 +140,9 @@ bool ExternalTextureSurfaceEGL::PopulateTexture( static_cast(state_->gl_texture)); // set the texture wrapping parameters glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_S, - GL_CLAMP_TO_BORDER); + GL_CLAMP_TO_BORDER_OES); glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_T, - GL_CLAMP_TO_BORDER); + GL_CLAMP_TO_BORDER_OES); // set texture filtering parameters glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, GL_LINEAR); @@ -163,7 +162,7 @@ bool ExternalTextureSurfaceEGL::PopulateTexture( } opengl_texture->target = GL_TEXTURE_EXTERNAL_OES; opengl_texture->name = state_->gl_texture; - opengl_texture->format = GL_RGBA8; + opengl_texture->format = GL_RGBA8_OES; opengl_texture->destruction_callback = nullptr; opengl_texture->user_data = nullptr; opengl_texture->width = width; diff --git a/flutter/shell/platform/tizen/external_texture_surface_egl_impeller.cc b/flutter/shell/platform/tizen/external_texture_surface_egl_impeller.cc index 887b752..e3de9c8 100755 --- a/flutter/shell/platform/tizen/external_texture_surface_egl_impeller.cc +++ b/flutter/shell/platform/tizen/external_texture_surface_egl_impeller.cc @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include