From 9e6c73e6ba4c220ad44d4aba058455ebd10e85df Mon Sep 17 00:00:00 2001 From: Frank Yellin Date: Tue, 15 Oct 2024 21:27:01 -0700 Subject: [PATCH 1/2] Typo --- wgpu/_classes.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/wgpu/_classes.py b/wgpu/_classes.py index 7d571bdd..9e38ea0c 100644 --- a/wgpu/_classes.py +++ b/wgpu/_classes.py @@ -218,13 +218,6 @@ def __init__(self, canvas): self._ot.increase(self.__class__.__name__) self._canvas_ref = weakref.ref(canvas) - # The configuration from the canvas, obtained with canvas.get_present_info() - self._present_info = canvas.get_present_info() - if self._present_info.get("method", None) not in ("screen", "image"): - raise RuntimeError( - "canvas.get_present_info() must produce a dict with a field 'method' that is either 'screen' or 'image'." - ) - # Surface capabilities. Stored the first time it is obtained self._capabilities = None @@ -234,6 +227,14 @@ def __init__(self, canvas): # The last used texture self._texture = None + # The configuration from the canvas, obtained with canvas.get_present_info() + # The configuration from the canvas, obtained with canvas.get_present_info() + self._present_info = canvas.get_present_info() + if self._present_info.get("method", None) not in ("screen", "image"): + raise RuntimeError( + "canvas.get_present_info() must produce a dict with a field 'method' that is either 'screen' or 'image'." + ) + def _get_canvas(self): """Getter method for internal use.""" return self._canvas_ref() From cbb607a38d32ca59416ebf31b242c4b01cdded88 Mon Sep 17 00:00:00 2001 From: fyellin Date: Wed, 16 Oct 2024 09:00:28 -0700 Subject: [PATCH 2/2] Update wgpu/_classes.py Accidentally duplicated line Co-authored-by: Almar Klein --- wgpu/_classes.py | 1 - 1 file changed, 1 deletion(-) diff --git a/wgpu/_classes.py b/wgpu/_classes.py index 9e38ea0c..6a6c4429 100644 --- a/wgpu/_classes.py +++ b/wgpu/_classes.py @@ -227,7 +227,6 @@ def __init__(self, canvas): # The last used texture self._texture = None - # The configuration from the canvas, obtained with canvas.get_present_info() # The configuration from the canvas, obtained with canvas.get_present_info() self._present_info = canvas.get_present_info() if self._present_info.get("method", None) not in ("screen", "image"):