aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_traits/lib.rs
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2019-06-18 17:45:56 +0200
committerFernando Jiménez Moreno <ferjmoreno@gmail.com>2019-07-04 10:24:01 +0200
commit9f4f9dc750ea98e70dbdab8b2a0e5ef6c98dd889 (patch)
tree4da42943383a12acb47cd43bbf91277fc0d497d3 /components/script_traits/lib.rs
parente9f46f9d7249999279af60b8b78479f6525757bc (diff)
downloadservo-9f4f9dc750ea98e70dbdab8b2a0e5ef6c98dd889.tar.gz
servo-9f4f9dc750ea98e70dbdab8b2a0e5ef6c98dd889.zip
Add media (WindowGLContext) module in canvas_trait
This module adds a structure (WindowGLContext) which holds the OpenGL parameters that are going to be used by servo-media player to render video frames using OpenGL. In order to fill this structure, three new methods were added to WindowMethods trait. In this patch only the Glutin-based implementation provides a simple boilerplate. The WindowGLContext is created in the entry point of libservo, when the application window is created, and later passed to the constellation, the pipeline and to the window element in dom, thus htmlmediaelement has a mean to obtain these parameters via its window.
Diffstat (limited to 'components/script_traits/lib.rs')
-rw-r--r--components/script_traits/lib.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs
index 40e710846f9..8a7dd06e025 100644
--- a/components/script_traits/lib.rs
+++ b/components/script_traits/lib.rs
@@ -21,6 +21,7 @@ pub mod webdriver_msg;
use crate::webdriver_msg::{LoadStatus, WebDriverScriptCommand};
use bluetooth_traits::BluetoothRequest;
+use canvas_traits::media::WindowGLContext;
use canvas_traits::webgl::WebGLPipeline;
use crossbeam_channel::{Receiver, RecvTimeoutError, Sender};
use devtools_traits::{DevtoolScriptControlMsg, ScriptToDevtoolsControlMsg, WorkerId};
@@ -636,6 +637,8 @@ pub struct InitialScriptState {
pub webrender_api_sender: RenderApiSender,
/// Flag to indicate if the layout thread is busy handling a request.
pub layout_is_busy: Arc<AtomicBool>,
+ /// Application window's GL Context for Media player
+ pub player_context: WindowGLContext,
}
/// This trait allows creating a `ScriptThread` without depending on the `script`