summaryrefslogtreecommitdiffstats
path: root/gfx/wr/webrender/src/device/gl.rs
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/wr/webrender/src/device/gl.rs')
-rw-r--r--gfx/wr/webrender/src/device/gl.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/gfx/wr/webrender/src/device/gl.rs b/gfx/wr/webrender/src/device/gl.rs
index 5ad9469185..04a7e13023 100644
--- a/gfx/wr/webrender/src/device/gl.rs
+++ b/gfx/wr/webrender/src/device/gl.rs
@@ -138,9 +138,13 @@ pub enum UploadMethod {
}
/// Plain old data that can be used to initialize a texture.
-pub unsafe trait Texel: Copy {}
-unsafe impl Texel for u8 {}
-unsafe impl Texel for f32 {}
+pub unsafe trait Texel: Copy + Default {
+ fn image_format() -> ImageFormat;
+}
+
+unsafe impl Texel for u8 {
+ fn image_format() -> ImageFormat { ImageFormat::R8 }
+}
/// Returns the size in bytes of a depth target with the given dimensions.
fn depth_target_size_in_bytes(dimensions: &DeviceIntSize) -> usize {