mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update webrender
This commit is contained in:
parent
482923cec2
commit
5413328be2
20 changed files with 138 additions and 122 deletions
|
@ -88,8 +88,8 @@ impl MediaFrameRenderer {
|
|||
impl FrameRenderer for MediaFrameRenderer {
|
||||
fn render(&mut self, frame: Frame) {
|
||||
let descriptor = ImageDescriptor::new(
|
||||
frame.get_width() as u32,
|
||||
frame.get_height() as u32,
|
||||
frame.get_width(),
|
||||
frame.get_height(),
|
||||
ImageFormat::BGRA8,
|
||||
false,
|
||||
false,
|
||||
|
@ -107,7 +107,12 @@ impl FrameRenderer for MediaFrameRenderer {
|
|||
Some((ref image_key, ref mut width, ref mut height))
|
||||
if *width == frame.get_width() && *height == frame.get_height() =>
|
||||
{
|
||||
txn.update_image(*image_key, descriptor, image_data, None);
|
||||
txn.update_image(
|
||||
*image_key,
|
||||
descriptor,
|
||||
image_data,
|
||||
&webrender_api::DirtyRect::All,
|
||||
);
|
||||
|
||||
if let Some(old_image_key) = self.old_frame.take() {
|
||||
txn.delete_image(old_image_key);
|
||||
|
|
|
@ -16,7 +16,7 @@ use euclid::TypedSize2D;
|
|||
use profile_traits::ipc;
|
||||
use script_traits::ScriptMsg;
|
||||
use style_traits::CSSPixel;
|
||||
use webrender_api::DeviceUintSize;
|
||||
use webrender_api::DeviceIntSize;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct Screen {
|
||||
|
@ -42,7 +42,7 @@ impl Screen {
|
|||
|
||||
fn screen_size(&self) -> TypedSize2D<u32, CSSPixel> {
|
||||
let (send, recv) =
|
||||
ipc::channel::<DeviceUintSize>(self.global().time_profiler_chan().clone()).unwrap();
|
||||
ipc::channel::<DeviceIntSize>(self.global().time_profiler_chan().clone()).unwrap();
|
||||
self.window
|
||||
.upcast::<GlobalScope>()
|
||||
.script_to_constellation_chan()
|
||||
|
@ -55,7 +55,7 @@ impl Screen {
|
|||
|
||||
fn screen_avail_size(&self) -> TypedSize2D<u32, CSSPixel> {
|
||||
let (send, recv) =
|
||||
ipc::channel::<DeviceUintSize>(self.global().time_profiler_chan().clone()).unwrap();
|
||||
ipc::channel::<DeviceIntSize>(self.global().time_profiler_chan().clone()).unwrap();
|
||||
self.window
|
||||
.upcast::<GlobalScope>()
|
||||
.script_to_constellation_chan()
|
||||
|
|
|
@ -129,9 +129,7 @@ use style::str::HTML_SPACE_CHARACTERS;
|
|||
use style::stylesheets::CssRuleType;
|
||||
use style_traits::{CSSPixel, DevicePixel, ParsingMode};
|
||||
use url::Position;
|
||||
use webrender_api::{
|
||||
DeviceIntPoint, DeviceUintSize, DocumentId, ExternalScrollId, RenderApiSender,
|
||||
};
|
||||
use webrender_api::{DeviceIntPoint, DeviceIntSize, DocumentId, ExternalScrollId, RenderApiSender};
|
||||
use webvr_traits::WebVRMsg;
|
||||
|
||||
/// Current state of the window object
|
||||
|
@ -1042,7 +1040,7 @@ impl WindowMethods for Window {
|
|||
//TODO determine if this operation is allowed
|
||||
let dpr = self.device_pixel_ratio();
|
||||
let size = TypedSize2D::new(width, height).to_f32() * dpr;
|
||||
self.send_to_embedder(EmbedderMsg::ResizeTo(size.to_u32()));
|
||||
self.send_to_embedder(EmbedderMsg::ResizeTo(size.to_i32()));
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom-view/#dom-window-resizeby
|
||||
|
@ -1326,7 +1324,7 @@ impl Window {
|
|||
fn client_window(&self) -> (TypedSize2D<u32, CSSPixel>, TypedPoint2D<i32, CSSPixel>) {
|
||||
let timer_profile_chan = self.global().time_profiler_chan().clone();
|
||||
let (send, recv) =
|
||||
ProfiledIpc::channel::<(DeviceUintSize, DeviceIntPoint)>(timer_profile_chan).unwrap();
|
||||
ProfiledIpc::channel::<(DeviceIntSize, DeviceIntPoint)>(timer_profile_chan).unwrap();
|
||||
self.send_to_constellation(ScriptMsg::GetClientWindow(send));
|
||||
let (size, point) = recv
|
||||
.recv()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue