18 double x_min = HUGE_VAL;
19 double x_max = -HUGE_VAL;
20 double y_min = HUGE_VAL;
21 double y_max = -HUGE_VAL;
26 x_min = std::min(x_min, offset.
x);
27 y_min = std::min(y_min, offset.
y);
28 x_max = std::max(x_max, offset.
x +
size.width);
29 y_max = std::max(y_max, offset.
y +
size.height);
36void BlendLayer(std::vector<uint32_t>& allocation,
46 static_cast<const uint32_t*
>(backing_store.software.allocation);
51 int y_src_min = std::max(0., y_min - offset.
y);
52 int y_src_max = std::min(
size.height,
height + y_min - offset.
y);
53 int x_src_min = std::max(0., x_min - offset.
x);
54 int x_src_max = std::min(
size.width,
width + x_min - offset.
x);
55 for (
int y_src = y_src_min; y_src < y_src_max; y_src++) {
56 int y_dst = y_src + offset.
y - y_min;
57 for (
int x_src = x_src_min; x_src < x_src_max; x_src++) {
58 int x_dst = x_src + offset.
x + x_min;
59 size_t i_src = y_src *
size.width + x_src;
60 size_t i_dst = y_dst *
width + x_dst;
61 uint32_t src = src_data[i_src];
62 uint32_t dst = allocation[i_dst];
64 int r_src = (src >> 0) & 0xff;
65 int g_src = (src >> 8) & 0xff;
66 int b_src = (src >> 16) & 0xff;
67 int a_src = (src >> 24) & 0xff;
69 int r_dst = (dst >> 0) & 0xff;
70 int g_dst = (dst >> 8) & 0xff;
71 int b_dst = (dst >> 16) & 0xff;
73 int r = (r_dst * 255 + (r_src - r_dst) * a_src) / 255;
74 int g = (g_dst * 255 + (g_src - g_dst) * a_src) / 255;
75 int b = (b_dst * 255 + (b_src - b_dst) * a_src) / 255;
77 allocation[i_dst] = (r << 0) | (g << 8) | (b << 16) | (0xff << 24);
90 void* allocation = std::calloc(
size,
sizeof(uint8_t));
119 return view->ClearSoftwareBitmap();
130 auto& software = backing_store.software;
131 return view->PresentSoftwareBitmap(software.allocation,
132 software.row_bytes, software.height);
139 int x_min =
static_cast<int>(bounds.
left);
140 int x_max =
static_cast<int>(bounds.
right);
141 int y_min =
static_cast<int>(bounds.
top);
142 int y_max =
static_cast<int>(bounds.
bottom);
144 int width = x_max - x_min;
145 int height = y_max - y_min;
153 BlendLayer(allocation, **layer, x_min, y_min,
width,
height);
160 return view->PresentSoftwareBitmap(
static_cast<void*
>(allocation.data()),
bool CollectBackingStore(const FlutterBackingStore *store) override
|Compositor|
bool Present(FlutterWindowsView *view, const FlutterLayer **layers, size_t layers_count) override
|Compositor|
bool CreateBackingStore(const FlutterBackingStoreConfig &config, FlutterBackingStore *result) override
|Compositor|
@ kFlutterLayerContentTypeBackingStore
@ kFlutterBackingStoreTypeSoftware
Specified an software allocation for Flutter to render into using the CPU.
const FlutterLayer size_t layers_count
const FlutterLayer ** layers
#define FML_UNREACHABLE()
#define FML_DCHECK(condition)
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
constexpr int kOpaqueBlack
FlutterSize size
The size of the render target the engine expects to render into.
FlutterBackingStoreType type
Specifies the type of backing store.
FlutterSoftwareBackingStore software
The description of the software backing store.
FlutterLayerContentType type
const FlutterBackingStore * backing_store
FlutterSize size
The size of the layer (in physical pixels).
A structure to represent a 2D point.
A structure to represent a rectangle.
A structure to represent the width and height.
VoidCallback destruction_callback
size_t row_bytes
The number of bytes in a single row of the allocation.
size_t height
The number of rows in the allocation.