diff options
Diffstat (limited to 'components/script/dom/webgltexture.rs')
-rw-r--r-- | components/script/dom/webgltexture.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/components/script/dom/webgltexture.rs b/components/script/dom/webgltexture.rs index ccd05182968..bd9f34515ba 100644 --- a/components/script/dom/webgltexture.rs +++ b/components/script/dom/webgltexture.rs @@ -109,13 +109,15 @@ impl WebGLTexture { height: u32, depth: u32, internal_format: u32, - level: u32) -> WebGLResult<()> { + level: u32, + data_type: Option<u32>) -> WebGLResult<()> { let image_info = ImageInfo { width: width, height: height, depth: depth, internal_format: Some(internal_format), is_initialized: true, + data_type: data_type, }; let face = match target { @@ -274,6 +276,7 @@ impl WebGLTexture { depth: 0, internal_format: base_image_info.internal_format, is_initialized: base_image_info.is_initialized(), + data_type: base_image_info.data_type, }; self.set_image_infos_at_level(level, image_info); @@ -346,6 +349,7 @@ pub struct ImageInfo { depth: u32, internal_format: Option<u32>, is_initialized: bool, + data_type: Option<u32>, } impl ImageInfo { @@ -356,6 +360,7 @@ impl ImageInfo { depth: 0, internal_format: None, is_initialized: false, + data_type: None, } } @@ -371,6 +376,10 @@ impl ImageInfo { self.internal_format } + pub fn data_type(&self) -> Option<u32> { + self.data_type + } + fn is_power_of_two(&self) -> bool { self.width.is_power_of_two() && self.height.is_power_of_two() && self.depth.is_power_of_two() } |