mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Store Option<ImageInfo> instead of making fields optional
This commit is contained in:
parent
48d918dcde
commit
a4fa36f9fb
4 changed files with 47 additions and 69 deletions
|
@ -613,7 +613,7 @@ impl<'a> WebGLValidator for CompressedTexSubImage2DValidator<'a> {
|
|||
compression,
|
||||
} = self.compression_validator.validate()?;
|
||||
|
||||
let tex_info = texture.image_info_for_target(&target, level);
|
||||
let tex_info = texture.image_info_for_target(&target, level).unwrap();
|
||||
|
||||
// GL_INVALID_VALUE is generated if:
|
||||
// - xoffset or yoffset is less than 0
|
||||
|
@ -630,7 +630,7 @@ impl<'a> WebGLValidator for CompressedTexSubImage2DValidator<'a> {
|
|||
|
||||
// GL_INVALID_OPERATION is generated if format does not match
|
||||
// internal_format.
|
||||
if compression.format != tex_info.internal_format().unwrap() {
|
||||
if compression.format != tex_info.internal_format() {
|
||||
context.webgl_error(InvalidOperation);
|
||||
return Err(TexImageValidationError::TextureFormatMismatch);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue