Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

embedder: fix bit-order in software pixel format description #57156

Merged
merged 4 commits into from
Dec 17, 2024
Merged
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
26 changes: 25 additions & 1 deletion shell/platform/embedder/embedder.h
Original file line number Diff line number Diff line change
Expand Up @@ -352,33 +352,48 @@ typedef enum {
/// 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 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 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 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 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
Expand Down Expand Up @@ -1741,7 +1756,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 @@ -2011,6 +2027,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
Loading