mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Do not share entire FrameRenderer with layout, only current frame
This commit is contained in:
parent
1f406ef0a0
commit
8c40ef459b
8 changed files with 102 additions and 149 deletions
|
@ -2000,7 +2000,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
}
|
||||
},
|
||||
SpecificFragmentInfo::Media(ref fragment_info) => {
|
||||
if let Some((ref image_key, _, _)) = fragment_info.frame_source.get_current_frame()
|
||||
if let Some((ref image_key, _, _)) = fragment_info.current_frame
|
||||
{
|
||||
let base = create_base_display_item(state);
|
||||
state.add_image_item(
|
||||
|
|
|
@ -32,9 +32,7 @@ use net_traits::image::base::{Image, ImageMetadata};
|
|||
use net_traits::image_cache::{ImageOrMetadataAvailable, UsePlaceholder};
|
||||
use range::*;
|
||||
use script_layout_interface::wrapper_traits::{PseudoElementType, ThreadSafeLayoutElement, ThreadSafeLayoutNode};
|
||||
use script_layout_interface::{
|
||||
HTMLCanvasData, HTMLCanvasDataSource, HTMLMediaData, HTMLMediaFrameSource, SVGSVGData,
|
||||
};
|
||||
use script_layout_interface::{HTMLCanvasData, HTMLCanvasDataSource, HTMLMediaData, SVGSVGData};
|
||||
use serde::ser::{Serialize, SerializeStruct, Serializer};
|
||||
use servo_url::ServoUrl;
|
||||
use std::{f32, fmt};
|
||||
|
@ -368,23 +366,15 @@ impl CanvasFragmentInfo {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct MediaFragmentInfo {
|
||||
pub frame_source: Box<HTMLMediaFrameSource>,
|
||||
}
|
||||
|
||||
// XXX
|
||||
impl Clone for MediaFragmentInfo {
|
||||
fn clone(&self) -> MediaFragmentInfo {
|
||||
MediaFragmentInfo {
|
||||
frame_source: self.frame_source.clone_boxed(),
|
||||
}
|
||||
}
|
||||
pub current_frame: Option<(webrender_api::ImageKey, i32, i32)>,
|
||||
}
|
||||
|
||||
impl MediaFragmentInfo {
|
||||
pub fn new(data: HTMLMediaData) -> MediaFragmentInfo {
|
||||
MediaFragmentInfo {
|
||||
frame_source: data.frame_source,
|
||||
current_frame: data.current_frame,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1006,7 +996,7 @@ impl Fragment {
|
|||
}
|
||||
}
|
||||
SpecificFragmentInfo::Media(ref info) => {
|
||||
if let Some((_, width, _)) = info.frame_source.get_current_frame() {
|
||||
if let Some((_, width, _)) = info.current_frame {
|
||||
Au::from_px(width as i32)
|
||||
} else {
|
||||
Au(0)
|
||||
|
@ -1036,7 +1026,7 @@ impl Fragment {
|
|||
}
|
||||
}
|
||||
SpecificFragmentInfo::Media(ref info) => {
|
||||
if let Some((_, _, height)) = info.frame_source.get_current_frame() {
|
||||
if let Some((_, _, height)) = info.current_frame {
|
||||
Au::from_px(height as i32)
|
||||
} else {
|
||||
Au(0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue