aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2018-07-08 01:59:58 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2018-07-08 10:44:42 +0200
commitf0ca100e87d5a7db7fa19b42e62e857a32a04638 (patch)
treeb119d66fc94013218b363b01fd271b3e6e2f044c /components/script/dom
parent31774e9203961ee31b7a358224570ca9bc5fdd2e (diff)
downloadservo-f0ca100e87d5a7db7fa19b42e62e857a32a04638.tar.gz
servo-f0ca100e87d5a7db7fa19b42e62e857a32a04638.zip
Return an empty typed array from gl.getParameter(gl.COMPRESSED_TEXTURE_FORMATS)
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/webglrenderingcontext.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs
index 24085bf4610..e5b66a46f55 100644
--- a/components/script/dom/webglrenderingcontext.rs
+++ b/components/script/dom/webglrenderingcontext.rs
@@ -55,7 +55,7 @@ use js::jsapi::{JSContext, JSObject, Type};
use js::jsval::{BooleanValue, DoubleValue, Int32Value, UInt32Value, JSVal};
use js::jsval::{ObjectValue, NullValue, UndefinedValue};
use js::rust::CustomAutoRooterGuard;
-use js::typedarray::{ArrayBufferView, CreateWith, Float32Array, Int32Array};
+use js::typedarray::{ArrayBufferView, CreateWith, Float32Array, Int32Array, Uint32Array};
use net_traits::image::base::PixelFormat;
use net_traits::image_cache::ImageResponse;
use offscreen_gl_context::{GLContextAttributes, GLLimits};
@@ -1332,6 +1332,16 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
return Int32Value(constants::UNSIGNED_BYTE as i32);
}
}
+ constants::COMPRESSED_TEXTURE_FORMATS => {
+ // FIXME(nox): https://github.com/servo/servo/issues/20594
+ rooted!(in(cx) let mut rval = ptr::null_mut::<JSObject>());
+ let _ = Uint32Array::create(
+ cx,
+ CreateWith::Slice(&[]),
+ rval.handle_mut(),
+ ).unwrap();
+ return ObjectValue(rval.get());
+ }
constants::VERSION => {
rooted!(in(cx) let mut rval = UndefinedValue());
"WebGL 1.0".to_jsval(cx, rval.handle_mut());