Bump bitflags to 1.0 in every servo crate

This commit is contained in:
Bastien Orivel 2017-10-30 12:15:30 +01:00
parent b6475cf433
commit 29b4eec141
131 changed files with 1591 additions and 1580 deletions

View file

@ -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;
}
}
@ -239,7 +239,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()),
@ -887,7 +887,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;
}
@ -915,7 +915,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;
}
@ -999,7 +999,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
@ -2459,9 +2459,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);
@ -2469,9 +2469,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);
@ -2480,9 +2480,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),
}