Skip to content
Permalink
Browse files

Instanciate and use the implemented webrender::ExternalImageHandler

  • Loading branch information...
ceyusa authored and ferjm committed Jun 14, 2019
1 parent e000c14 commit a9ad088e707a637f9f7e223cc2a0419af41f726d
Showing with 12 additions and 5 deletions.
  1. +4 −2 components/canvas/media_mode/inprocess.rs
  2. +8 −3 components/servo/lib.rs
@@ -13,9 +13,11 @@ use euclid::Size2D;
pub struct GLPlayerThreads(GLPlayerSender<GLPlayerMsg>);

impl GLPlayerThreads {
pub fn new() -> GLPlayerThreads {
pub fn new() -> (GLPlayerThreads, Box<dyn webrender::ExternalImageHandler>) {
let channel = GLPlayerThread::start();
GLPlayerThreads(channel)
let external =
GLPlayerExternalImageHandler::new(GLPlayerExternalImages::new(channel.clone()));
(GLPlayerThreads(channel), Box::new(external))
}

/// Gets the GLPlayerThread handle for each script pipeline.
@@ -309,8 +309,13 @@ where
let gl_context = window.get_gl_context();
let glplayer_threads = match gl_context {
GlContext::Unknown => None,
_ => Some(GLPlayerThreads::new()),
_ => {
let (glplayer_threads, image_handler) = GLPlayerThreads::new();
webrender.set_external_image_handler(image_handler);
Some(glplayer_threads)
},
};

let player_context = WindowGLContext {
gl_context,
native_display: window.get_native_display(),
@@ -697,15 +702,15 @@ fn create_constellation(

// Initialize WebGL Thread entry point.
let webgl_threads = gl_factory.map(|factory| {
let (webgl_threads, image_handler, output_handler) = WebGLThreads::new(
let (webgl_threads, _image_handler, output_handler) = WebGLThreads::new(
factory,
window_gl,
webrender_api_sender.clone(),
webvr_compositor.map(|c| c as Box<_>),
);

// Set webrender external image handler for WebGL textures
webrender.set_external_image_handler(image_handler);
//webrender.set_external_image_handler(image_handler);

// Set DOM to texture handler, if enabled.
if let Some(output_handler) = output_handler {

0 comments on commit a9ad088

Please sign in to comment.
You can’t perform that action at this time.