@geastack/apple 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +54 -0
- package/dist/index.d.ts +127 -0
- package/dist/index.js +3076 -0
- package/generated/AVFoundation.d.ts +112 -0
- package/generated/ActivityKit.d.ts +7 -0
- package/generated/AppKit.d.ts +268 -0
- package/generated/CoreGraphics.d.ts +18 -0
- package/generated/CoreLocation.d.ts +28 -0
- package/generated/CoreMedia.d.ts +8 -0
- package/generated/Dispatch.d.ts +2 -0
- package/generated/Foundation.d.ts +13 -0
- package/generated/MapKit.d.ts +28 -0
- package/generated/Metal.d.ts +91 -0
- package/generated/MetalKit.d.ts +22 -0
- package/generated/Photos.d.ts +5 -0
- package/generated/QuartzCore.d.ts +12 -0
- package/generated/SwiftData.d.ts +11 -0
- package/generated/UIKit.d.ts +187 -0
- package/package.json +123 -0
- package/runtime/AVFoundation.js +136 -0
- package/runtime/ActivityKit.js +18 -0
- package/runtime/AppKit.js +313 -0
- package/runtime/CoreGraphics.js +15 -0
- package/runtime/CoreLocation.js +30 -0
- package/runtime/CoreMedia.js +7 -0
- package/runtime/Dispatch.js +11 -0
- package/runtime/Foundation.js +21 -0
- package/runtime/MapKit.js +22 -0
- package/runtime/Metal.js +126 -0
- package/runtime/MetalKit.js +15 -0
- package/runtime/Photos.js +9 -0
- package/runtime/QuartzCore.js +9 -0
- package/runtime/SwiftData.js +29 -0
- package/runtime/UIKit.js +242 -0
- package/runtime/empty.js +1 -0
- package/targets/ios/Info.plist.in +25 -0
- package/targets/ios/README.md +46 -0
- package/targets/ios/build-ios.sh +395 -0
- package/targets/ios/detect-development-team.mjs +109 -0
- package/targets/ios/generate-resident-entry.mjs +67 -0
- package/targets/ios/generate-resident-registry.mjs +162 -0
- package/targets/ios/generate-xcode-project.mjs +520 -0
- package/targets/ios/main/canvas_view.h +7 -0
- package/targets/ios/main/canvas_view.mm +94 -0
- package/targets/ios/main/font_registry.h +17 -0
- package/targets/ios/main/font_registry.mm +129 -0
- package/targets/ios/main/image_bridge.h +13 -0
- package/targets/ios/main/image_bridge.mm +53 -0
- package/targets/ios/main/ios_apps.c +28 -0
- package/targets/ios/main/ios_camera.mm +446 -0
- package/targets/ios/main/ios_display.mm +344 -0
- package/targets/ios/main/ios_main.mm +811 -0
- package/targets/ios/main/ios_memory.cpp +55 -0
- package/targets/ios/main/ios_renderer.h +20 -0
- package/targets/ios/main/ios_renderer.mm +27 -0
- package/targets/ios/main/ios_root_background.cpp +20 -0
- package/targets/ios/main/ios_root_background.h +11 -0
- package/targets/ios/main/ios_sensors.mm +244 -0
- package/targets/ios/main/ios_timers.mm +53 -0
- package/targets/ios/main/renderer/ios_renderer_internal.h +65 -0
- package/targets/ios/main/renderer/ios_renderer_support.mm +111 -0
- package/targets/ios/main/renderer/native_button.mm +179 -0
- package/targets/ios/main/renderer/native_label.mm +161 -0
- package/targets/ios/main/renderer/native_scroll_container.mm +279 -0
- package/targets/ios/main/renderer/view_reconciler.mm +274 -0
- package/targets/macos/Info.plist.in +26 -0
- package/targets/macos/README.md +131 -0
- package/targets/macos/build-child-lifecycle.sh +119 -0
- package/targets/macos/build-macos.sh +2156 -0
- package/targets/macos/check-module-graph-freshness.mjs +82 -0
- package/targets/macos/compiler-input-fingerprint.mjs +32 -0
- package/targets/macos/finalize-apple-native-output.mjs +77 -0
- package/targets/macos/generate-resident-entry.mjs +80 -0
- package/targets/macos/generate-resident-registry.mjs +141 -0
- package/targets/macos/heavy-build-lock.sh +176 -0
- package/targets/macos/main/canvas_view.h +9 -0
- package/targets/macos/main/canvas_view.mm +176 -0
- package/targets/macos/main/color_convert.h +18 -0
- package/targets/macos/main/color_convert.mm +39 -0
- package/targets/macos/main/font_registry.h +35 -0
- package/targets/macos/main/font_registry.mm +350 -0
- package/targets/macos/main/image_bridge.h +16 -0
- package/targets/macos/main/image_bridge.mm +52 -0
- package/targets/macos/main/macos_app_platform.mm +95 -0
- package/targets/macos/main/macos_apps.c +31 -0
- package/targets/macos/main/macos_device_control.mm +56 -0
- package/targets/macos/main/macos_display.mm +484 -0
- package/targets/macos/main/macos_host_device_control.mm +95 -0
- package/targets/macos/main/macos_main.mm +839 -0
- package/targets/macos/main/macos_memory.cpp +31 -0
- package/targets/macos/main/macos_native_shell.h +31 -0
- package/targets/macos/main/macos_native_shell.mm +396 -0
- package/targets/macos/main/macos_network.mm +253 -0
- package/targets/macos/main/macos_renderer.h +39 -0
- package/targets/macos/main/macos_renderer.mm +1969 -0
- package/targets/macos/main/macos_sensors.cpp +148 -0
- package/targets/macos/main/macos_smoke_app.cpp +65 -0
- package/targets/macos/main/macos_timers.mm +52 -0
- package/targets/macos/main/press_bridge.h +21 -0
- package/targets/macos/main/press_bridge.mm +72 -0
- package/targets/macos/main/thermalright_hid_display.h +14 -0
- package/targets/macos/main/thermalright_hid_display.mm +995 -0
- package/targets/macos/native-artifact-provenance.mjs +421 -0
- package/targets/macos/order-compile-edges.mjs +64 -0
- package/targets/macos/preflight-hard-muted-artifact.mjs +93 -0
- package/targets/macos/prune-generated-modules.mjs +147 -0
- package/targets/macos/sync-resources.mjs +153 -0
- package/targets/shared/analyze-audio-capture.mjs +131 -0
- package/targets/shared/apple_audio.mm +1194 -0
- package/targets/shared/apple_audio_selftest.mm +602 -0
- package/targets/shared/apple_audio_testing.h +34 -0
- package/targets/shared/build-audio-selftest.sh +50 -0
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
#import <UIKit/UIKit.h>
|
|
2
|
+
|
|
3
|
+
#include "canvas.h"
|
|
4
|
+
#include "display.h"
|
|
5
|
+
#include "host/display_orientation.h"
|
|
6
|
+
#include "pixel.h"
|
|
7
|
+
|
|
8
|
+
#include <algorithm>
|
|
9
|
+
#include <cstdint>
|
|
10
|
+
#include <cstdlib>
|
|
11
|
+
#include <cstring>
|
|
12
|
+
#include <vector>
|
|
13
|
+
|
|
14
|
+
namespace {
|
|
15
|
+
|
|
16
|
+
// iOS renders into a full-colour RGBA8888 framebuffer (not RGB565). The build
|
|
17
|
+
// sets GEA_EMBEDDED_PIXEL_FORMAT=GEA_PIXEL_RGBA8888, so pixel::native_t is a
|
|
18
|
+
// 32-bit pixel and the Canvas operates on it natively (no 565 quantization);
|
|
19
|
+
// these pixels go straight into a CGImage. g_framebuffer is std::uint32_t* —
|
|
20
|
+
// identical to native_t under that build flag — so bindPixels binds it directly.
|
|
21
|
+
gea::framework::graphics::Canvas g_canvas;
|
|
22
|
+
std::uint32_t *g_framebuffer = nullptr;
|
|
23
|
+
std::uint32_t *g_presented_framebuffer = nullptr;
|
|
24
|
+
std::uint8_t g_alpha = 255;
|
|
25
|
+
int g_brightness = 100;
|
|
26
|
+
int g_canvas_width = gea::platform::display::kWidth;
|
|
27
|
+
int g_canvas_height = gea::platform::display::kHeight;
|
|
28
|
+
int g_flush_rows = 32;
|
|
29
|
+
int g_flush_depth = 2;
|
|
30
|
+
int g_flush_calls = 0;
|
|
31
|
+
int g_flush_rects = 0;
|
|
32
|
+
int g_flush_pixels = 0;
|
|
33
|
+
|
|
34
|
+
void ensure_canvas()
|
|
35
|
+
{
|
|
36
|
+
if (g_framebuffer && g_canvas.width() == g_canvas_width && g_canvas.height() == g_canvas_height) return;
|
|
37
|
+
std::free(g_framebuffer);
|
|
38
|
+
std::free(g_presented_framebuffer);
|
|
39
|
+
g_framebuffer = static_cast<std::uint32_t *>(std::calloc(static_cast<std::size_t>(g_canvas_width) * g_canvas_height,
|
|
40
|
+
sizeof(std::uint32_t)));
|
|
41
|
+
g_presented_framebuffer = static_cast<std::uint32_t *>(std::calloc(static_cast<std::size_t>(g_canvas_width) * g_canvas_height,
|
|
42
|
+
sizeof(std::uint32_t)));
|
|
43
|
+
if (!g_framebuffer || !g_presented_framebuffer) {
|
|
44
|
+
std::free(g_framebuffer);
|
|
45
|
+
std::free(g_presented_framebuffer);
|
|
46
|
+
g_framebuffer = nullptr;
|
|
47
|
+
g_presented_framebuffer = nullptr;
|
|
48
|
+
g_canvas.bindPixels(nullptr, 0, 0);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
g_canvas.bindPixels(g_framebuffer, g_canvas_width, g_canvas_height);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
void count_rect(int x0, int y0, int x1, int y1)
|
|
55
|
+
{
|
|
56
|
+
if (x0 < 0) x0 = 0;
|
|
57
|
+
if (y0 < 0) y0 = 0;
|
|
58
|
+
if (x1 >= g_canvas_width) x1 = g_canvas_width - 1;
|
|
59
|
+
if (y1 >= g_canvas_height) y1 = g_canvas_height - 1;
|
|
60
|
+
if (x0 > x1 || y0 > y1) return;
|
|
61
|
+
g_flush_rects++;
|
|
62
|
+
g_flush_pixels += (x1 - x0 + 1) * (y1 - y0 + 1);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
void copy_rect_to_presented(int x0, int y0, int x1, int y1)
|
|
66
|
+
{
|
|
67
|
+
if (!g_framebuffer || !g_presented_framebuffer || g_canvas_width <= 0 || g_canvas_height <= 0) return;
|
|
68
|
+
if (x0 < 0) x0 = 0;
|
|
69
|
+
if (y0 < 0) y0 = 0;
|
|
70
|
+
if (x1 >= g_canvas_width) x1 = g_canvas_width - 1;
|
|
71
|
+
if (y1 >= g_canvas_height) y1 = g_canvas_height - 1;
|
|
72
|
+
if (x0 > x1 || y0 > y1) return;
|
|
73
|
+
|
|
74
|
+
const int width = x1 - x0 + 1;
|
|
75
|
+
for (int y = y0; y <= y1; y++) {
|
|
76
|
+
const std::size_t offset = static_cast<std::size_t>(y) * g_canvas_width + x0;
|
|
77
|
+
std::copy_n(g_framebuffer + offset, width, g_presented_framebuffer + offset);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
} // namespace
|
|
82
|
+
|
|
83
|
+
namespace gea::platform::display {
|
|
84
|
+
|
|
85
|
+
bool Display::init()
|
|
86
|
+
{
|
|
87
|
+
ensure_canvas();
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
bool Display::start() { return true; }
|
|
92
|
+
|
|
93
|
+
gea::framework::graphics::Canvas *Display::canvas()
|
|
94
|
+
{
|
|
95
|
+
ensure_canvas();
|
|
96
|
+
return &g_canvas;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
void Display::clear() { canvas()->clear(0); }
|
|
100
|
+
void Display::clearNoFlush() { canvas()->clear(0); }
|
|
101
|
+
void Display::print(const char *) {}
|
|
102
|
+
|
|
103
|
+
// No double-buffered framebuffer on the iOS host shim — the canvas is the
|
|
104
|
+
// presented surface — so rebinding is a no-op (the embedded backends use this
|
|
105
|
+
// to re-point the canvas at a freshly-allocated framebuffer).
|
|
106
|
+
void Display::rebindCanvasToFramebuffer() {}
|
|
107
|
+
|
|
108
|
+
void Display::flush()
|
|
109
|
+
{
|
|
110
|
+
ensure_canvas();
|
|
111
|
+
g_flush_calls++;
|
|
112
|
+
int x0 = 0;
|
|
113
|
+
int y0 = 0;
|
|
114
|
+
int x1 = -1;
|
|
115
|
+
int y1 = -1;
|
|
116
|
+
if (g_canvas.dirty(&x0, &y0, &x1, &y1)) {
|
|
117
|
+
count_rect(x0, y0, x1, y1);
|
|
118
|
+
copy_rect_to_presented(x0, y0, x1, y1);
|
|
119
|
+
}
|
|
120
|
+
g_canvas.resetDirty();
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
void Display::flushRects(const DisplayFlushRect *rects, int count, bool)
|
|
124
|
+
{
|
|
125
|
+
ensure_canvas();
|
|
126
|
+
if (!rects || count <= 0) return;
|
|
127
|
+
g_flush_calls++;
|
|
128
|
+
for (int i = 0; i < count; i++) {
|
|
129
|
+
count_rect(rects[i].x0, rects[i].y0, rects[i].x1, rects[i].y1);
|
|
130
|
+
copy_rect_to_presented(rects[i].x0, rects[i].y0, rects[i].x1, rects[i].y1);
|
|
131
|
+
}
|
|
132
|
+
g_canvas.resetDirty();
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
bool Display::streamRect(int x, int y, int w, int h, DisplayStreamRasterFn raster, void *user)
|
|
136
|
+
{
|
|
137
|
+
ensure_canvas();
|
|
138
|
+
if (!raster || w <= 0 || h <= 0) return false;
|
|
139
|
+
int x0 = std::max(0, x);
|
|
140
|
+
int y0 = std::max(0, y);
|
|
141
|
+
int x1 = std::min(g_canvas_width - 1, x + w - 1);
|
|
142
|
+
int y1 = std::min(g_canvas_height - 1, y + h - 1);
|
|
143
|
+
if (x0 > x1 || y0 > y1) return true;
|
|
144
|
+
|
|
145
|
+
const int rw = x1 - x0 + 1;
|
|
146
|
+
const int rh = y1 - y0 + 1;
|
|
147
|
+
// `DisplayStreamRasterFn` (display.h) is declared to fill `pixel::native_t`,
|
|
148
|
+
// which on this target is the 32-bit RGBA8888 this file's own header states
|
|
149
|
+
// -- so the raster already produces the framebuffer's format and there is
|
|
150
|
+
// nothing to convert. The RGB565 scratch buffer and per-pixel
|
|
151
|
+
// `rgba8888FromRgb565` this replaced were the un-migrated 16-bit path: they
|
|
152
|
+
// declared the callback's output as half its actual width, which is why the
|
|
153
|
+
// call did not compile at all.
|
|
154
|
+
using native_t = gea::framework::graphics::pixel::native_t;
|
|
155
|
+
std::vector<native_t> pixels(static_cast<std::size_t>(rw) * static_cast<std::size_t>(rh));
|
|
156
|
+
raster(pixels.data(), rw, rh, x0, y0, user);
|
|
157
|
+
for (int row = 0; row < rh; row++) {
|
|
158
|
+
std::copy_n(&pixels[static_cast<std::size_t>(row) * static_cast<std::size_t>(rw)], rw,
|
|
159
|
+
&g_framebuffer[static_cast<std::size_t>((y0 + row) * g_canvas_width + x0)]);
|
|
160
|
+
}
|
|
161
|
+
g_canvas.markDirty(x0, y0, x1, y1);
|
|
162
|
+
flush();
|
|
163
|
+
return true;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
bool Display::present(const DisplayPresentCommand *commands, int command_count)
|
|
167
|
+
{
|
|
168
|
+
ensure_canvas();
|
|
169
|
+
if (!commands || command_count <= 0) return false;
|
|
170
|
+
for (int i = 0; i < command_count; i++) {
|
|
171
|
+
const auto &command = commands[i];
|
|
172
|
+
switch (command.type) {
|
|
173
|
+
case DisplayPresentCommandType::Clear:
|
|
174
|
+
g_canvas.clear(command.clear.color);
|
|
175
|
+
break;
|
|
176
|
+
case DisplayPresentCommandType::FillRectRgb565:
|
|
177
|
+
g_canvas.setGlobalAlpha(command.fillRectRgb565.alpha);
|
|
178
|
+
g_canvas.fillRect(command.fillRectRgb565.x, command.fillRectRgb565.y,
|
|
179
|
+
command.fillRectRgb565.w, command.fillRectRgb565.h,
|
|
180
|
+
command.fillRectRgb565.color);
|
|
181
|
+
break;
|
|
182
|
+
case DisplayPresentCommandType::StrokeRectRgb565:
|
|
183
|
+
g_canvas.setGlobalAlpha(command.strokeRectRgb565.alpha);
|
|
184
|
+
g_canvas.strokeRect(command.strokeRectRgb565.x, command.strokeRectRgb565.y,
|
|
185
|
+
command.strokeRectRgb565.w, command.strokeRectRgb565.h,
|
|
186
|
+
command.strokeRectRgb565.color);
|
|
187
|
+
break;
|
|
188
|
+
case DisplayPresentCommandType::FillTriangleRgb565:
|
|
189
|
+
g_canvas.setGlobalAlpha(command.fillTriangleRgb565.alpha);
|
|
190
|
+
g_canvas.fillTriangle(command.fillTriangleRgb565.x0, command.fillTriangleRgb565.y0,
|
|
191
|
+
command.fillTriangleRgb565.x1, command.fillTriangleRgb565.y1,
|
|
192
|
+
command.fillTriangleRgb565.x2, command.fillTriangleRgb565.y2,
|
|
193
|
+
command.fillTriangleRgb565.color);
|
|
194
|
+
break;
|
|
195
|
+
case DisplayPresentCommandType::FillCircleRgb565:
|
|
196
|
+
g_canvas.setGlobalAlpha(command.fillCircleRgb565.alpha);
|
|
197
|
+
g_canvas.fillCircle(command.fillCircleRgb565.x, command.fillCircleRgb565.y,
|
|
198
|
+
command.fillCircleRgb565.radius,
|
|
199
|
+
command.fillCircleRgb565.color);
|
|
200
|
+
break;
|
|
201
|
+
case DisplayPresentCommandType::StrokeCircleRgb565:
|
|
202
|
+
g_canvas.setGlobalAlpha(command.strokeCircleRgb565.alpha);
|
|
203
|
+
g_canvas.strokeCircle(command.strokeCircleRgb565.x, command.strokeCircleRgb565.y,
|
|
204
|
+
command.strokeCircleRgb565.radius,
|
|
205
|
+
command.strokeCircleRgb565.color);
|
|
206
|
+
break;
|
|
207
|
+
case DisplayPresentCommandType::FillCirclesRgb565:
|
|
208
|
+
g_canvas.setGlobalAlpha(command.fillCirclesRgb565.alpha);
|
|
209
|
+
g_canvas.fillCirclesRgb565(command.fillCirclesRgb565.xs,
|
|
210
|
+
command.fillCirclesRgb565.ys,
|
|
211
|
+
command.fillCirclesRgb565.count,
|
|
212
|
+
command.fillCirclesRgb565.radius,
|
|
213
|
+
command.fillCirclesRgb565.colors);
|
|
214
|
+
break;
|
|
215
|
+
case DisplayPresentCommandType::DrawImage:
|
|
216
|
+
g_canvas.setGlobalAlpha(command.drawImage.alpha);
|
|
217
|
+
g_canvas.drawImage(command.drawImage.pixels, command.drawImage.alphaPixels,
|
|
218
|
+
command.drawImage.srcWidth, command.drawImage.srcHeight,
|
|
219
|
+
command.drawImage.x, command.drawImage.y);
|
|
220
|
+
break;
|
|
221
|
+
case DisplayPresentCommandType::DrawImageScaled:
|
|
222
|
+
g_canvas.setGlobalAlpha(command.drawImageScaled.alpha);
|
|
223
|
+
g_canvas.drawImage(command.drawImageScaled.pixels, command.drawImageScaled.alphaPixels,
|
|
224
|
+
command.drawImageScaled.srcWidth, command.drawImageScaled.srcHeight,
|
|
225
|
+
command.drawImageScaled.x, command.drawImageScaled.y,
|
|
226
|
+
command.drawImageScaled.w, command.drawImageScaled.h);
|
|
227
|
+
break;
|
|
228
|
+
case DisplayPresentCommandType::DrawImageTiledX:
|
|
229
|
+
g_canvas.setGlobalAlpha(command.drawImageTiledX.alpha);
|
|
230
|
+
g_canvas.drawImageTiledX(command.drawImageTiledX.pixels, command.drawImageTiledX.alphaPixels,
|
|
231
|
+
command.drawImageTiledX.srcWidth, command.drawImageTiledX.srcHeight,
|
|
232
|
+
command.drawImageTiledX.x, command.drawImageTiledX.y,
|
|
233
|
+
command.drawImageTiledX.w);
|
|
234
|
+
break;
|
|
235
|
+
case DisplayPresentCommandType::FillText:
|
|
236
|
+
g_canvas.setGlobalAlpha(command.fillText.alpha);
|
|
237
|
+
g_canvas.drawText(command.fillText.text, command.fillText.x, command.fillText.y,
|
|
238
|
+
command.fillText.color, command.fillText.scale);
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
g_canvas.setGlobalAlpha(255);
|
|
243
|
+
flush();
|
|
244
|
+
return true;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
void Display::setFlushConfig(int chunk_rows, int queue_depth)
|
|
248
|
+
{
|
|
249
|
+
g_flush_rows = chunk_rows;
|
|
250
|
+
g_flush_depth = queue_depth;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
int Display::flushChunkRows() { return g_flush_rows; }
|
|
254
|
+
int Display::flushQueueDepth() { return g_flush_depth; }
|
|
255
|
+
int Display::flushBufferBytes() { return g_canvas_width * g_flush_rows * 2 * g_flush_depth; }
|
|
256
|
+
void Display::pushClip(int x, int y, int w, int h) { canvas()->pushClip(x, y, w, h); }
|
|
257
|
+
void Display::popClip() { canvas()->popClip(); }
|
|
258
|
+
void Display::resetClip() { canvas()->resetClip(); }
|
|
259
|
+
void Display::setAlpha(std::uint8_t alpha) { g_alpha = alpha; canvas()->setGlobalAlpha(alpha); }
|
|
260
|
+
std::uint8_t Display::alpha() { return g_alpha; }
|
|
261
|
+
int Display::brightness() { return g_brightness; }
|
|
262
|
+
void Display::setBrightness(int brightness_percent)
|
|
263
|
+
{
|
|
264
|
+
if (brightness_percent < 0) brightness_percent = 0;
|
|
265
|
+
if (brightness_percent > 100) brightness_percent = 100;
|
|
266
|
+
g_brightness = brightness_percent;
|
|
267
|
+
}
|
|
268
|
+
// Tearing sync (TE/VBlank): not implemented on this target.
|
|
269
|
+
void Display::setVSync(bool) {}
|
|
270
|
+
void Display::invalidate() {}
|
|
271
|
+
bool Display::vsyncEnabled() { return false; }
|
|
272
|
+
void Display::vsyncWaitForFrame() {}
|
|
273
|
+
void Display::clip(int *x0, int *y0, int *x1, int *y1) { canvas()->currentClip(x0, y0, x1, y1); }
|
|
274
|
+
void Display::fillRect(int x, int y, int w, int h, gea::framework::graphics::pixel::native_t color) { canvas()->fillRect(x, y, w, h, color); }
|
|
275
|
+
void Display::scrollRect(int x, int y, int w, int h, int dx, int dy) { canvas()->scrollRect(x, y, w, h, dx, dy); }
|
|
276
|
+
void Display::resetScrollRegion() { canvas()->setScrollRegion(0, 0, 0); }
|
|
277
|
+
void Display::strokeRect(int x, int y, int w, int h, gea::framework::graphics::pixel::native_t color) { canvas()->strokeRect(x, y, w, h, color); }
|
|
278
|
+
void Display::fillCircle(int cx, int cy, int r, gea::framework::graphics::pixel::native_t color) { canvas()->fillCircle(cx, cy, r, color); }
|
|
279
|
+
void Display::strokeCircle(int cx, int cy, int r, gea::framework::graphics::pixel::native_t color) { canvas()->strokeCircle(cx, cy, r, color); }
|
|
280
|
+
void Display::drawLine(int x0, int y0, int x1, int y1, gea::framework::graphics::pixel::native_t color) { canvas()->drawLine(x0, y0, x1, y1, color); }
|
|
281
|
+
void Display::drawArc(int cx, int cy, int r, int start_deg, int end_deg, gea::framework::graphics::pixel::native_t color) { canvas()->drawArc(cx, cy, r, start_deg, end_deg, color); }
|
|
282
|
+
void Display::fillTriangle(int x0, int y0, int x1, int y1, int x2, int y2, gea::framework::graphics::pixel::native_t color) { canvas()->fillTriangle(x0, y0, x1, y1, x2, y2, color); }
|
|
283
|
+
void Display::drawText(const char *text, int x, int y, gea::framework::graphics::pixel::native_t color, float scale) { canvas()->drawText(text, x, y, color, scale); }
|
|
284
|
+
void Display::drawTextFont(const char *text, int x, int y, gea::framework::graphics::pixel::native_t color, int font_id) { canvas()->drawTextFont(text, x, y, color, font_id); }
|
|
285
|
+
void Display::drawTextFontFamily(const char *text, int x, int y, gea::framework::graphics::pixel::native_t color, int family_id, int size_px)
|
|
286
|
+
{
|
|
287
|
+
canvas()->drawTextFontFamily(text, x, y, color, family_id, size_px);
|
|
288
|
+
}
|
|
289
|
+
void Display::setPixel(int x, int y, gea::framework::graphics::pixel::native_t color) { canvas()->fillRect(x, y, 1, 1, color); }
|
|
290
|
+
void Display::fillRoundedRect(int x, int y, int w, int h, int tl, int tr, int br, int bl, gea::framework::graphics::pixel::native_t color) { canvas()->fillRoundedRect(x, y, w, h, tl, tr, br, bl, color); }
|
|
291
|
+
void Display::fillRoundedRectBoxesRgb565(const std::int16_t *xs, const std::int16_t *ys, int count,
|
|
292
|
+
int w, int h, int tl, int tr, int br, int bl,
|
|
293
|
+
const gea::framework::graphics::pixel::native_t *colors)
|
|
294
|
+
{
|
|
295
|
+
canvas()->fillRoundedRectBoxesRgb565(xs, ys, count, w, h, tl, tr, br, bl, colors);
|
|
296
|
+
}
|
|
297
|
+
void Display::strokeRoundedRect(int x, int y, int w, int h, int tl, int tr, int br, int bl, int lw, gea::framework::graphics::pixel::native_t color) { canvas()->strokeRoundedRect(x, y, w, h, tl, tr, br, bl, lw, color); }
|
|
298
|
+
void Display::blitImage(const gea::framework::graphics::pixel::native_t *src, const std::uint8_t *alpha, int src_w, int src_h, int dx, int dy) { canvas()->drawImage(src, alpha, src_w, src_h, dx, dy); }
|
|
299
|
+
void Display::blitImageScaled(const gea::framework::graphics::pixel::native_t *src, const std::uint8_t *alpha, int src_w, int src_h, int dx, int dy, int dst_w, int dst_h) { canvas()->drawImage(src, alpha, src_w, src_h, dx, dy, dst_w, dst_h); }
|
|
300
|
+
void Display::setWorldOverlay(const std::uint16_t *, int, int, int, int) {}
|
|
301
|
+
void Display::setWorldScroll(int) {}
|
|
302
|
+
void Display::flushStatsRead(std::int64_t *total_us, int *call_count, int *pixel_count)
|
|
303
|
+
{
|
|
304
|
+
if (total_us) *total_us = 0;
|
|
305
|
+
if (call_count) *call_count = g_flush_calls;
|
|
306
|
+
if (pixel_count) *pixel_count = g_flush_pixels;
|
|
307
|
+
}
|
|
308
|
+
DisplayFlushPerfStats Display::flushPerfStatsRead()
|
|
309
|
+
{
|
|
310
|
+
DisplayFlushPerfStats stats;
|
|
311
|
+
stats.callCount = g_flush_calls;
|
|
312
|
+
stats.pixelCount = g_flush_pixels;
|
|
313
|
+
return stats;
|
|
314
|
+
}
|
|
315
|
+
void Display::flushStatsReset()
|
|
316
|
+
{
|
|
317
|
+
g_flush_calls = 0;
|
|
318
|
+
g_flush_rects = 0;
|
|
319
|
+
g_flush_pixels = 0;
|
|
320
|
+
}
|
|
321
|
+
const char *Display::flushStageName() { return "idle"; }
|
|
322
|
+
int Display::flushStageChunk() { return 0; }
|
|
323
|
+
DisplayFlushStageDetail Display::flushStageDetail() { return {}; }
|
|
324
|
+
|
|
325
|
+
// Orientation is a device-panel concept; the iOS app rotates via UIKit, not by
|
|
326
|
+
// rotating the framebuffer — so the framework rotation hook is a no-op here.
|
|
327
|
+
void applyOrientation(gea::framework::display::DisplayOrientation) {}
|
|
328
|
+
|
|
329
|
+
} // namespace gea::platform::display
|
|
330
|
+
|
|
331
|
+
// Returns the presented RGBA8888 framebuffer (R,G,B,A bytes per pixel).
|
|
332
|
+
extern "C" const std::uint32_t *gea_ios_display_presented_pixels()
|
|
333
|
+
{
|
|
334
|
+
ensure_canvas();
|
|
335
|
+
return g_presented_framebuffer ? g_presented_framebuffer : g_framebuffer;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
extern "C" void gea_ios_display_set_viewport_size(int width, int height)
|
|
339
|
+
{
|
|
340
|
+
if (width <= 0 || height <= 0) return;
|
|
341
|
+
g_canvas_width = width;
|
|
342
|
+
g_canvas_height = height;
|
|
343
|
+
ensure_canvas();
|
|
344
|
+
}
|