react-native-wgpu 0.1.10 → 0.1.11

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.
@@ -133,6 +133,11 @@ public:
133
133
  return {.width = width, .height = height};
134
134
  }
135
135
 
136
+ wgpu::SurfaceConfiguration getConfig() {
137
+ std::shared_lock<std::shared_mutex> lock(_mutex);
138
+ return config;
139
+ }
140
+
136
141
  wgpu::Device getDevice() {
137
142
  std::shared_lock<std::shared_mutex> lock(_mutex);
138
143
  return config.device;
@@ -28,7 +28,7 @@ void GPUCanvasContext::configure(
28
28
  void GPUCanvasContext::unconfigure() {}
29
29
 
30
30
  std::shared_ptr<GPUTexture> GPUCanvasContext::getCurrentTexture() {
31
- auto prevSize = _surfaceInfo->getSize();
31
+ auto prevSize = _surfaceInfo->getConfig();
32
32
  auto width = _canvas->getWidth();
33
33
  auto height = _canvas->getHeight();
34
34
  auto sizeHasChanged = prevSize.width != width || prevSize.height != height;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-wgpu",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "React Native WebGPU",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",