Add initial support for WebGL compressed textures

This commit is contained in:
Mátyás Mustoha 2019-03-25 12:50:45 +01:00 committed by Josh Matthews
parent a14b952fa3
commit 7f0b820d4e
16 changed files with 792 additions and 37 deletions

View file

@ -470,7 +470,24 @@ impl ImageInfo {
}
fn is_compressed_format(&self) -> bool {
// TODO: Once Servo supports compressed formats, check for them here
false
match self.internal_format {
Some(format) => format.is_compressed(),
None => false,
}
}
}
#[derive(Clone, Copy, Debug, JSTraceable, MallocSizeOf)]
pub enum TexCompressionValidation {
None,
S3TC,
}
#[derive(Clone, Copy, Debug, JSTraceable, MallocSizeOf)]
pub struct TexCompression {
pub format: TexFormat,
pub bytes_per_block: u8,
pub block_width: u8,
pub block_height: u8,
pub validation: TexCompressionValidation,
}