Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reenable Android emulator tests in CI. #22257

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Large diffs are not rendered by default.

@@ -41,10 +41,8 @@ use std::rc::Rc;
use style_traits::viewport::ViewportConstraints;
use style_traits::{CSSPixel, DevicePixel, PinchZoomFactor};
use time::{now, precise_time_ns, precise_time_s};
use webrender_api::{
self, DeviceIntPoint, DevicePoint, FramebufferIntSize, HitTestFlags, HitTestResult,
};
use webrender_api::{LayoutVector2D, ScrollLocation};
use webrender_api::{self, HitTestFlags, HitTestResult, ScrollLocation};
use webrender_api::units::{DeviceIntPoint, DevicePoint, FramebufferIntSize, LayoutVector2D};
use webvr_traits::WebVRMainThreadHeartbeat;

#[derive(Debug, PartialEq)]
@@ -676,7 +674,7 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
let dppx = self.page_zoom * self.hidpi_factor();
let scaled_point = (point / dppx).to_untyped();

let world_cursor = webrender_api::WorldPoint::from_untyped(&scaled_point);
let world_cursor = webrender_api::units::WorldPoint::from_untyped(&scaled_point);
self.webrender_api.hit_test(
self.webrender_document,
None,
@@ -781,7 +779,7 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
self.pending_scroll_zoom_events.push(ScrollZoomEvent {
magnification: magnification,
scroll_location: ScrollLocation::Delta(
webrender_api::LayoutVector2D::from_untyped(&scroll_delta.to_untyped()),
LayoutVector2D::from_untyped(&scroll_delta.to_untyped()),
),
cursor: cursor,
event_count: 1,
@@ -866,7 +864,7 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
*last_combined_event = Some(ScrollZoomEvent {
magnification: scroll_event.magnification,
scroll_location: ScrollLocation::Delta(
webrender_api::LayoutVector2D::from_untyped(&this_delta.to_untyped()),
LayoutVector2D::from_untyped(&this_delta.to_untyped()),
),
cursor: this_cursor,
event_count: 1,
@@ -899,14 +897,14 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
self.scale)
.to_untyped();
let calculated_delta =
webrender_api::LayoutVector2D::from_untyped(&scaled_delta);
LayoutVector2D::from_untyped(&scaled_delta);
ScrollLocation::Delta(calculated_delta)
},
// Leave ScrollLocation unchanged if it is Start or End location.
sl @ ScrollLocation::Start | sl @ ScrollLocation::End => sl,
};
let cursor = (combined_event.cursor.to_f32() / self.scale).to_untyped();
let cursor = webrender_api::WorldPoint::from_untyped(&cursor);
let cursor = webrender_api::units::WorldPoint::from_untyped(&cursor);
let mut txn = webrender_api::Transaction::new();
txn.scroll(scroll_location, cursor);
if combined_event.magnification != 1.0 {
@@ -17,7 +17,7 @@ use profile_traits::time;
use script_traits::{AnimationState, ConstellationMsg, EventResult};
use std::fmt::{Debug, Error, Formatter};
use style_traits::viewport::ViewportConstraints;
use webrender_api::{self, DeviceIntPoint, DeviceIntSize};
use webrender_api::units::{DeviceIntPoint, DeviceIntSize};
use webvr_traits::WebVRMainThreadHeartbeat;

/// Sends messages to the compositor.
@@ -18,9 +18,10 @@ use std::fmt::{Debug, Error, Formatter};
use std::rc::Rc;
use std::time::Duration;
use style_traits::DevicePixel;
use webrender_api::{
use webrender_api::ScrollLocation;
use webrender_api::units::{
DeviceIntPoint, DeviceIntRect, DeviceIntSize, DevicePoint, FramebufferIntRect,
FramebufferIntSize, ScrollLocation,
FramebufferIntSize,
};
use webvr::VRServiceManager;
use webvr_traits::WebVRMainThreadHeartbeat;
@@ -19,7 +19,7 @@ use keyboard_types::KeyboardEvent;
use msg::constellation_msg::{InputMethodType, PipelineId, TopLevelBrowsingContextId};
use servo_url::ServoUrl;
use std::fmt::{Debug, Error, Formatter};
use webrender_api::{DeviceIntPoint, DeviceIntSize};
use webrender_api::units::{DeviceIntPoint, DeviceIntSize};

/// A cursor for the window. This is different from a CSS cursor (see
/// `CursorKind`) in that it has no `Auto` value.
@@ -8,7 +8,7 @@ extern crate malloc_size_of_derive;
use app_units::{Au, MAX_AU, MIN_AU};
use euclid::{Length, Point2D, Rect, Size2D};
use std::f32;
use webrender_api::{FramebufferPixel, LayoutPoint, LayoutRect, LayoutSize};
use webrender_api::units::{FramebufferPixel, LayoutPoint, LayoutRect, LayoutSize};

// Units for use with euclid::length and euclid::scale_factor.

@@ -12,8 +12,8 @@ use style::values::computed::{BorderCornerRadius, BorderImageWidth};
use style::values::computed::{BorderImageSideWidth, NonNegativeLengthOrNumber};
use style::values::generics::rect::Rect as StyleRect;
use style::values::generics::NonNegative;
use webrender_api::{BorderRadius, BorderSide, BorderStyle, ColorF};
use webrender_api::{LayoutSideOffsets, LayoutSize, NormalBorder};
use webrender_api::{BorderRadius, BorderSide, BorderStyle, ColorF, NormalBorder};
use webrender_api::units::{LayoutSideOffsets, LayoutSize};

/// Computes a border radius size against the containing size.
///
@@ -66,10 +66,10 @@ use style::values::{Either, RGBA};
use style_traits::ToCss;
use webrender_api::{
self, BorderDetails, BorderRadius, BorderSide, BoxShadowClipMode, ColorF, ColorU,
ExternalScrollId, FilterOp, GlyphInstance, ImageRendering, LayoutRect, LayoutSize,
LayoutTransform, LayoutVector2D, LineStyle, NinePatchBorder, NinePatchBorderSource,
NormalBorder, ScrollSensitivity, StickyOffsetBounds,
ExternalScrollId, FilterOp, GlyphInstance, ImageRendering, LineStyle, NinePatchBorder,
NinePatchBorderSource, NormalBorder, ScrollSensitivity, StickyOffsetBounds,
};
use webrender_api::units::{LayoutRect, LayoutSize, LayoutTransform, LayoutVector2D};

static THREAD_TINT_COLORS: [ColorF; 8] = [
ColorF {
@@ -116,21 +116,21 @@ impl ToLayout for RGBA {
impl ToLayout for Point2D<Au> {
type Type = wr::LayoutPoint;
fn to_layout(&self) -> Self::Type {
wr::LayoutPoint::new(self.x.to_f32_px(), self.y.to_f32_px())
wr::units::LayoutPoint::new(self.x.to_f32_px(), self.y.to_f32_px())
}
}

impl ToLayout for Rect<Au> {
type Type = wr::LayoutRect;
type Type = wr::units::LayoutRect;
fn to_layout(&self) -> Self::Type {
wr::LayoutRect::new(self.origin.to_layout(), self.size.to_layout())
wr::units::LayoutRect::new(self.origin.to_layout(), self.size.to_layout())
}
}

impl ToLayout for SideOffsets2D<Au> {
type Type = wr::LayoutSideOffsets;
type Type = wr::units::LayoutSideOffsets;
fn to_layout(&self) -> Self::Type {
wr::LayoutSideOffsets::new(
wr::units::LayoutSideOffsets::new(
self.top.to_f32_px(),
self.right.to_f32_px(),
self.bottom.to_f32_px(),
@@ -140,16 +140,16 @@ impl ToLayout for SideOffsets2D<Au> {
}

impl ToLayout for Size2D<Au> {
type Type = wr::LayoutSize;
type Type = wr::units::LayoutSize;
fn to_layout(&self) -> Self::Type {
wr::LayoutSize::new(self.width.to_f32_px(), self.height.to_f32_px())
wr::units::LayoutSize::new(self.width.to_f32_px(), self.height.to_f32_px())
}
}

impl ToLayout for Vector2D<Au> {
type Type = wr::LayoutVector2D;
type Type = wr::units::LayoutVector2D;
fn to_layout(&self) -> Self::Type {
wr::LayoutVector2D::new(self.x.to_f32_px(), self.y.to_f32_px())
wr::units::LayoutVector2D::new(self.x.to_f32_px(), self.y.to_f32_px())
}
}

@@ -26,10 +26,10 @@ use style::computed_values::_servo_top_layer::T as InTopLayer;
use webrender_api as wr;
use webrender_api::{BorderRadius, ClipMode};
use webrender_api::{ComplexClipRegion, ExternalScrollId, FilterOp};
use webrender_api::{GlyphInstance, GradientStop, ImageKey, LayoutPoint};
use webrender_api::{LayoutRect, LayoutSize, LayoutTransform, LayoutVector2D};
use webrender_api::{GlyphInstance, GradientStop, ImageKey};
use webrender_api::{MixBlendMode, ScrollSensitivity, Shadow};
use webrender_api::{StickyOffsetBounds, TransformStyle};
use webrender_api::units::{LayoutPoint, LayoutRect, LayoutSize, LayoutTransform, LayoutVector2D};

pub use style::dom::OpaqueNode;

@@ -12,8 +12,9 @@ use crate::display_list::items::{DisplayItem, DisplayList, StackingContextType};
use msg::constellation_msg::PipelineId;
use webrender_api::{
self, ClipId, DisplayListBuilder, RasterSpace, ReferenceFrameKind, SpaceAndClipInfo, SpatialId,
PropertyBinding, SpecificDisplayItem,
};
use webrender_api::{LayoutPoint, PropertyBinding, SpecificDisplayItem};
use webrender_api::units::LayoutPoint;

pub trait WebRenderDisplayListConverter {
fn convert_to_webrender(&self, pipeline_id: PipelineId) -> DisplayListBuilder;
@@ -27,7 +28,7 @@ struct ClipScrollState {
}

trait WebRenderDisplayItemConverter {
fn prim_info(&self) -> webrender_api::LayoutPrimitiveInfo;
//fn prim_info(&self) -> webrender_api::LayoutPrimitiveInfo;
fn convert_to_webrender(
&self,
clip_scroll_nodes: &[ClipScrollNode],
@@ -75,7 +76,7 @@ impl WebRenderDisplayListConverter for DisplayList {
}

impl WebRenderDisplayItemConverter for DisplayItem {
fn prim_info(&self) -> webrender_api::LayoutPrimitiveInfo {
/*fn prim_info(&self) -> webrender_api::LayoutPrimitiveInfo {
let tag = match self.base().metadata.pointing {
Some(cursor) => Some((self.base().metadata.node.0 as u64, cursor)),
None => None,
@@ -87,7 +88,7 @@ impl WebRenderDisplayItemConverter for DisplayItem {
is_backface_visible: true,
tag,
}
}
}*/

fn convert_to_webrender(
&self,
@@ -126,23 +127,23 @@ impl WebRenderDisplayItemConverter for DisplayItem {
DisplayItem::Rectangle(ref item) => {
builder.push_item(
&SpecificDisplayItem::Rectangle(item.item),
&self.prim_info(),
&space_clip_info,
/*&self.prim_info(),
&space_clip_info,*/
);
},
DisplayItem::Text(ref item) => {
builder.push_item(
&SpecificDisplayItem::Text(item.item),
&self.prim_info(),
&space_clip_info,
/*&self.prim_info(),
&space_clip_info,*/
);
builder.push_iter(item.data.iter());
},
DisplayItem::Image(ref item) => {
builder.push_item(
&SpecificDisplayItem::Image(item.item),
&self.prim_info(),
&space_clip_info,
/*&self.prim_info(),
&space_clip_info,*/
);
},
DisplayItem::Border(ref item) => {
@@ -151,49 +152,51 @@ impl WebRenderDisplayItemConverter for DisplayItem {
}
builder.push_item(
&SpecificDisplayItem::Border(item.item),
&self.prim_info(),
&space_clip_info,
/*&self.prim_info(),
&space_clip_info,*/
);
},
DisplayItem::Gradient(ref item) => {
builder.push_stops(item.data.as_ref());
builder.push_item(
&SpecificDisplayItem::Gradient(item.item),
&self.prim_info(),
&space_clip_info,
/*&self.prim_info(),
&space_clip_info,*/
);
},
DisplayItem::RadialGradient(ref item) => {
builder.push_stops(item.data.as_ref());
builder.push_item(
&SpecificDisplayItem::RadialGradient(item.item),
&self.prim_info(),
&space_clip_info,
/*&self.prim_info(),
&space_clip_info,*/
);
},
DisplayItem::Line(ref item) => {
builder.push_item(
&SpecificDisplayItem::Line(item.item),
&self.prim_info(),
&space_clip_info,
/*&self.prim_info(),
&space_clip_info,*/
);
},
DisplayItem::BoxShadow(ref item) => {
builder.push_item(
&SpecificDisplayItem::BoxShadow(item.item),
&self.prim_info(),
&space_clip_info,
/*&self.prim_info(),
&space_clip_info,*/
);
},
DisplayItem::PushTextShadow(ref item) => {
builder.push_shadow(&self.prim_info(), &space_clip_info, item.shadow);
builder.push_shadow(/*&self.prim_info(),*/ &space_clip_info, item.shadow);
},
DisplayItem::PopAllTextShadows(_) => {
builder.pop_all_shadows();
},
DisplayItem::Iframe(ref item) => {
builder.push_iframe(
&self.prim_info(),
//&self.prim_info(),
self.base().bounds(),
self.base().clip_rect,
&space_clip_info,
item.iframe.to_webrender(),
true,
@@ -203,7 +206,8 @@ impl WebRenderDisplayItemConverter for DisplayItem {
let stacking_context = &item.stacking_context;
debug_assert_eq!(stacking_context.context_type, StackingContextType::Real);

let mut info = webrender_api::LayoutPrimitiveInfo::new(stacking_context.bounds);
//let mut info = webrender_api::LayoutPrimitiveInfo::new(stacking_context.bounds);
let mut origin = stacking_context.bounds.origin;
let spatial_id =
if let Some(frame_index) = stacking_context.established_reference_frame {
let (transform, ref_frame) =
@@ -225,7 +229,7 @@ impl WebRenderDisplayItemConverter for DisplayItem {
};

let spatial_id = builder.push_reference_frame(
&stacking_context.bounds,
stacking_context.bounds.origin,
state.active_spatial_id,
stacking_context.transform_style,
PropertyBinding::Value(transform),
@@ -235,16 +239,19 @@ impl WebRenderDisplayItemConverter for DisplayItem {
state.spatial_ids[frame_index.to_index()] = Some(spatial_id);
state.clip_ids[frame_index.to_index()] = Some(cur_clip_id);

info.rect.origin = LayoutPoint::zero();
info.clip_rect.origin = LayoutPoint::zero();
origin = LayoutPoint::zero();
//info.rect.origin = LayoutPoint::zero();
//info.clip_rect.origin = LayoutPoint::zero();
spatial_id
} else {
state.active_spatial_id
};

builder.push_stacking_context(
&info,
stacking_context.bounds.origin,
spatial_id,
// TODO(gw): Make use of the WR backface visibility functionality.
/* is_backface_visible = */ true,
None,
stacking_context.transform_style,
stacking_context.mix_blend_mode,
@@ -291,7 +298,7 @@ impl WebRenderDisplayItemConverter for DisplayItem {
node.clip.complex.clone(),
None,
scroll_sensitivity,
webrender_api::LayoutVector2D::zero(),
webrender_api::units::LayoutVector2D::zero(),
);

state.clip_ids[item.node_index.to_index()] = Some(space_clip_info.clip_id);
@@ -306,7 +313,7 @@ impl WebRenderDisplayItemConverter for DisplayItem {
sticky_data.margins,
sticky_data.vertical_offset_bounds,
sticky_data.horizontal_offset_bounds,
webrender_api::LayoutVector2D::zero(),
webrender_api::units::LayoutVector2D::zero(),
);

state.spatial_ids[item.node_index.to_index()] = Some(id);
@@ -68,7 +68,7 @@ use style::properties::ComputedValues;
use style::selector_parser::RestyleDamage;
use style::servo::restyle_damage::ServoRestyleDamage;
use style::values::computed::LengthPercentageOrAuto;
use webrender_api::LayoutTransform;
use webrender_api::units::LayoutTransform;

/// This marker trait indicates that a type is a struct with `#[repr(C)]` whose first field
/// is of type `BaseFlow` or some type that also implements this trait.
@@ -65,7 +65,7 @@ use style::values::computed::{LengthPercentage, LengthPercentageOrAuto, Size, Ve
use style::values::generics::box_::{Perspective, VerticalAlignKeyword};
use style::values::generics::transform;
use style::Zero;
use webrender_api::{self, LayoutTransform};
use webrender_api::units::LayoutTransform;

// From gfxFontConstants.h in Firefox.
static FONT_SUBSCRIPT_OFFSET_RATIO: f32 = 0.20;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.