diff options
Diffstat (limited to 'components/script/dom/gputextureview.rs')
-rw-r--r-- | components/script/dom/gputextureview.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/components/script/dom/gputextureview.rs b/components/script/dom/gputextureview.rs index 7a6f60e3bfb..f3bb4209708 100644 --- a/components/script/dom/gputextureview.rs +++ b/components/script/dom/gputextureview.rs @@ -22,11 +22,7 @@ pub struct GPUTextureView { } impl GPUTextureView { - fn new_inherited( - texture_view: WebGPUTextureView, - device: WebGPUDevice, - valid: bool, - ) -> GPUTextureView { + fn new_inherited(texture_view: WebGPUTextureView, device: WebGPUDevice, valid: bool) -> Self { Self { reflector_: Reflector::new(), device, @@ -41,7 +37,7 @@ impl GPUTextureView { texture_view: WebGPUTextureView, device: WebGPUDevice, valid: bool, - ) -> DomRoot<GPUTextureView> { + ) -> DomRoot<Self> { reflect_dom_object( Box::new(GPUTextureView::new_inherited(texture_view, device, valid)), global, @@ -49,6 +45,12 @@ impl GPUTextureView { } } +impl GPUTextureView { + pub fn id(&self) -> WebGPUTextureView { + self.texture_view + } +} + impl GPUTextureViewMethods for GPUTextureView { /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label fn GetLabel(&self) -> Option<DOMString> { |