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

Sync changes from mozilla-central gfx/wr #3861

Merged
merged 4 commits into from Feb 18, 2020
@@ -4778,14 +4778,25 @@ impl PicturePrimitive {
};

let local_points = [
transform.transform_point3d(poly.points[0].cast()).unwrap(),
transform.transform_point3d(poly.points[1].cast()).unwrap(),
transform.transform_point3d(poly.points[2].cast()).unwrap(),
transform.transform_point3d(poly.points[3].cast()).unwrap(),
transform.transform_point3d(poly.points[0].cast()),
transform.transform_point3d(poly.points[1].cast()),
transform.transform_point3d(poly.points[2].cast()),
transform.transform_point3d(poly.points[3].cast()),
];

// If any of the points are un-transformable, just drop this
// plane from drawing.
if local_points.iter().any(|p| p.is_none()) {
continue;
}

let p0 = local_points[0].unwrap();
let p1 = local_points[1].unwrap();
let p2 = local_points[2].unwrap();
let p3 = local_points[3].unwrap();
let gpu_blocks = [
[local_points[0].x, local_points[0].y, local_points[1].x, local_points[1].y].into(),
[local_points[2].x, local_points[2].y, local_points[3].x, local_points[3].y].into(),
[p0.x, p0.y, p1.x, p1.y].into(),
[p2.x, p2.y, p3.x, p3.y].into(),
];
let gpu_handle = gpu_cache.push_per_frame_blocks(&gpu_blocks);
let gpu_address = gpu_cache.get_address(&gpu_handle);
@@ -514,8 +514,8 @@ impl Document {
FrameMsg::UpdateDynamicProperties(property_bindings) => {
self.dynamic_properties.set_properties(property_bindings);
}
FrameMsg::AppendDynamicProperties(property_bindings) => {
self.dynamic_properties.add_properties(property_bindings);
FrameMsg::AppendDynamicTransformProperties(property_bindings) => {
self.dynamic_properties.add_transforms(property_bindings);
}
FrameMsg::SetPinchZoom(factor) => {
if self.view.pinch_zoom_factor != factor.get() {
@@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use api::{BuiltDisplayList, DisplayItemCache, ColorF, DynamicProperties, Epoch, FontRenderMode};
use api::{PipelineId, PropertyBinding, PropertyBindingId, MixBlendMode, StackingContext};
use api::{PipelineId, PropertyBinding, PropertyBindingId, PropertyValue, MixBlendMode, StackingContext};
use api::units::*;
use crate::composite::CompositorKind;
use crate::clip::{ClipStore, ClipDataStore};
@@ -42,13 +42,12 @@ impl SceneProperties {
}

/// Add to the current property list for this display list.
pub fn add_properties(&mut self, properties: DynamicProperties) {
pub fn add_transforms(&mut self, transforms: Vec<PropertyValue<LayoutTransform>>) {
let mut pending_properties = self.pending_properties
.take()
.unwrap_or_default();

pending_properties.transforms.extend(properties.transforms);
pending_properties.floats.extend(properties.floats);
pending_properties.transforms.extend(transforms);

self.pending_properties = Some(pending_properties);
}
@@ -383,8 +383,8 @@ impl Transaction {
/// resolve bindings in the current display list. This is a convenience method
/// so the caller doesn't have to figure out all the dynamic properties before
/// setting them on the transaction but can do them incrementally.
pub fn append_dynamic_properties(&mut self, properties: DynamicProperties) {
self.frame_ops.push(FrameMsg::AppendDynamicProperties(properties));
pub fn append_dynamic_transform_properties(&mut self, transforms: Vec<PropertyValue<LayoutTransform>>) {
self.frame_ops.push(FrameMsg::AppendDynamicTransformProperties(transforms));
}

/// Consumes this object and just returns the frame ops.
@@ -862,7 +862,7 @@ pub enum FrameMsg {
///
UpdateDynamicProperties(DynamicProperties),
///
AppendDynamicProperties(DynamicProperties),
AppendDynamicTransformProperties(Vec<PropertyValue<LayoutTransform>>),
///
SetPinchZoom(ZoomFactor),
///
@@ -894,7 +894,7 @@ impl fmt::Debug for FrameMsg {
FrameMsg::ScrollNodeWithId(..) => "FrameMsg::ScrollNodeWithId",
FrameMsg::GetScrollNodeState(..) => "FrameMsg::GetScrollNodeState",
FrameMsg::UpdateDynamicProperties(..) => "FrameMsg::UpdateDynamicProperties",
FrameMsg::AppendDynamicProperties(..) => "FrameMsg::AppendDynamicProperties",
FrameMsg::AppendDynamicTransformProperties(..) => "FrameMsg::AppendDynamicTransformProperties",
FrameMsg::SetPinchZoom(..) => "FrameMsg::SetPinchZoom",
FrameMsg::SetIsTransformAsyncZooming(..) => "FrameMsg::SetIsTransformAsyncZooming",
})
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.