We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 13c73a3 commit a6f00dbCopy full SHA for a6f00db
1 file changed
webgpu/canvas.py
@@ -78,6 +78,7 @@ class Canvas:
78
79
def __init__(self, device, canvas, multisample_count=4):
80
self._update_mutex = threading.Lock()
81
+ self.target_texture = None
82
83
self._on_resize_callbacks = []
84
self._on_update_html_canvas = []
@@ -181,6 +182,9 @@ def on_update_html_canvas(self, func: Callable):
181
182
183
def save_screenshot(self, filename: str):
184
with self._update_mutex:
185
+ if self.target_texture is None:
186
+ self.resize._original(self)
187
+
188
path = pathlib.Path(filename)
189
format = path.suffix[1:]
190
data = read_texture(self.target_texture)
0 commit comments