aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/gpusampler.rs
diff options
context:
space:
mode:
authorKunal Mohan <kunalmohan99@gmail.com>2020-07-20 20:10:41 +0530
committerKunal Mohan <kunalmohan99@gmail.com>2020-07-20 23:03:53 +0530
commitcdc0a75fe43a962caaeed5fdb15dbc3a4dc18c56 (patch)
tree8ccf16cae3f8cf3ba00dad408c8abc47807424ba /components/script/dom/gpusampler.rs
parent3216209506f36b3db7dc733c2e391fb11dc6bd67 (diff)
downloadservo-cdc0a75fe43a962caaeed5fdb15dbc3a4dc18c56.tar.gz
servo-cdc0a75fe43a962caaeed5fdb15dbc3a4dc18c56.zip
Update GPUObjectBase webidl and cleanup valid flags
Diffstat (limited to 'components/script/dom/gpusampler.rs')
-rw-r--r--components/script/dom/gpusampler.rs30
1 files changed, 6 insertions, 24 deletions
diff --git a/components/script/dom/gpusampler.rs b/components/script/dom/gpusampler.rs
index 97e6c1dc37f..cba3ec3b018 100644
--- a/components/script/dom/gpusampler.rs
+++ b/components/script/dom/gpusampler.rs
@@ -6,33 +6,25 @@ use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::GPUSamplerBinding::GPUSamplerMethods;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::DomRoot;
-use crate::dom::bindings::str::DOMString;
+use crate::dom::bindings::str::USVString;
use crate::dom::globalscope::GlobalScope;
use dom_struct::dom_struct;
-use std::cell::Cell;
use webgpu::{WebGPUDevice, WebGPUSampler};
#[dom_struct]
pub struct GPUSampler {
reflector_: Reflector,
- label: DomRefCell<Option<DOMString>>,
+ label: DomRefCell<Option<USVString>>,
device: WebGPUDevice,
compare_enable: bool,
sampler: WebGPUSampler,
- valid: Cell<bool>,
}
impl GPUSampler {
- fn new_inherited(
- device: WebGPUDevice,
- compare_enable: bool,
- sampler: WebGPUSampler,
- valid: bool,
- ) -> Self {
+ fn new_inherited(device: WebGPUDevice, compare_enable: bool, sampler: WebGPUSampler) -> Self {
Self {
reflector_: Reflector::new(),
label: DomRefCell::new(None),
- valid: Cell::new(valid),
device,
sampler,
compare_enable,
@@ -44,15 +36,9 @@ impl GPUSampler {
device: WebGPUDevice,
compare_enable: bool,
sampler: WebGPUSampler,
- valid: bool,
) -> DomRoot<Self> {
reflect_dom_object(
- Box::new(GPUSampler::new_inherited(
- device,
- compare_enable,
- sampler,
- valid,
- )),
+ Box::new(GPUSampler::new_inherited(device, compare_enable, sampler)),
global,
)
}
@@ -62,20 +48,16 @@ impl GPUSampler {
pub fn id(&self) -> WebGPUSampler {
self.sampler
}
-
- pub fn is_valid(&self) -> bool {
- self.valid.get()
- }
}
impl GPUSamplerMethods for GPUSampler {
/// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label
- fn GetLabel(&self) -> Option<DOMString> {
+ fn GetLabel(&self) -> Option<USVString> {
self.label.borrow().clone()
}
/// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label
- fn SetLabel(&self, value: Option<DOMString>) {
+ fn SetLabel(&self, value: Option<USVString>) {
*self.label.borrow_mut() = value;
}
}