@deepseek-ai/libreoffice-kit 0.2.0 → 0.2.3-rc.3
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/NOTICE +1 -1
- package/README.md +5 -5
- package/README.zh.md +5 -5
- package/frame-forwarding/CMakeLists.txt +3 -4
- package/frame-forwarding/README.md +21 -17
- package/frame-forwarding/README.zh.md +22 -18
- package/frame-forwarding/include/dsh_frame_forwarding.h +42 -9
- package/frame-forwarding/index.d.ts +58 -54
- package/frame-forwarding/index.mjs +14 -17
- package/frame-forwarding/prebuilds/darwin-arm64/frame-forwarding.node +0 -0
- package/frame-forwarding/prebuilds/darwin-arm64/libdsh_frame_forwarding_sdk.a +0 -0
- package/frame-forwarding/prebuilds/darwin-arm64/manifest.json +23 -21
- package/frame-forwarding/prebuilds/darwin-x64/frame-forwarding.node +0 -0
- package/frame-forwarding/prebuilds/darwin-x64/libdsh_frame_forwarding_sdk.a +0 -0
- package/frame-forwarding/prebuilds/darwin-x64/manifest.json +23 -21
- package/frame-forwarding/prebuilds/win32-arm64/dsh_frame_forwarding_sdk.lib +0 -0
- package/frame-forwarding/prebuilds/win32-arm64/frame-forwarding.node +0 -0
- package/frame-forwarding/prebuilds/win32-arm64/manifest.json +23 -21
- package/frame-forwarding/prebuilds/win32-x64/dsh_frame_forwarding_sdk.lib +0 -0
- package/frame-forwarding/prebuilds/win32-x64/frame-forwarding.node +0 -0
- package/frame-forwarding/prebuilds/win32-x64/manifest.json +23 -21
- package/frame-forwarding/receipt.json +16 -14
- package/frame-forwarding/scripts/build-webgpu.mjs +1 -0
- package/frame-forwarding/scripts/build.mjs +3 -3
- package/frame-forwarding/scripts/metadata.mjs +12 -8
- package/frame-forwarding/scripts/source-identity.mjs +3 -3
- package/frame-forwarding/sdk.json +7 -5
- package/frame-forwarding/{include/dsh_webgpu.h → src/graphite-interop-internal.hxx} +22 -22
- package/frame-forwarding/src/{webgpu.cc → graphite-interop.cc} +34 -24
- package/frame-forwarding/src/node-producer.cc +24 -154
- package/frame-forwarding/src/producer.cc +120 -30
- package/frame-forwarding/src/receiver.cc +422 -212
- package/frame-forwarding/src/relay-transport.inc +38 -10
- package/frame-forwarding/src/transport.cc +328 -155
- package/frame-forwarding/src/transport.h +73 -9
- package/frame-forwarding/verify.d.mts +1 -1
- package/frame-forwarding/verify.mjs +19 -17
- package/lib/cli.js +6 -6
- package/lib/editor.js +15 -10
- package/lib/index.js +6 -6
- package/lib/types/editor.d.ts +17 -4
- package/lib/types/engine.d.ts +1 -1
- package/lib/types/fonts.d.ts +1 -1
- package/lib/worker.js +3 -2
- package/package.json +8 -10
- package/frame-forwarding/include/dsh_frame_forwarding_engine.h +0 -66
- package/frame-forwarding/include/dsh_frame_forwarding_node.h +0 -27
|
@@ -6,16 +6,20 @@ import { fileURLToPath } from 'node:url';
|
|
|
6
6
|
|
|
7
7
|
export const sdkRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
|
8
8
|
export const targets = ['darwin-arm64', 'darwin-x64', 'win32-x64', 'win32-arm64'];
|
|
9
|
+
/**
|
|
10
|
+
* Wire capabilities beyond protocol version 1 that every build of these sources implements and requires of its peer.
|
|
11
|
+
* Version 1 builds without `transferable-tx` bind producers by PID, and builds without `producer-local-handles` send
|
|
12
|
+
* Windows handles duplicated into the receiver; neither interoperates with these sources.
|
|
13
|
+
*/
|
|
14
|
+
export const capabilities = ['transferable-tx', 'producer-local-handles'];
|
|
9
15
|
export const buildSources = [
|
|
10
|
-
'include/dsh_frame_forwarding.h', '
|
|
11
|
-
'src/
|
|
12
|
-
'src/producer.cc', 'src/receiver.cc', 'src/win-delay-load.cc', 'src/win-delay-load.LICENSE', 'src/webgpu.cc',
|
|
16
|
+
'include/dsh_frame_forwarding.h', 'src/graphite-interop-internal.hxx', 'src/node-producer.cc', 'src/producer-internal.h', 'src/transport.h', 'src/transport.cc', 'src/relay-transport.inc',
|
|
17
|
+
'src/producer.cc', 'src/receiver.cc', 'src/win-delay-load.cc', 'src/win-delay-load.LICENSE', 'src/graphite-interop.cc',
|
|
13
18
|
'CMakeLists.txt', 'sdk.json', 'scripts/build.mjs', 'scripts/metadata.mjs', 'scripts/source-identity.mjs', 'scripts/build-webgpu.mjs', 'webgpu-dependencies.json',
|
|
14
19
|
];
|
|
15
20
|
export const webgpuSources = ['CMakeLists.txt', 'sdk.json', 'scripts/metadata.mjs', 'webgpu-dependencies.json',
|
|
16
|
-
'scripts/build-webgpu.mjs', 'include/dsh_frame_forwarding.h', '
|
|
17
|
-
'
|
|
18
|
-
'src/relay-transport.inc', 'src/webgpu.cc'];
|
|
21
|
+
'scripts/build-webgpu.mjs', 'include/dsh_frame_forwarding.h', 'src/graphite-interop-internal.hxx', 'src/producer.cc', 'src/producer-internal.h', 'src/transport.cc', 'src/transport.h',
|
|
22
|
+
'src/relay-transport.inc', 'src/graphite-interop.cc'];
|
|
19
23
|
export const presentationFiles = ['browser/index', 'browser/types', 'browser/painters', 'browser/display',
|
|
20
24
|
'electron/index', 'electron/adapter', 'electron/transfer', 'electron/preload']
|
|
21
25
|
.flatMap(file => [`lib/${file}.js`, `lib/${file}.d.ts`]);
|
|
@@ -34,14 +38,14 @@ export function hashFile(file) {
|
|
|
34
38
|
export function updateSdkMetadata(root = sdkRoot) {
|
|
35
39
|
const kitFile = existsSync(join(root, '../package.json')) ? join(root, '../package.json') : join(root, '../entry/package.json');
|
|
36
40
|
const kit = JSON.parse(readFileSync(kitFile, 'utf8'));
|
|
37
|
-
const sdk = { version: kit.version, protocolVersion: 1, header: 'include/dsh_frame_forwarding.h',
|
|
41
|
+
const sdk = { version: kit.version, protocolVersion: 1, capabilities, header: 'include/dsh_frame_forwarding.h',
|
|
38
42
|
sources: ['src/transport.cc', 'src/producer.cc'], cxxStandard: 17, platforms: targets,
|
|
39
43
|
staticLibraries: Object.fromEntries(targets.map(target => [target,
|
|
40
44
|
`prebuilds/${target}/${target.startsWith('win32-') ? 'dsh_frame_forwarding_sdk.lib' : 'libdsh_frame_forwarding_sdk.a'}`])),
|
|
41
45
|
buildSources };
|
|
42
46
|
writeFileSync(join(root, 'sdk.json'), JSON.stringify(sdk, null, 2) + '\n');
|
|
43
47
|
writeFileSync(join(root, 'receipt.json'), JSON.stringify({ package: '@deepseek-ai/libreoffice-kit',
|
|
44
|
-
version: kit.version, protocolVersion: 1,
|
|
48
|
+
version: kit.version, protocolVersion: 1, capabilities,
|
|
45
49
|
files: Object.fromEntries(['LICENSE', ...webgpuSources].map(file => [file, hashFile(join(root, file))])) }, null, 2) + '\n');
|
|
46
50
|
return sdk;
|
|
47
51
|
}
|
|
@@ -5,11 +5,11 @@ import { execFileSync } from 'node:child_process';
|
|
|
5
5
|
export function frameForwardingSourceIdentity(directory, { expectedCommit, environment = process.env, requireClean = false } = {}) {
|
|
6
6
|
const git = args => execFileSync('git', args, { cwd: directory, encoding: 'utf8' }).trim();
|
|
7
7
|
const sourceCommit = git(['rev-parse', 'HEAD']);
|
|
8
|
-
if (!/^[a-f0-9]{40}$/.test(sourceCommit)) throw new Error('
|
|
8
|
+
if (!/^[a-f0-9]{40}$/.test(sourceCommit)) throw new Error('Frame forwarding requires a complete source commit');
|
|
9
9
|
if ((expectedCommit !== undefined && expectedCommit !== sourceCommit)
|
|
10
10
|
|| (environment.GITHUB_SHA && environment.GITHUB_SHA !== sourceCommit))
|
|
11
|
-
throw new Error('
|
|
11
|
+
throw new Error('Frame-forwarding selected source commit differs from HEAD');
|
|
12
12
|
const sourceDirty = git(['status', '--porcelain', '--untracked-files=normal', '--', '.', '../entry/package.json']) !== '';
|
|
13
|
-
if (requireClean && sourceDirty) throw new Error('
|
|
13
|
+
if (requireClean && sourceDirty) throw new Error('Frame-forwarding release staging requires clean SDK sources and Kit metadata');
|
|
14
14
|
return { sourceCommit, sourceDirty };
|
|
15
15
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.2.
|
|
2
|
+
"version": "0.2.3-rc.3",
|
|
3
3
|
"protocolVersion": 1,
|
|
4
|
+
"capabilities": [
|
|
5
|
+
"transferable-tx",
|
|
6
|
+
"producer-local-handles"
|
|
7
|
+
],
|
|
4
8
|
"header": "include/dsh_frame_forwarding.h",
|
|
5
9
|
"sources": [
|
|
6
10
|
"src/transport.cc",
|
|
@@ -21,9 +25,7 @@
|
|
|
21
25
|
},
|
|
22
26
|
"buildSources": [
|
|
23
27
|
"include/dsh_frame_forwarding.h",
|
|
24
|
-
"
|
|
25
|
-
"include/dsh_frame_forwarding_node.h",
|
|
26
|
-
"include/dsh_webgpu.h",
|
|
28
|
+
"src/graphite-interop-internal.hxx",
|
|
27
29
|
"src/node-producer.cc",
|
|
28
30
|
"src/producer-internal.h",
|
|
29
31
|
"src/transport.h",
|
|
@@ -33,7 +35,7 @@
|
|
|
33
35
|
"src/receiver.cc",
|
|
34
36
|
"src/win-delay-load.cc",
|
|
35
37
|
"src/win-delay-load.LICENSE",
|
|
36
|
-
"src/
|
|
38
|
+
"src/graphite-interop.cc",
|
|
37
39
|
"CMakeLists.txt",
|
|
38
40
|
"sdk.json",
|
|
39
41
|
"scripts/build.mjs",
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
#ifndef
|
|
2
|
-
#define
|
|
1
|
+
#ifndef DSH_GRAPHITE_INTEROP_INTERNAL_HXX
|
|
2
|
+
#define DSH_GRAPHITE_INTEROP_INTERNAL_HXX
|
|
3
|
+
/* Internal Graphite texture adapter; not part of the public frame-forwarding SDK. */
|
|
3
4
|
#include "dsh_frame_forwarding.h"
|
|
4
5
|
#include <webgpu/webgpu.h>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
typedef struct DshWebGPUContext DshWebGPUContext;
|
|
9
|
-
typedef struct DshWebGPUFrame DshWebGPUFrame;
|
|
6
|
+
namespace dsh::graphite::detail {
|
|
7
|
+
struct InteropContext;
|
|
8
|
+
struct InteropFrame;
|
|
10
9
|
/** Borrowed native Dawn objects. Release producer-owned references before destroying
|
|
11
10
|
* the context; the SDK owns these references. No object crosses a process boundary. */
|
|
12
|
-
|
|
11
|
+
struct DawnObjects {
|
|
13
12
|
WGPUInstance instance;
|
|
14
13
|
WGPUAdapter adapter;
|
|
15
14
|
WGPUDevice device;
|
|
16
15
|
WGPUQueue queue;
|
|
17
|
-
}
|
|
16
|
+
};
|
|
18
17
|
/** Create a hardware Metal/D3D12 context independently of a display connection.
|
|
19
18
|
* descriptor may be NULL. Required shared-memory features are added by the SDK.
|
|
20
19
|
* Caller callbacks retain their ordinary WebGPU semantics. Returns NULL on error. */
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
InteropContext* create_context(const WGPUDeviceDescriptor* descriptor,
|
|
21
|
+
DawnObjects* objects, char* error, size_t error_size);
|
|
23
22
|
/** Borrow an exclusive BGRA8 premultiplied display texture. Returns 1 when ready,
|
|
24
23
|
* 0 while credits are pending, -1 on error. Poll client through dsh_frame_forwarding_poll;
|
|
25
24
|
* this adapter never consumes application control messages. Serialize context calls.
|
|
26
25
|
* client must outlive every frame acquired from it. */
|
|
27
|
-
int
|
|
28
|
-
uint32_t width, uint32_t height,
|
|
26
|
+
int acquire(InteropContext* context, dsh_frame_forwarding_client* client,
|
|
27
|
+
uint32_t width, uint32_t height, InteropFrame** frame, char* error, size_t error_size);
|
|
29
28
|
/** Borrow the current texture; NULL after publish/discard. Supports RenderAttachment,
|
|
30
29
|
* TextureBinding, CopySrc and CopyDst. Retained texture/views expire at handoff. */
|
|
31
|
-
WGPUTexture
|
|
30
|
+
WGPUTexture texture(InteropFrame* frame);
|
|
32
31
|
/** Publish submitted GPU writes, consuming texture access even on failure.
|
|
33
|
-
*
|
|
34
|
-
* explicit completion wait. macOS waits for GPU completion. Submit all recordings
|
|
32
|
+
* Both platforms wait for submitted GPU work to complete. Submit all recordings
|
|
35
33
|
* and release renderer wrappers before calling. Dawn queue submission may block
|
|
36
34
|
* while acquiring a texture still used by another device.
|
|
37
35
|
* Returns 1 on success, 0 on failure; release_frame remains required. */
|
|
38
|
-
int
|
|
36
|
+
int publish(InteropFrame* frame, uint64_t frame_id,
|
|
37
|
+
const char* metadata_json, char* error, size_t error_size);
|
|
38
|
+
/** Publish like publish through dsh_frame_forwarding_submit_latest: the frame is
|
|
39
|
+
* sent or queued without waiting for receiver credit. */
|
|
40
|
+
int publish_latest(InteropFrame* frame, uint64_t frame_id,
|
|
39
41
|
const char* metadata_json, char* error, size_t error_size);
|
|
40
42
|
/** Cancel shared access using the same synchronization as publish.
|
|
41
43
|
* Returns 1 on success, 0 on failure. Failed handoff or device loss quarantines the
|
|
42
44
|
* allocation until the client is closed. */
|
|
43
|
-
int
|
|
45
|
+
int discard(InteropFrame* frame, char* error, size_t error_size);
|
|
44
46
|
/** Dispose the lease; an active lease is cancelled. No context/client call may race. */
|
|
45
|
-
void
|
|
47
|
+
void release_frame(InteropFrame* frame);
|
|
46
48
|
/** Release SDK context ownership. Outstanding frames retain the device; consumers'
|
|
47
49
|
* imported images are owned by the existing DSH release protocol. */
|
|
48
|
-
void
|
|
49
|
-
#ifdef __cplusplus
|
|
50
|
+
void destroy_context(InteropContext* context);
|
|
50
51
|
}
|
|
51
52
|
#endif
|
|
52
|
-
#endif
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#include "
|
|
1
|
+
#include "graphite-interop-internal.hxx"
|
|
2
2
|
#include "dawn/native/DawnNative.h"
|
|
3
3
|
#include <algorithm>
|
|
4
4
|
#include <cstdio>
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
#include <wrl/client.h>
|
|
14
14
|
#endif
|
|
15
15
|
|
|
16
|
+
namespace dsh::graphite::detail {
|
|
16
17
|
namespace {
|
|
17
18
|
void errorText(char* output, size_t size, const char* message) {
|
|
18
19
|
if (output && size) std::snprintf(output, size, "%s", message);
|
|
@@ -24,7 +25,6 @@ struct Context {
|
|
|
24
25
|
wgpu::Queue queue;
|
|
25
26
|
bool failed = false;
|
|
26
27
|
};
|
|
27
|
-
#if !defined(_WIN32)
|
|
28
28
|
bool completed(Context& context) {
|
|
29
29
|
struct Result { bool called = false; WGPUQueueWorkDoneStatus status{}; };
|
|
30
30
|
auto result = std::make_shared<Result>();
|
|
@@ -40,7 +40,6 @@ bool completed(Context& context) {
|
|
|
40
40
|
return wgpuInstanceWaitAny(context.instance->Get(), 1, &wait, UINT64_MAX) == WGPUWaitStatus_Success
|
|
41
41
|
&& result->called && result->status == WGPUQueueWorkDoneStatus_Success;
|
|
42
42
|
}
|
|
43
|
-
#endif
|
|
44
43
|
#if defined(_WIN32)
|
|
45
44
|
LUID adapterId(ID3D11Device* device) {
|
|
46
45
|
Microsoft::WRL::ComPtr<IDXGIDevice> dxgi;
|
|
@@ -63,8 +62,8 @@ void compatible(Context& context, dsh_frame_forwarding_client* client) {
|
|
|
63
62
|
#endif
|
|
64
63
|
}
|
|
65
64
|
|
|
66
|
-
struct
|
|
67
|
-
struct
|
|
65
|
+
struct InteropContext { std::shared_ptr<Context> state; };
|
|
66
|
+
struct InteropFrame {
|
|
68
67
|
std::shared_ptr<Context> context;
|
|
69
68
|
dsh_frame_forwarding_client* client = nullptr;
|
|
70
69
|
dsh_frame_forwarding_surface* surface = nullptr;
|
|
@@ -73,8 +72,8 @@ struct DshWebGPUFrame {
|
|
|
73
72
|
bool active = false;
|
|
74
73
|
};
|
|
75
74
|
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
InteropContext* create_context(const WGPUDeviceDescriptor* requested,
|
|
76
|
+
DawnObjects* objects, char* error, size_t size) {
|
|
78
77
|
try {
|
|
79
78
|
if (!objects) throw std::runtime_error("WebGPU object output is required");
|
|
80
79
|
*objects = {};
|
|
@@ -111,6 +110,9 @@ extern "C" DshWebGPUContext* dsh_webgpu_create_context(const WGPUDeviceDescripto
|
|
|
111
110
|
auto adapters = state->instance->EnumerateAdapters(&adapterOptions);
|
|
112
111
|
if (adapters.empty()) throw std::runtime_error("Compatible hardware WebGPU adapter unavailable");
|
|
113
112
|
state->adapter = wgpu::Adapter(adapters.front().Get());
|
|
113
|
+
// Without dual-source blending, Graphite coverage draws can allocate destination copies.
|
|
114
|
+
if (wgpuAdapterHasFeature(state->adapter.Get(), WGPUFeatureName_DualSourceBlending))
|
|
115
|
+
feature(WGPUFeatureName_DualSourceBlending);
|
|
114
116
|
for (auto value : features) if (!wgpuAdapterHasFeature(state->adapter.Get(), value))
|
|
115
117
|
throw std::runtime_error("WebGPU adapter lacks required shared-texture features");
|
|
116
118
|
WGPUDeviceDescriptor descriptor = WGPU_DEVICE_DESCRIPTOR_INIT;
|
|
@@ -126,12 +128,12 @@ extern "C" DshWebGPUContext* dsh_webgpu_create_context(const WGPUDeviceDescripto
|
|
|
126
128
|
if (!state->device) throw std::runtime_error("WebGPU device creation failed");
|
|
127
129
|
state->queue = state->device.GetQueue();
|
|
128
130
|
*objects = {state->instance->Get(), state->adapter.Get(), state->device.Get(), state->queue.Get()};
|
|
129
|
-
return new
|
|
131
|
+
return new InteropContext{std::move(state)};
|
|
130
132
|
} catch (const std::exception& exception) { errorText(error, size, exception.what()); return nullptr; }
|
|
131
133
|
}
|
|
132
134
|
|
|
133
|
-
|
|
134
|
-
uint32_t width, uint32_t height,
|
|
135
|
+
int acquire(InteropContext* context, dsh_frame_forwarding_client* client,
|
|
136
|
+
uint32_t width, uint32_t height, InteropFrame** output, char* error, size_t size) {
|
|
135
137
|
if (output) *output = nullptr;
|
|
136
138
|
dsh_frame_forwarding_surface* acquired = nullptr;
|
|
137
139
|
try {
|
|
@@ -142,7 +144,7 @@ extern "C" int dsh_webgpu_acquire(DshWebGPUContext* context, dsh_frame_forwardin
|
|
|
142
144
|
#endif
|
|
143
145
|
acquired = dsh_frame_forwarding_acquire(client, width, height);
|
|
144
146
|
if (!acquired) return 0;
|
|
145
|
-
auto frame = std::make_unique<
|
|
147
|
+
auto frame = std::make_unique<InteropFrame>();
|
|
146
148
|
frame->context = context->state; frame->client = client; frame->surface = acquired;
|
|
147
149
|
wgpu::SharedTextureMemoryDescriptor descriptor{};
|
|
148
150
|
#if defined(__APPLE__)
|
|
@@ -171,20 +173,16 @@ extern "C" int dsh_webgpu_acquire(DshWebGPUContext* context, dsh_frame_forwardin
|
|
|
171
173
|
}
|
|
172
174
|
}
|
|
173
175
|
|
|
174
|
-
|
|
176
|
+
WGPUTexture texture(InteropFrame* frame) {
|
|
175
177
|
return frame && frame->active ? frame->texture.Get() : nullptr;
|
|
176
178
|
}
|
|
177
179
|
namespace {
|
|
178
|
-
bool finish(
|
|
180
|
+
bool finish(InteropFrame* frame, char* error, size_t size) {
|
|
179
181
|
if (!frame || !frame->active) { errorText(error, size, "WebGPU frame is not acquired"); return false; }
|
|
180
182
|
frame->active = false;
|
|
181
183
|
wgpu::SharedTextureMemoryEndAccessState access{};
|
|
182
184
|
const bool ended = frame->memory.EndAccess(frame->texture, &access) == wgpu::Status::Success;
|
|
183
|
-
#if defined(_WIN32)
|
|
184
|
-
const bool done = true;
|
|
185
|
-
#else
|
|
186
185
|
const bool done = completed(*frame->context);
|
|
187
|
-
#endif
|
|
188
186
|
frame->texture.Destroy(); frame->texture = nullptr; frame->memory = nullptr;
|
|
189
187
|
if (!ended || !done || dawn::native::IsDeviceLost(frame->context->device.Get())) {
|
|
190
188
|
frame->context->failed = true;
|
|
@@ -195,20 +193,32 @@ bool finish(DshWebGPUFrame* frame, char* error, size_t size) {
|
|
|
195
193
|
return true;
|
|
196
194
|
}
|
|
197
195
|
}
|
|
198
|
-
|
|
199
|
-
|
|
196
|
+
namespace {
|
|
197
|
+
int submitFrame(InteropFrame* frame, uint64_t frameId, const char* metadata, char* error, size_t size,
|
|
198
|
+
int (*submit)(dsh_frame_forwarding_client*, dsh_frame_forwarding_surface*, uint64_t, const char*)) {
|
|
200
199
|
if (!finish(frame, error, size)) return 0;
|
|
201
200
|
auto* surface = frame->surface; frame->surface = nullptr;
|
|
202
|
-
if (
|
|
201
|
+
if (submit(frame->client, surface, frameId, metadata)) return 1;
|
|
203
202
|
dsh_frame_forwarding_discard(frame->client, surface);
|
|
204
203
|
errorText(error, size, "Display rejected WebGPU frame"); return 0;
|
|
205
204
|
}
|
|
206
|
-
|
|
205
|
+
}
|
|
206
|
+
int publish(InteropFrame* frame, uint64_t frameId,
|
|
207
|
+
const char* metadata, char* error, size_t size) {
|
|
208
|
+
return submitFrame(frame, frameId, metadata, error, size, dsh_frame_forwarding_submit);
|
|
209
|
+
}
|
|
210
|
+
int publish_latest(InteropFrame* frame, uint64_t frameId,
|
|
211
|
+
const char* metadata, char* error, size_t size) {
|
|
212
|
+
return submitFrame(frame, frameId, metadata, error, size, dsh_frame_forwarding_submit_latest);
|
|
213
|
+
}
|
|
214
|
+
int discard(InteropFrame* frame, char* error, size_t size) {
|
|
207
215
|
if (!finish(frame, error, size)) return 0;
|
|
208
216
|
dsh_frame_forwarding_discard(frame->client, frame->surface); frame->surface = nullptr; return 1;
|
|
209
217
|
}
|
|
210
|
-
|
|
211
|
-
if (frame && frame->active)
|
|
218
|
+
void release_frame(InteropFrame* frame) {
|
|
219
|
+
if (frame && frame->active) discard(frame, nullptr, 0);
|
|
212
220
|
delete frame;
|
|
213
221
|
}
|
|
214
|
-
|
|
222
|
+
void destroy_context(InteropContext* context) { delete context; }
|
|
223
|
+
|
|
224
|
+
} // namespace dsh::graphite::detail
|