Transform convert_* functions in gpuconvert.rs to From/TryFrom implementations (#33302)

Signed-off-by: Taym <haddadi.taym@gmail.com>
This commit is contained in:
Taym Haddadi 2024-09-04 18:03:59 +02:00 committed by GitHub
parent c0ced7a524
commit 00389cf007
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 493 additions and 483 deletions

View file

@ -19,7 +19,6 @@ use crate::dom::globalscope::GlobalScope;
use crate::dom::gpubindgroup::GPUBindGroup;
use crate::dom::gpubuffer::GPUBuffer;
use crate::dom::gpucommandencoder::GPUCommandEncoder;
use crate::dom::gpuconvert::convert_color;
use crate::dom::gpurenderbundle::GPURenderBundle;
use crate::dom::gpurenderpipeline::GPURenderPipeline;
@ -132,7 +131,7 @@ impl GPURenderPassEncoderMethods for GPURenderPassEncoder {
/// <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassencoder-setblendcolor>
fn SetBlendConstant(&self, color: GPUColor) -> Fallible<()> {
self.send_render_command(RenderCommand::SetBlendConstant(convert_color(&color)?));
self.send_render_command(RenderCommand::SetBlendConstant((&color).try_into()?));
Ok(())
}