Skip to content

Commit 7e48f8d

Browse files
authored
[engine] Sync Flutter 3.29.0 source code (#83)
1 parent 3b5d236 commit 7e48f8d

File tree

12 files changed

+105
-42
lines changed

12 files changed

+105
-42
lines changed

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ 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@ae7ca5199a0559db0ae60533e9cedd3ce0d6ab04',
10+
'src/third_party/dart': 'https://dart.googlesource.com/sdk.git@f6ed8d7df6bfdf6fb08b38dd93c2ee1eba476b5a',
1111
'src/third_party/clang': {
1212
'packages': [
1313
{

flutter/shell/platform/common/BUILD.gn

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,13 @@ source_set("common_cpp_input") {
5757
source_set("common_cpp_accessibility") {
5858
public = [
5959
"accessibility_bridge.h",
60+
"alert_platform_node_delegate.h",
6061
"flutter_platform_node_delegate.h",
6162
]
6263

6364
sources = [
6465
"accessibility_bridge.cc",
66+
"alert_platform_node_delegate.cc",
6567
"flutter_platform_node_delegate.cc",
6668
]
6769

flutter/shell/platform/common/accessibility_bridge.cc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,17 @@ void AccessibilityBridge::OnRoleChanged(ui::AXTree* tree,
163163
ax::mojom::Role old_role,
164164
ax::mojom::Role new_role) {}
165165

166+
void AccessibilityBridge::OnNodeDataChanged(
167+
ui::AXTree* tree,
168+
const ui::AXNodeData& old_node_data,
169+
const ui::AXNodeData& new_node_data) {
170+
auto platform_view =
171+
GetFlutterPlatformNodeDelegateFromID(new_node_data.id).lock();
172+
if (platform_view) {
173+
platform_view->NodeDataChanged(old_node_data, new_node_data);
174+
}
175+
}
176+
166177
void AccessibilityBridge::OnNodeCreated(ui::AXTree* tree, ui::AXNode* node) {
167178
BASE_DCHECK(node);
168179
id_wrapper_map_[node->id()] = CreateFlutterPlatformNodeDelegate();

flutter/shell/platform/common/accessibility_bridge.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,11 @@ class AccessibilityBridge
260260
ax::mojom::Role old_role,
261261
ax::mojom::Role new_role) override;
262262

263+
// |AXTreeObserver|
264+
void OnNodeDataChanged(ui::AXTree* tree,
265+
const ui::AXNodeData& old_node_data,
266+
const ui::AXNodeData& new_node_data) override;
267+
263268
// |AXTreeObserver|
264269
void OnAtomicUpdateFinished(
265270
ui::AXTree* tree,

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ class EventChannel {
6767
BinaryMessageHandler binary_handler =
6868
[shared_handler, codec, channel_name, messenger,
6969
// Mutable state to track the handler's listening status.
70-
is_listening = bool(false)](const uint8_t* message,
71-
const size_t message_size,
72-
const BinaryReply& reply) mutable {
70+
is_listening = false](const uint8_t* message,
71+
const size_t message_size,
72+
const BinaryReply& reply) mutable {
7373
constexpr char kOnListenMethod[] = "listen";
7474
constexpr char kOnCancelMethod[] = "cancel";
7575

flutter/shell/platform/common/flutter_platform_node_delegate.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,12 @@ class FlutterPlatformNodeDelegate : public ui::AXPlatformNodeDelegateBase {
139139
/// Subclasses must call super.
140140
virtual void Init(std::weak_ptr<OwnerBridge> bridge, ui::AXNode* node);
141141

142+
//------------------------------------------------------------------------------
143+
// @brief Called when node was updated. Subclasses can override this
144+
// to update platform nodes.
145+
virtual void NodeDataChanged(const ui::AXNodeData& old_node_data,
146+
const ui::AXNodeData& new_node_data) {}
147+
142148
//------------------------------------------------------------------------------
143149
/// @brief Gets the underlying ax node for this platform node delegate.
144150
ui::AXNode* GetAXNode() const;

flutter/shell/platform/embedder/embedder.h

Lines changed: 64 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ typedef enum {
164164
kFlutterSemanticsActionSetText = 1 << 21,
165165
/// Request that the respective focusable widget gain input focus.
166166
kFlutterSemanticsActionFocus = 1 << 22,
167+
/// Request that scrolls the current scrollable container to a given scroll
168+
/// offset.
169+
kFlutterSemanticsActionScrollToOffset = 1 << 23,
167170
} FlutterSemanticsAction;
168171

169172
/// The set of properties that may be associated with a semantics node.
@@ -243,6 +246,9 @@ typedef enum {
243246
kFlutterSemanticsFlagHasExpandedState = 1 << 26,
244247
/// Whether a semantic node that hasExpandedState is currently expanded.
245248
kFlutterSemanticsFlagIsExpanded = 1 << 27,
249+
/// The semantics node has the quality of either being "selected" or
250+
/// "not selected".
251+
kFlutterSemanticsFlagHasSelectedState = 1 << 28,
246252
} FlutterSemanticsFlag;
247253

248254
typedef enum {
@@ -322,9 +328,10 @@ typedef enum {
322328
/// occupying the lowest memory address.
323329
///
324330
/// - all other formats are called packed formats, and the component order
325-
/// as specified in the format name refers to the order in the native type.
326-
/// for example, for kFlutterSoftwarePixelFormatRGB565, the R component
327-
/// uses the 5 least significant bits of the uint16_t pixel value.
331+
/// as specified in the format name refers to the order from most
332+
/// significant to least significant bits in the native type. for example,
333+
/// for kFlutterSoftwarePixelFormatRGB565, R occupies the 5 most significant
334+
/// bits, G the middle 6 bits, and B the 5 least significant bits.
328335
///
329336
/// Each pixel format in this list is documented with an example on how to get
330337
/// the color components from the pixel.
@@ -337,41 +344,64 @@ typedef enum {
337344
/// can get the p for a RGBA8888 formatted buffer like this:
338345
/// const uint8_t *p = ((const uint8_t*) allocation) + row_bytes*y + x*4;
339346
typedef enum {
340-
/// pixel with 8 bit grayscale value.
347+
/// Pixel with 8 bit grayscale value.
341348
/// The grayscale value is the luma value calculated from r, g, b
342349
/// according to BT.709. (gray = r*0.2126 + g*0.7152 + b*0.0722)
343350
kFlutterSoftwarePixelFormatGray8,
344351

345-
/// pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word.
346-
/// r = p & 0x3F; g = (p>>5) & 0x3F; b = p>>11;
352+
/// Pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word.
353+
/// r = (p >> 11) & 0x1F;
354+
/// g = (p >> 5) & 0x3F;
355+
/// b = p & 0x1F;
356+
///
357+
/// On most (== little-endian) systems, this is equivalent to wayland format
358+
/// RGB565 (WL_DRM_FORMAT_RGB565, WL_SHM_FORMAT_RGB565).
347359
kFlutterSoftwarePixelFormatRGB565,
348360

349-
/// pixel with 4 bits for alpha, red, green, blue; in 16-bit word.
350-
/// r = p & 0xF; g = (p>>4) & 0xF; b = (p>>8) & 0xF; a = p>>12;
361+
/// Pixel with 4 bits each for alpha, red, green, blue; in 16-bit word.
362+
/// r = (p >> 8) & 0xF;
363+
/// g = (p >> 4) & 0xF;
364+
/// b = p & 0xF;
365+
/// a = (p >> 12) & 0xF;
366+
///
367+
/// On most (== little-endian) systems, this is equivalent to wayland format
368+
/// RGBA4444 (WL_DRM_FORMAT_RGBA4444, WL_SHM_FORMAT_RGBA4444).
351369
kFlutterSoftwarePixelFormatRGBA4444,
352370

353-
/// pixel with 8 bits for red, green, blue, alpha.
354-
/// r = p[0]; g = p[1]; b = p[2]; a = p[3];
371+
/// Pixel with 8 bits each for red, green, blue, alpha.
372+
/// r = p[0];
373+
/// g = p[1];
374+
/// b = p[2];
375+
/// a = p[3];
376+
///
377+
/// This is equivalent to wayland format ABGR8888 (WL_DRM_FORMAT_ABGR8888,
378+
/// WL_SHM_FORMAT_ABGR8888).
355379
kFlutterSoftwarePixelFormatRGBA8888,
356380

357-
/// pixel with 8 bits for red, green and blue and 8 unused bits.
358-
/// r = p[0]; g = p[1]; b = p[2];
381+
/// Pixel with 8 bits each for red, green and blue and 8 unused bits.
382+
/// r = p[0];
383+
/// g = p[1];
384+
/// b = p[2];
385+
///
386+
/// This is equivalent to wayland format XBGR8888 (WL_DRM_FORMAT_XBGR8888,
387+
/// WL_SHM_FORMAT_XBGR8888).
359388
kFlutterSoftwarePixelFormatRGBX8888,
360389

361-
/// pixel with 8 bits for blue, green, red and alpha.
362-
/// r = p[2]; g = p[1]; b = p[0]; a = p[3];
390+
/// Pixel with 8 bits each for blue, green, red and alpha.
391+
/// r = p[2];
392+
/// g = p[1];
393+
/// b = p[0];
394+
/// a = p[3];
395+
///
396+
/// This is equivalent to wayland format ARGB8888 (WL_DRM_FORMAT_ARGB8888,
397+
/// WL_SHM_FORMAT_ARGB8888).
363398
kFlutterSoftwarePixelFormatBGRA8888,
364399

365-
/// either kFlutterSoftwarePixelFormatBGRA8888 or
366-
/// kFlutterSoftwarePixelFormatRGBA8888 depending on CPU endianess and OS
400+
/// Either kFlutterSoftwarePixelFormatBGRA8888 or
401+
/// kFlutterSoftwarePixelFormatRGBA8888 depending on CPU endianess and OS.
367402
kFlutterSoftwarePixelFormatNative32,
368403
} FlutterSoftwarePixelFormat;
369404

370-
typedef enum {
371-
kFlutterGLImpellerTexturePixelBuffer,
372-
kFlutterGLImpellerTextureGpuSurface,
373-
} FlutterGLImpellerTextureType;
374-
375405
typedef struct {
376406
/// Target texture of the active texture unit (example GL_TEXTURE_2D or
377407
/// GL_TEXTURE_RECTANGLE).
@@ -386,8 +416,7 @@ typedef struct {
386416
size_t buffer_size;
387417
/// Callback invoked that the gpu surface texture start binding.
388418
BoolCallback bind_callback;
389-
/// The type of the texture.
390-
FlutterGLImpellerTextureType impeller_texture_type;
419+
391420
/// User data to be returned on the invocation of the destruction callback.
392421
void* user_data;
393422
/// Callback invoked (on an engine managed thread) that asks the embedder to
@@ -1661,6 +1690,8 @@ typedef struct {
16611690
/// A unique identifier for the task runner. If multiple task runners service
16621691
/// tasks on the same thread, their identifiers must match.
16631692
size_t identifier;
1693+
/// The callback invoked when the task runner is destroyed.
1694+
VoidCallback destruction_callback;
16641695
} FlutterTaskRunnerDescription;
16651696

16661697
typedef struct {
@@ -1732,7 +1763,8 @@ typedef struct {
17321763
/// store.
17331764
VoidCallback destruction_callback;
17341765
/// The pixel format that the engine should use to render into the allocation.
1735-
/// In most cases, kR
1766+
///
1767+
/// On Linux, kFlutterSoftwarePixelFormatBGRA8888 is most commonly used.
17361768
FlutterSoftwarePixelFormat pixel_format;
17371769
} FlutterSoftwareBackingStore2;
17381770

@@ -2002,6 +2034,14 @@ typedef struct {
20022034
/// The callback should return true if the operation was successful.
20032035
FlutterLayersPresentCallback present_layers_callback;
20042036
/// Avoid caching backing stores provided by this compositor.
2037+
///
2038+
/// The engine has an internal backing store cache. Instead of
2039+
/// creating & destroying backing stores for every frame, created
2040+
/// backing stores are automatically reused for subsequent frames.
2041+
///
2042+
/// If you wish to change this behavior and destroy backing stores after
2043+
/// they've been used once, and create new backing stores for every frame,
2044+
/// you can set this bool to true.
20052045
bool avoid_backing_store_cache;
20062046
/// Callback invoked by the engine to composite the contents of each layer
20072047
/// onto the specified view.

flutter/shell/platform/embedder/test_utils/proc_table_replacement.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
#ifndef FLUTTER_SHELL_PLATFORM_EMBEDDER_TEST_UTILS_PROC_TABLE_REPLACEMENT_H_
6+
#define FLUTTER_SHELL_PLATFORM_EMBEDDER_TEST_UTILS_PROC_TABLE_REPLACEMENT_H_
7+
58
#include "flutter/shell/platform/embedder/embedder.h"
69

710
// Wraps capturing lambas with non-capturing version that can be assigned to
@@ -22,3 +25,5 @@
2225
static auto non_capturing = [](auto... args) { return closure(args...); }; \
2326
return non_capturing; \
2427
})()
28+
29+
#endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_TEST_UTILS_PROC_TABLE_REPLACEMENT_H_

flutter/shell/platform/tizen/external_texture_pixel_egl.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
#include <EGL/egl.h>
88
#include <EGL/eglext.h>
9-
#include <GLES3/gl32.h>
9+
#include <GLES2/gl2.h>
10+
#include <GLES2/gl2ext.h>
1011

1112
namespace flutter {
1213

@@ -21,7 +22,7 @@ bool ExternalTexturePixelEGL::PopulateTexture(
2122
// Populate the texture object used by the engine.
2223
opengl_texture->target = GL_TEXTURE_2D;
2324
opengl_texture->name = state_->gl_texture;
24-
opengl_texture->format = GL_RGBA8;
25+
opengl_texture->format = GL_RGBA8_OES;
2526
opengl_texture->destruction_callback = nullptr;
2627
opengl_texture->user_data = nullptr;
2728
opengl_texture->width = width;
@@ -54,8 +55,8 @@ bool ExternalTexturePixelEGL::CopyPixelBuffer(size_t& width, size_t& height) {
5455
if (state_->gl_texture == 0) {
5556
glGenTextures(1, static_cast<GLuint*>(&state_->gl_texture));
5657
glBindTexture(GL_TEXTURE_2D, static_cast<GLuint>(state_->gl_texture));
57-
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
58-
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
58+
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER_OES);
59+
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER_OES);
5960
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
6061
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
6162
} else {

flutter/shell/platform/tizen/external_texture_pixel_egl_impeller.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
#include <EGL/egl.h>
88
#include <EGL/eglext.h>
9-
#include <GLES3/gl32.h>
109

1110
#include "flutter/shell/platform/tizen/logger.h"
1211

@@ -31,8 +30,6 @@ bool ExternalTexturePixelEGLImpeller::PopulateTexture(
3130
height = pixel_buffer->height;
3231

3332
// Populate the texture object used by the engine.
34-
opengl_texture->impeller_texture_type =
35-
FlutterGLImpellerTextureType::kFlutterGLImpellerTexturePixelBuffer;
3633
opengl_texture->buffer = pixel_buffer->buffer;
3734
opengl_texture->buffer_size =
3835
size_t(pixel_buffer->width) * size_t(pixel_buffer->height) * 4;

0 commit comments

Comments
 (0)