diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-07-12 15:03:00 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-12 15:03:00 -0400 |
commit | 2f1e822de84c6af65576fc238d34219fcae1861c (patch) | |
tree | 8493b7aa58d3e19cf558ebd5d346e5ea2ae897c4 /components/script/dom/webglrenderingcontext.rs | |
parent | 812bf8d816d29ecf132ff15a2da6a83c690e2e48 (diff) | |
parent | dbaed5ed9276843ae3aa10f8671f65db839b7ffe (diff) | |
download | servo-2f1e822de84c6af65576fc238d34219fcae1861c.tar.gz servo-2f1e822de84c6af65576fc238d34219fcae1861c.zip |
Auto merge of #23744 - jdm:gles-fixes, r=asajeffrey
Make GL/GLES decisions based on the API in use
These changes remove a number of assumptions about whether GL/GLES is in use, improving the support for running WebGL in Servo under ANGLE.
---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because no tests on Windows.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23744)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/webglrenderingcontext.rs')
-rw-r--r-- | components/script/dom/webglrenderingcontext.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs index d138dc3952e..d413bd1ac71 100644 --- a/components/script/dom/webglrenderingcontext.rs +++ b/components/script/dom/webglrenderingcontext.rs @@ -52,8 +52,8 @@ use crate::dom::window::Window; use backtrace::Backtrace; use canvas_traits::webgl::WebGLError::*; use canvas_traits::webgl::{ - webgl_channel, AlphaTreatment, DOMToTextureCommand, GLContextAttributes, GLLimits, Parameter, - TexDataType, TexFormat, TexParameter, WebGLCommand, WebGLCommandBacktrace, + webgl_channel, AlphaTreatment, DOMToTextureCommand, GLContextAttributes, GLLimits, GlType, + Parameter, TexDataType, TexFormat, TexParameter, WebGLCommand, WebGLCommandBacktrace, WebGLContextShareMode, WebGLError, WebGLFramebufferBindingRequest, WebGLMsg, WebGLMsgSender, WebGLProgramId, WebGLResult, WebGLSLVersion, WebGLSender, WebGLVersion, WebVRCommand, YAxisTreatment, @@ -166,6 +166,7 @@ pub struct WebGLRenderingContext { default_vao: DomOnceCell<WebGLVertexArrayObjectOES>, current_vao: MutNullableDom<WebGLVertexArrayObjectOES>, textures: Textures, + api_type: GlType, } impl WebGLRenderingContext { @@ -216,11 +217,12 @@ impl WebGLRenderingContext { // what was requested size: Cell::new(size), current_clear_color: Cell::new((0.0, 0.0, 0.0, 0.0)), - extension_manager: WebGLExtensions::new(webgl_version), + extension_manager: WebGLExtensions::new(webgl_version, ctx_data.api_type), capabilities: Default::default(), default_vao: Default::default(), current_vao: Default::default(), textures: Textures::new(max_combined_texture_image_units), + api_type: ctx_data.api_type, } }) } @@ -2106,6 +2108,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { handle_potential_webgl_error!( self, shader.compile( + self.api_type, self.webgl_version, self.glsl_version, &self.limits, @@ -4031,7 +4034,10 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { self.bound_renderbuffer.get().ok_or(InvalidOperation), return ); - handle_potential_webgl_error!(self, rb.storage(internal_format, width, height)); + handle_potential_webgl_error!( + self, + rb.storage(self.api_type, internal_format, width, height) + ); if let Some(fb) = self.bound_framebuffer.get() { fb.invalidate_renderbuffer(&*rb); } |