mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Rename gleam feature to gl in compositing
This commit is contained in:
parent
87c849c0d6
commit
faee0b2b0c
5 changed files with 15 additions and 14 deletions
|
@ -13,6 +13,7 @@ path = "lib.rs"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
|
gl = ["gleam"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
crossbeam-channel = "0.3"
|
crossbeam-channel = "0.3"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
use crate::compositor_thread::{CompositorProxy, CompositorReceiver};
|
use crate::compositor_thread::{CompositorProxy, CompositorReceiver};
|
||||||
use crate::compositor_thread::{InitialCompositorState, Msg};
|
use crate::compositor_thread::{InitialCompositorState, Msg};
|
||||||
#[cfg(feature = "gleam")]
|
#[cfg(feature = "gl")]
|
||||||
use crate::gl;
|
use crate::gl;
|
||||||
use crate::touch::{TouchAction, TouchHandler};
|
use crate::touch::{TouchAction, TouchHandler};
|
||||||
use crate::windowing::{
|
use crate::windowing::{
|
||||||
|
@ -15,13 +15,13 @@ use crate::SendableFrameTree;
|
||||||
use crossbeam_channel::Sender;
|
use crossbeam_channel::Sender;
|
||||||
use euclid::{TypedPoint2D, TypedScale, TypedVector2D};
|
use euclid::{TypedPoint2D, TypedScale, TypedVector2D};
|
||||||
use gfx_traits::Epoch;
|
use gfx_traits::Epoch;
|
||||||
#[cfg(feature = "gleam")]
|
#[cfg(feature = "gl")]
|
||||||
use image::{DynamicImage, ImageFormat};
|
use image::{DynamicImage, ImageFormat};
|
||||||
use ipc_channel::ipc;
|
use ipc_channel::ipc;
|
||||||
use libc::c_void;
|
use libc::c_void;
|
||||||
use msg::constellation_msg::{PipelineId, PipelineIndex, PipelineNamespaceId};
|
use msg::constellation_msg::{PipelineId, PipelineIndex, PipelineNamespaceId};
|
||||||
use net_traits::image::base::Image;
|
use net_traits::image::base::Image;
|
||||||
#[cfg(feature = "gleam")]
|
#[cfg(feature = "gl")]
|
||||||
use net_traits::image::base::PixelFormat;
|
use net_traits::image::base::PixelFormat;
|
||||||
use profile_traits::time::{self as profile_time, profile, ProfilerCategory};
|
use profile_traits::time::{self as profile_time, profile, ProfilerCategory};
|
||||||
use script_traits::CompositorEvent::{MouseButtonEvent, MouseMoveEvent, TouchEvent};
|
use script_traits::CompositorEvent::{MouseButtonEvent, MouseMoveEvent, TouchEvent};
|
||||||
|
@ -1211,13 +1211,13 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let rt_info = match target {
|
let rt_info = match target {
|
||||||
#[cfg(feature = "gleam")]
|
#[cfg(feature = "gl")]
|
||||||
CompositeTarget::Window => gl::RenderTargetInfo::default(),
|
CompositeTarget::Window => gl::RenderTargetInfo::default(),
|
||||||
#[cfg(feature = "gleam")]
|
#[cfg(feature = "gl")]
|
||||||
CompositeTarget::WindowAndPng | CompositeTarget::PngFile => {
|
CompositeTarget::WindowAndPng | CompositeTarget::PngFile => {
|
||||||
gl::initialize_png(&*self.window.gl(), width, height)
|
gl::initialize_png(&*self.window.gl(), width, height)
|
||||||
},
|
},
|
||||||
#[cfg(not(feature = "gleam"))]
|
#[cfg(not(feature = "gl"))]
|
||||||
_ => (),
|
_ => (),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1272,7 +1272,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
||||||
|
|
||||||
let rv = match target {
|
let rv = match target {
|
||||||
CompositeTarget::Window => None,
|
CompositeTarget::Window => None,
|
||||||
#[cfg(feature = "gleam")]
|
#[cfg(feature = "gl")]
|
||||||
CompositeTarget::WindowAndPng => {
|
CompositeTarget::WindowAndPng => {
|
||||||
let img = gl::draw_img(&*self.window.gl(), rt_info, width, height);
|
let img = gl::draw_img(&*self.window.gl(), rt_info, width, height);
|
||||||
Some(Image {
|
Some(Image {
|
||||||
|
@ -1283,7 +1283,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
||||||
id: None,
|
id: None,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
#[cfg(feature = "gleam")]
|
#[cfg(feature = "gl")]
|
||||||
CompositeTarget::PngFile => {
|
CompositeTarget::PngFile => {
|
||||||
let gl = &*self.window.gl();
|
let gl = &*self.window.gl();
|
||||||
profile(
|
profile(
|
||||||
|
@ -1307,7 +1307,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
||||||
);
|
);
|
||||||
None
|
None
|
||||||
},
|
},
|
||||||
#[cfg(not(feature = "gleam"))]
|
#[cfg(not(feature = "gl"))]
|
||||||
_ => None,
|
_ => None,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ use style_traits::CSSPixel;
|
||||||
|
|
||||||
mod compositor;
|
mod compositor;
|
||||||
pub mod compositor_thread;
|
pub mod compositor_thread;
|
||||||
#[cfg(feature = "gleam")]
|
#[cfg(feature = "gl")]
|
||||||
mod gl;
|
mod gl;
|
||||||
mod touch;
|
mod touch;
|
||||||
pub mod windowing;
|
pub mod windowing;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
use embedder_traits::EventLoopWaker;
|
use embedder_traits::EventLoopWaker;
|
||||||
use euclid::TypedScale;
|
use euclid::TypedScale;
|
||||||
#[cfg(feature = "gleam")]
|
#[cfg(feature = "gl")]
|
||||||
use gleam::gl;
|
use gleam::gl;
|
||||||
use keyboard_types::KeyboardEvent;
|
use keyboard_types::KeyboardEvent;
|
||||||
use msg::constellation_msg::{TopLevelBrowsingContextId, TraversalDirection};
|
use msg::constellation_msg::{TopLevelBrowsingContextId, TraversalDirection};
|
||||||
|
@ -14,7 +14,7 @@ use script_traits::{MouseButton, TouchEventType, TouchId};
|
||||||
use servo_geometry::DeviceIndependentPixel;
|
use servo_geometry::DeviceIndependentPixel;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::fmt::{Debug, Error, Formatter};
|
use std::fmt::{Debug, Error, Formatter};
|
||||||
#[cfg(feature = "gleam")]
|
#[cfg(feature = "gl")]
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use style_traits::DevicePixel;
|
use style_traits::DevicePixel;
|
||||||
use webrender_api::{DeviceIntPoint, DevicePoint, DeviceUintRect, DeviceUintSize, ScrollLocation};
|
use webrender_api::{DeviceIntPoint, DevicePoint, DeviceUintRect, DeviceUintSize, ScrollLocation};
|
||||||
|
@ -131,7 +131,7 @@ pub trait WindowMethods {
|
||||||
/// proceed and false if it should not.
|
/// proceed and false if it should not.
|
||||||
fn prepare_for_composite(&self) -> bool;
|
fn prepare_for_composite(&self) -> bool;
|
||||||
/// Return the GL function pointer trait.
|
/// Return the GL function pointer trait.
|
||||||
#[cfg(feature = "gleam")]
|
#[cfg(feature = "gl")]
|
||||||
fn gl(&self) -> Rc<dyn gl::Gl>;
|
fn gl(&self) -> Rc<dyn gl::Gl>;
|
||||||
/// Returns a thread-safe object to wake up the window's event loop.
|
/// Returns a thread-safe object to wake up the window's event loop.
|
||||||
fn create_event_loop_waker(&self) -> Box<dyn EventLoopWaker>;
|
fn create_event_loop_waker(&self) -> Box<dyn EventLoopWaker>;
|
||||||
|
|
|
@ -38,7 +38,7 @@ bluetooth_traits = {path = "../bluetooth_traits"}
|
||||||
bluetooth = {path = "../bluetooth"}
|
bluetooth = {path = "../bluetooth"}
|
||||||
canvas = {path = "../canvas"}
|
canvas = {path = "../canvas"}
|
||||||
canvas_traits = {path = "../canvas_traits"}
|
canvas_traits = {path = "../canvas_traits"}
|
||||||
compositing = {path = "../compositing", features = ["gleam"]}
|
compositing = {path = "../compositing", features = ["gl"]}
|
||||||
constellation = {path = "../constellation"}
|
constellation = {path = "../constellation"}
|
||||||
crossbeam-channel = "0.3"
|
crossbeam-channel = "0.3"
|
||||||
debugger = {path = "../debugger"}
|
debugger = {path = "../debugger"}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue