diff options
author | Bastien Orivel <eijebong@bananium.fr> | 2017-10-09 17:03:40 +0200 |
---|---|---|
committer | Bastien Orivel <eijebong@bananium.fr> | 2017-10-19 15:01:17 +0200 |
commit | e8e2d0a4b24475b018dbc7e59ea46fdceaf20815 (patch) | |
tree | bd56b4a2fc203150ee5c3b5e163937fb3b4e1989 /components/script/dom/webglrenderingcontext.rs | |
parent | 4cf2ce66fc4f970a47ab1fb4b9aa1a55282640f7 (diff) | |
download | servo-e8e2d0a4b24475b018dbc7e59ea46fdceaf20815.tar.gz servo-e8e2d0a4b24475b018dbc7e59ea46fdceaf20815.zip |
Update bitflags to 1.0 in every servo crate
It still needs dependencies update to remove all the other bitflags
versions.
Diffstat (limited to 'components/script/dom/webglrenderingcontext.rs')
-rw-r--r-- | components/script/dom/webglrenderingcontext.rs | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs index 514fac1e492..b58481d9526 100644 --- a/components/script/dom/webglrenderingcontext.rs +++ b/components/script/dom/webglrenderingcontext.rs @@ -136,10 +136,10 @@ fn has_invalid_blend_constants(arg1: u32, arg2: u32) -> bool { /// Set of bitflags for texture unpacking (texImage2d, etc...) bitflags! { #[derive(JSTraceable, MallocSizeOf)] - flags TextureUnpacking: u8 { - const FLIP_Y_AXIS = 0x01, - const PREMULTIPLY_ALPHA = 0x02, - const CONVERT_COLORSPACE = 0x04, + struct TextureUnpacking: u8 { + const FLIP_Y_AXIS = 0x01; + const PREMULTIPLY_ALPHA = 0x02; + const CONVERT_COLORSPACE = 0x04; } } @@ -235,7 +235,7 @@ impl WebGLRenderingContext { limits: ctx_data.limits, canvas: Dom::from_ref(canvas), last_error: Cell::new(None), - texture_unpacking_settings: Cell::new(CONVERT_COLORSPACE), + texture_unpacking_settings: Cell::new(TextureUnpacking::CONVERT_COLORSPACE), texture_unpacking_alignment: Cell::new(4), bound_framebuffer: MutNullableDom::new(None), bound_textures: DomRefCell::new(Default::default()), @@ -878,7 +878,7 @@ impl WebGLRenderingContext { width: usize, height: usize, unpacking_alignment: usize) -> Vec<u8> { - if !self.texture_unpacking_settings.get().contains(FLIP_Y_AXIS) { + if !self.texture_unpacking_settings.get().contains(TextureUnpacking::FLIP_Y_AXIS) { return pixels; } @@ -906,7 +906,7 @@ impl WebGLRenderingContext { format: TexFormat, data_type: TexDataType, pixels: Vec<u8>) -> Vec<u8> { - if !self.texture_unpacking_settings.get().contains(PREMULTIPLY_ALPHA) { + if !self.texture_unpacking_settings.get().contains(TextureUnpacking::PREMULTIPLY_ALPHA) { return pixels; } @@ -990,7 +990,7 @@ impl WebGLRenderingContext { source_premultiplied: bool, source_from_image_or_canvas: bool, mut pixels: Vec<u8>) -> Vec<u8> { - let dest_premultiply = self.texture_unpacking_settings.get().contains(PREMULTIPLY_ALPHA); + let dest_premultiply = self.texture_unpacking_settings.get().contains(TextureUnpacking::PREMULTIPLY_ALPHA); if !source_premultiplied && dest_premultiply { if source_from_image_or_canvas { // When the pixels come from image or canvas or imagedata, use RGBA8 format @@ -2450,9 +2450,9 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { match param_name { constants::UNPACK_FLIP_Y_WEBGL => { if param_value != 0 { - texture_settings.insert(FLIP_Y_AXIS) + texture_settings.insert(TextureUnpacking::FLIP_Y_AXIS) } else { - texture_settings.remove(FLIP_Y_AXIS) + texture_settings.remove(TextureUnpacking::FLIP_Y_AXIS) } self.texture_unpacking_settings.set(texture_settings); @@ -2460,9 +2460,9 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { }, constants::UNPACK_PREMULTIPLY_ALPHA_WEBGL => { if param_value != 0 { - texture_settings.insert(PREMULTIPLY_ALPHA) + texture_settings.insert(TextureUnpacking::PREMULTIPLY_ALPHA) } else { - texture_settings.remove(PREMULTIPLY_ALPHA) + texture_settings.remove(TextureUnpacking::PREMULTIPLY_ALPHA) } self.texture_unpacking_settings.set(texture_settings); @@ -2471,9 +2471,9 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { constants::UNPACK_COLORSPACE_CONVERSION_WEBGL => { match param_value as u32 { constants::BROWSER_DEFAULT_WEBGL - => texture_settings.insert(CONVERT_COLORSPACE), + => texture_settings.insert(TextureUnpacking::CONVERT_COLORSPACE), constants::NONE - => texture_settings.remove(CONVERT_COLORSPACE), + => texture_settings.remove(TextureUnpacking::CONVERT_COLORSPACE), _ => return self.webgl_error(InvalidEnum), } |