Implement GPURenderPassEncoder

Add webidls for GPURenderPassEncoder and  GPURenderEncoderBase and
implement relevant methods.
This commit is contained in:
Kunal Mohan 2020-06-02 21:02:06 +05:30
parent e452570be0
commit 1d4efb48ba
11 changed files with 524 additions and 35 deletions

View file

@ -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> {