aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webglrenderingcontext.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-10-19 17:50:24 -0500
committerGitHub <noreply@github.com>2017-10-19 17:50:24 -0500
commit89c1892b304fc0a609a291724286a0bf9ebf4605 (patch)
tree083c71bdf8216ca56d38d509e5b2988eb18da5ca /components/script/dom/webglrenderingcontext.rs
parentfe16c1d5c3c9084da0ccb85af599d6ec0f8ab20b (diff)
parent11c64178d86979e8d50f11cff66c2b0e8fe666c1 (diff)
downloadservo-89c1892b304fc0a609a291724286a0bf9ebf4605.tar.gz
servo-89c1892b304fc0a609a291724286a0bf9ebf4605.zip
Auto merge of #18960 - emilio:gecko-backout-manually, r=emilio
Backed out changeset e64e659c077d: servo PR #18809 and revendor for r… …eftest failures, e.g. in layout/reftests/bugs/392435-1.html. r=backout on a CLOSED TREE Backs out https://github.com/servo/servo/pull/18809
Diffstat (limited to 'components/script/dom/webglrenderingcontext.rs')
-rw-r--r--components/script/dom/webglrenderingcontext.rs28
1 files changed, 14 insertions, 14 deletions
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs
index b58481d9526..514fac1e492 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)]
- struct TextureUnpacking: u8 {
- const FLIP_Y_AXIS = 0x01;
- const PREMULTIPLY_ALPHA = 0x02;
- const CONVERT_COLORSPACE = 0x04;
+ flags 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(TextureUnpacking::CONVERT_COLORSPACE),
+ texture_unpacking_settings: Cell::new(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(TextureUnpacking::FLIP_Y_AXIS) {
+ if !self.texture_unpacking_settings.get().contains(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(TextureUnpacking::PREMULTIPLY_ALPHA) {
+ if !self.texture_unpacking_settings.get().contains(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(TextureUnpacking::PREMULTIPLY_ALPHA);
+ let dest_premultiply = self.texture_unpacking_settings.get().contains(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(TextureUnpacking::FLIP_Y_AXIS)
+ texture_settings.insert(FLIP_Y_AXIS)
} else {
- texture_settings.remove(TextureUnpacking::FLIP_Y_AXIS)
+ texture_settings.remove(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(TextureUnpacking::PREMULTIPLY_ALPHA)
+ texture_settings.insert(PREMULTIPLY_ALPHA)
} else {
- texture_settings.remove(TextureUnpacking::PREMULTIPLY_ALPHA)
+ texture_settings.remove(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(TextureUnpacking::CONVERT_COLORSPACE),
+ => texture_settings.insert(CONVERT_COLORSPACE),
constants::NONE
- => texture_settings.remove(TextureUnpacking::CONVERT_COLORSPACE),
+ => texture_settings.remove(CONVERT_COLORSPACE),
_ => return self.webgl_error(InvalidEnum),
}