Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -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': [
{
Expand Down
2 changes: 2 additions & 0 deletions flutter/shell/platform/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]

Expand Down
11 changes: 11 additions & 0 deletions flutter/shell/platform/common/accessibility_bridge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 5 additions & 0 deletions flutter/shell/platform/common/accessibility_bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ class FlutterPlatformNodeDelegate : public ui::AXPlatformNodeDelegateBase {
/// Subclasses must call super.
virtual void Init(std::weak_ptr<OwnerBridge> 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;
Expand Down
88 changes: 64 additions & 24 deletions flutter/shell/platform/embedder/embedder.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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.
Expand All @@ -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).
Expand All @@ -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
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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_
9 changes: 5 additions & 4 deletions flutter/shell/platform/tizen/external_texture_pixel_egl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <GLES3/gl32.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>

namespace flutter {

Expand All @@ -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;
Expand Down Expand Up @@ -54,8 +55,8 @@ bool ExternalTexturePixelEGL::CopyPixelBuffer(size_t& width, size_t& height) {
if (state_->gl_texture == 0) {
glGenTextures(1, static_cast<GLuint*>(&state_->gl_texture));
glBindTexture(GL_TEXTURE_2D, static_cast<GLuint>(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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <GLES3/gl32.h>

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

Expand All @@ -31,8 +30,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;
Expand Down
7 changes: 3 additions & 4 deletions flutter/shell/platform/tizen/external_texture_surface_egl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <EGL/eglext.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <GLES3/gl32.h>
#include <tbm_bufmgr.h>
#include <tbm_surface.h>
#include <tbm_surface_internal.h>
Expand Down Expand Up @@ -141,9 +140,9 @@ bool ExternalTextureSurfaceEGL::PopulateTexture(
static_cast<GLuint>(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);
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <EGL/eglext.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <GLES3/gl32.h>
#include <tbm_bufmgr.h>
#include <tbm_surface.h>
#include <tbm_surface_internal.h>
Expand Down Expand Up @@ -59,8 +58,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;
Expand Down