react-native-webgpu 0.6.2 → 0.6.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/android/cpp/AndroidPlatformContext.h +3 -0
- package/apple/ApplePlatformContext.mm +23 -24
- package/cpp/rnwgpu/PlatformContext.h +7 -0
- package/cpp/rnwgpu/api/GPUQueue.cpp +29 -15
- package/cpp/rnwgpu/api/ImageBitmap.h +32 -0
- package/cpp/rnwgpu/api/RNWebGPU.h +42 -4
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/react-native-webgpu.podspec +2 -1
- package/src/index.tsx +1 -0
|
@@ -179,6 +179,9 @@ public:
|
|
|
179
179
|
result.height = static_cast<int>(bitmapInfo.height);
|
|
180
180
|
result.data.resize(bitmapInfo.height * bitmapInfo.stride);
|
|
181
181
|
memcpy(result.data.data(), bitmapPixels, result.data.size());
|
|
182
|
+
// BitmapFactory hands back premultiplied ARGB_8888 pixels; createImageBitmap
|
|
183
|
+
// converts to the representation requested by premultiplyAlpha.
|
|
184
|
+
result.premultiplied = true;
|
|
182
185
|
|
|
183
186
|
AndroidBitmap_unlockPixels(env, bitmap);
|
|
184
187
|
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
#import <AVFoundation/AVFoundation.h>
|
|
6
6
|
#import <CoreVideo/CoreVideo.h>
|
|
7
|
+
#import <ImageIO/ImageIO.h>
|
|
7
8
|
#import <React/RCTBlobManager.h>
|
|
8
9
|
#import <React/RCTBridge+Private.h>
|
|
9
10
|
#import <ReactCommon/RCTTurboModule.h>
|
|
@@ -88,36 +89,32 @@ void ApplePlatformContext::createImageBitmapAsync(
|
|
|
88
89
|
|
|
89
90
|
ImageData
|
|
90
91
|
ApplePlatformContext::createImageBitmapFromData(std::span<const uint8_t> data) {
|
|
91
|
-
//
|
|
92
|
-
//
|
|
93
|
-
//
|
|
94
|
-
//
|
|
95
|
-
//
|
|
96
|
-
//
|
|
92
|
+
// All formats are decoded through ImageIO. Apple's imaging stack always
|
|
93
|
+
// premultiplies alpha at decode, so the result is flagged premultiplied and
|
|
94
|
+
// createImageBitmap / copyExternalImageToTexture convert from there. This
|
|
95
|
+
// means premultiplyAlpha "none" is a lossy round trip for low-alpha pixels
|
|
96
|
+
// (as it is on Android); the snapshot suites compare with pixelmatch
|
|
97
|
+
// tolerance to absorb it.
|
|
97
98
|
NSData *nsData =
|
|
98
99
|
[NSData dataWithBytesNoCopy:const_cast<uint8_t *>(data.data())
|
|
99
100
|
length:data.size()
|
|
100
101
|
freeWhenDone:NO];
|
|
101
102
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
103
|
+
CGImageSourceRef imageSource =
|
|
104
|
+
CGImageSourceCreateWithData((__bridge CFDataRef)nsData, NULL);
|
|
105
|
+
if (imageSource == NULL) {
|
|
106
|
+
throw std::runtime_error("Couldn't create image source");
|
|
107
|
+
}
|
|
108
|
+
NSDictionary *decodeOptions = @{(id)kCGImageSourceShouldCache : @NO};
|
|
109
|
+
CGImageRef cgImage = CGImageSourceCreateImageAtIndex(
|
|
110
|
+
imageSource, 0, (__bridge CFDictionaryRef)decodeOptions);
|
|
111
|
+
CFRelease(imageSource);
|
|
112
|
+
if (cgImage == NULL) {
|
|
108
113
|
throw std::runtime_error("Couldn't decode image");
|
|
109
114
|
}
|
|
110
115
|
|
|
111
|
-
#if !TARGET_OS_OSX
|
|
112
|
-
CGImageRef cgImage = image.CGImage;
|
|
113
|
-
#else
|
|
114
|
-
CGImageRef cgImage = [image CGImageForProposedRect:NULL
|
|
115
|
-
context:NULL
|
|
116
|
-
hints:NULL];
|
|
117
|
-
#endif
|
|
118
116
|
size_t width = CGImageGetWidth(cgImage);
|
|
119
117
|
size_t height = CGImageGetHeight(cgImage);
|
|
120
|
-
size_t bitsPerComponent = 8;
|
|
121
118
|
size_t bytesPerRow = width * 4;
|
|
122
119
|
|
|
123
120
|
ImageData result;
|
|
@@ -126,16 +123,18 @@ ApplePlatformContext::createImageBitmapFromData(std::span<const uint8_t> data) {
|
|
|
126
123
|
result.data.resize(height * bytesPerRow);
|
|
127
124
|
result.format = wgpu::TextureFormat::RGBA8Unorm;
|
|
128
125
|
|
|
126
|
+
// The draw premultiplies alpha; flag the result premultiplied so
|
|
127
|
+
// createImageBitmap and copyExternalImageToTexture convert consistently.
|
|
129
128
|
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
|
|
130
129
|
CGContextRef context = CGBitmapContextCreate(
|
|
131
|
-
result.data.data(), width, height,
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
result.data.data(), width, height, 8, bytesPerRow, colorSpace,
|
|
131
|
+
kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);
|
|
134
132
|
CGContextDrawImage(context, CGRectMake(0, 0, width, height), cgImage);
|
|
135
|
-
|
|
136
133
|
CGContextRelease(context);
|
|
137
134
|
CGColorSpaceRelease(colorSpace);
|
|
135
|
+
CGImageRelease(cgImage);
|
|
138
136
|
|
|
137
|
+
result.premultiplied = true;
|
|
139
138
|
return result;
|
|
140
139
|
}
|
|
141
140
|
|
|
@@ -16,6 +16,13 @@ struct ImageData {
|
|
|
16
16
|
size_t width;
|
|
17
17
|
size_t height;
|
|
18
18
|
wgpu::TextureFormat format;
|
|
19
|
+
// Whether the RGB channels are premultiplied by alpha. Each platform decoder
|
|
20
|
+
// records the representation it produced; createImageBitmap then converts to
|
|
21
|
+
// the representation requested through premultiplyAlpha, and
|
|
22
|
+
// copyExternalImageToTexture converts again to match the destination's
|
|
23
|
+
// premultipliedAlpha. Defaults to true because most native decoders
|
|
24
|
+
// (CoreGraphics, Android Bitmap) hand back premultiplied pixels.
|
|
25
|
+
bool premultiplied = true;
|
|
19
26
|
};
|
|
20
27
|
|
|
21
28
|
// Pixel layout of a VideoFrame. Determines whether the underlying surface is
|
|
@@ -128,26 +128,40 @@ void GPUQueue::copyExternalImageToTexture(
|
|
|
128
128
|
throw std::runtime_error("Invalid input for GPUQueue::writeTexture()");
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
const bool flipY = source->flipY.value_or(false);
|
|
132
|
+
// premultipliedAlpha defaults to false per the WebGPU spec: an untagged
|
|
133
|
+
// destination expects straight alpha. Convert only when the ImageBitmap's
|
|
134
|
+
// representation differs, using the same rounding as the reference client.
|
|
135
|
+
const bool sourcePremultiplied = source->source->getPremultiplied();
|
|
136
|
+
const bool destinationPremultiplied =
|
|
137
|
+
destination->premultipliedAlpha.value_or(false);
|
|
138
|
+
const bool needsAlphaConversion =
|
|
139
|
+
bytesPerPixel == 4 && sourcePremultiplied != destinationPremultiplied;
|
|
140
|
+
|
|
141
|
+
if (flipY || needsAlphaConversion) {
|
|
133
142
|
uint32_t rowSize = bytesPerPixel * source->source->getWidth();
|
|
134
143
|
uint32_t totalSize = source->source->getSize();
|
|
135
144
|
|
|
136
|
-
//
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
// Stage a mutable copy so flipping and/or alpha conversion never touch the
|
|
146
|
+
// ImageBitmap's backing store.
|
|
147
|
+
std::vector<uint8_t> staged(totalSize);
|
|
148
|
+
const uint8_t *src =
|
|
149
|
+
static_cast<const uint8_t *>(source->source->getData());
|
|
150
|
+
if (flipY) {
|
|
151
|
+
for (uint32_t row = 0; row < source->source->getHeight(); ++row) {
|
|
152
|
+
std::memcpy(staged.data() +
|
|
153
|
+
(source->source->getHeight() - 1 - row) * rowSize,
|
|
154
|
+
src + row * rowSize, rowSize);
|
|
155
|
+
}
|
|
156
|
+
} else {
|
|
157
|
+
std::memcpy(staged.data(), src, totalSize);
|
|
158
|
+
}
|
|
159
|
+
if (needsAlphaConversion) {
|
|
160
|
+
convertAlpha(staged.data(), totalSize, sourcePremultiplied,
|
|
161
|
+
destinationPremultiplied);
|
|
146
162
|
}
|
|
147
|
-
|
|
148
|
-
_instance.WriteTexture(&dst, flippedData.data(), totalSize, &layout, &sz);
|
|
163
|
+
_instance.WriteTexture(&dst, staged.data(), totalSize, &layout, &sz);
|
|
149
164
|
} else {
|
|
150
|
-
|
|
151
165
|
_instance.WriteTexture(&dst, source->source->getData(),
|
|
152
166
|
source->source->getSize(), &layout, &sz);
|
|
153
167
|
}
|
|
@@ -11,6 +11,33 @@ namespace rnwgpu {
|
|
|
11
11
|
|
|
12
12
|
namespace jsi = facebook::jsi;
|
|
13
13
|
|
|
14
|
+
// Convert RGBA8 pixel data in place between straight and premultiplied alpha.
|
|
15
|
+
// Uses the same integer rounding as the web reference polyfill in the test
|
|
16
|
+
// harness (setup.ts, convertAlpha) so the native result is bit-exact with the
|
|
17
|
+
// dawn.node client. A no-op when the source and destination representations
|
|
18
|
+
// already match.
|
|
19
|
+
inline void convertAlpha(uint8_t *data, size_t byteLength,
|
|
20
|
+
bool sourcePremultiplied,
|
|
21
|
+
bool destinationPremultiplied) {
|
|
22
|
+
if (sourcePremultiplied == destinationPremultiplied) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
for (size_t i = 0; i + 3 < byteLength; i += 4) {
|
|
26
|
+
const uint32_t alpha = data[i + 3];
|
|
27
|
+
for (size_t channel = 0; channel < 3; channel++) {
|
|
28
|
+
const uint32_t value = data[i + channel];
|
|
29
|
+
if (destinationPremultiplied) {
|
|
30
|
+
data[i + channel] = static_cast<uint8_t>((value * alpha + 127) / 255);
|
|
31
|
+
} else if (alpha == 0) {
|
|
32
|
+
data[i + channel] = 0;
|
|
33
|
+
} else {
|
|
34
|
+
const uint32_t straight = (value * 255 + (alpha >> 1)) / alpha;
|
|
35
|
+
data[i + channel] = static_cast<uint8_t>(straight > 255 ? 255 : straight);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
14
41
|
class ImageBitmap : public NativeObject<ImageBitmap> {
|
|
15
42
|
public:
|
|
16
43
|
static constexpr const char *CLASS_NAME = "ImageBitmap";
|
|
@@ -26,6 +53,11 @@ public:
|
|
|
26
53
|
|
|
27
54
|
size_t getSize() { return _imageData.data.size(); }
|
|
28
55
|
|
|
56
|
+
// Whether the stored pixels are premultiplied by alpha. Used by
|
|
57
|
+
// copyExternalImageToTexture to decide whether a conversion to the
|
|
58
|
+
// destination's premultipliedAlpha representation is needed.
|
|
59
|
+
bool getPremultiplied() { return _imageData.premultiplied; }
|
|
60
|
+
|
|
29
61
|
void close() {
|
|
30
62
|
_imageData.data.clear();
|
|
31
63
|
_imageData.data.shrink_to_fit();
|
|
@@ -90,6 +90,41 @@ public:
|
|
|
90
90
|
auto platformContext = _platformContext;
|
|
91
91
|
auto callInvoker = _callInvoker;
|
|
92
92
|
|
|
93
|
+
// Resolve the requested alpha representation from the ImageBitmapOptions.
|
|
94
|
+
// The options bag is the second argument for createImageBitmap(source,
|
|
95
|
+
// options) and the sixth for the crop-rect overload createImageBitmap(
|
|
96
|
+
// source, sx, sy, sw, sh, options). premultiplyAlpha defaults to
|
|
97
|
+
// "default", which (like "premultiply") stores premultiplied pixels; only
|
|
98
|
+
// "none" keeps straight alpha. The other options (crop rect, resize,
|
|
99
|
+
// imageOrientation, colorSpaceConversion) are not yet implemented natively.
|
|
100
|
+
bool wantPremultiplied = true;
|
|
101
|
+
const jsi::Value *optionsArg = nullptr;
|
|
102
|
+
if (count >= 2 && args[1].isObject()) {
|
|
103
|
+
optionsArg = &args[1];
|
|
104
|
+
} else if (count >= 6 && args[5].isObject()) {
|
|
105
|
+
optionsArg = &args[5];
|
|
106
|
+
}
|
|
107
|
+
if (optionsArg != nullptr) {
|
|
108
|
+
auto options = optionsArg->getObject(runtime);
|
|
109
|
+
if (options.hasProperty(runtime, "premultiplyAlpha")) {
|
|
110
|
+
auto value = options.getProperty(runtime, "premultiplyAlpha");
|
|
111
|
+
if (value.isString() &&
|
|
112
|
+
value.getString(runtime).utf8(runtime) == "none") {
|
|
113
|
+
wantPremultiplied = false;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Bring the decoded pixels into the representation requested via
|
|
119
|
+
// premultiplyAlpha before wrapping them in an ImageBitmap.
|
|
120
|
+
auto toRequestedAlpha = [wantPremultiplied](ImageData &imageData) {
|
|
121
|
+
if (imageData.premultiplied != wantPremultiplied) {
|
|
122
|
+
convertAlpha(imageData.data.data(), imageData.data.size(),
|
|
123
|
+
imageData.premultiplied, wantPremultiplied);
|
|
124
|
+
imageData.premultiplied = wantPremultiplied;
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
|
|
93
128
|
// Check if the argument is an ArrayBuffer or ArrayBufferView
|
|
94
129
|
// (TypedArray / DataView). Only a real buffer source is run through the
|
|
95
130
|
// ArrayBuffer converter, which validates byteOffset/byteLength against the
|
|
@@ -119,12 +154,14 @@ public:
|
|
|
119
154
|
|
|
120
155
|
return Promise::createPromise(
|
|
121
156
|
runtime,
|
|
122
|
-
[platformContext, callInvoker,
|
|
157
|
+
[platformContext, callInvoker, toRequestedAlpha,
|
|
158
|
+
dataCopy = std::move(dataCopy)](
|
|
123
159
|
jsi::Runtime & /*runtime*/,
|
|
124
160
|
std::shared_ptr<Promise> promise) mutable {
|
|
125
161
|
platformContext->createImageBitmapFromDataAsync(
|
|
126
162
|
dataCopy,
|
|
127
|
-
[callInvoker, promise](ImageData imageData) {
|
|
163
|
+
[callInvoker, promise, toRequestedAlpha](ImageData imageData) {
|
|
164
|
+
toRequestedAlpha(imageData);
|
|
128
165
|
auto imageBitmap = std::make_shared<ImageBitmap>(imageData);
|
|
129
166
|
callInvoker->invokeAsync([promise, imageBitmap]() {
|
|
130
167
|
promise->resolve(
|
|
@@ -149,11 +186,12 @@ public:
|
|
|
149
186
|
|
|
150
187
|
return Promise::createPromise(
|
|
151
188
|
runtime,
|
|
152
|
-
[platformContext, callInvoker, blobId, offset,
|
|
189
|
+
[platformContext, callInvoker, toRequestedAlpha, blobId, offset,
|
|
153
190
|
size](jsi::Runtime & /*runtime*/, std::shared_ptr<Promise> promise) {
|
|
154
191
|
platformContext->createImageBitmapAsync(
|
|
155
192
|
blobId, offset, size,
|
|
156
|
-
[callInvoker, promise](ImageData imageData) {
|
|
193
|
+
[callInvoker, promise, toRequestedAlpha](ImageData imageData) {
|
|
194
|
+
toRequestedAlpha(imageData);
|
|
157
195
|
auto imageBitmap = std::make_shared<ImageBitmap>(imageData);
|
|
158
196
|
callInvoker->invokeAsync([promise, imageBitmap]() {
|
|
159
197
|
promise->resolve(
|
|
@@ -37,6 +37,6 @@ declare global {
|
|
|
37
37
|
destroy(): void;
|
|
38
38
|
readonly yuvToRgbMatrix: number[];
|
|
39
39
|
}
|
|
40
|
-
function createImageBitmap(image: ArrayBuffer | ArrayBufferView): Promise<ImageBitmap>;
|
|
40
|
+
function createImageBitmap(image: ArrayBuffer | ArrayBufferView, options?: ImageBitmapOptions): Promise<ImageBitmap>;
|
|
41
41
|
}
|
|
42
42
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EACd,wBAAwB,EACxB,wBAAwB,EACxB,sBAAsB,EACtB,gCAAgC,EAChC,YAAY,EACZ,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAEjB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,YAAY,EACV,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,wBAAwB,EACxB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,gCAAgC,EAChC,oCAAoC,EACpC,sBAAsB,EACtB,wBA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,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,eAAe,GAAG,WAAW,KAAK,MAAM,CAAC;QACvE,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;QAC5C,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,gBAAgB,CAAC;QACnD,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,gBAAgB,CAAC;QAI1E,gCAAgC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,gBAAgB,CAAC;QACxE,iBAAiB,EAAE,CACjB,IAAI,EAAE,MAAM,EACZ,WAAW,CAAC,EAAE,sBAAsB,KACjC,WAAW,CAAC;QACjB,kBAAkB,EAAE,MAAM,MAAM,CAAC;KAClC,CAAC;IAEF,UAAU,SAAS;QACjB,yBAAyB,CACvB,UAAU,EAAE,gCAAgC,GAC3C,sBAAsB,CAAC;QAC1B,iBAAiB,CAAC,UAAU,EAAE,wBAAwB,GAAG,cAAc,CAAC;KACzE;IAID,UAAU,mBAAmB;QAC3B,WAAW,CAAC,EAAE,wBAAwB,CAAC;KACxC;IAMD,UAAU,4BAA4B;QACpC,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,CAAC;QAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB;IASD,UAAU,kBAAkB;QAC1B,OAAO,IAAI,IAAI,CAAC;QAShB,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,CAAC;KACnC;IAGD,SAAS,iBAAiB,CACxB,KAAK,EAAE,WAAW,GAAG,eAAe,EACpC,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,WAAW,CAAC,CAAC;CACzB"}
|
package/package.json
CHANGED
|
@@ -23,7 +23,8 @@ Pod::Spec.new do |s|
|
|
|
23
23
|
|
|
24
24
|
# The VideoPlayer API uses AVFoundation / CoreMedia, and shared-texture
|
|
25
25
|
# surfaces use CoreVideo (CVPixelBuffer). Link them so their symbols resolve.
|
|
26
|
-
|
|
26
|
+
# ImageIO provides CGImageSource, the image decoder behind createImageBitmap.
|
|
27
|
+
s.frameworks = "AVFoundation", "CoreMedia", "CoreVideo", "ImageIO"
|
|
27
28
|
|
|
28
29
|
s.pod_target_xcconfig = {
|
|
29
30
|
'HEADER_SEARCH_PATHS' => '$(PODS_TARGET_SRCROOT)/cpp',
|
package/src/index.tsx
CHANGED