diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-06-09 16:32:54 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-06-09 16:32:54 -0600 |
commit | 8236221acf0f23f2217bf8b2346411396bd04f3c (patch) | |
tree | 7c075f5890d4e74e074e334dad322191fdead8f4 /components/layout/display_list_builder.rs | |
parent | 0dec64caf01c98d10e72b73e35b994127c23e81f (diff) | |
parent | 6dd082278d2d627f9d088c14dfd635990ff3183b (diff) | |
download | servo-8236221acf0f23f2217bf8b2346411396bd04f3c.tar.gz servo-8236221acf0f23f2217bf8b2346411396bd04f3c.zip |
Auto merge of #6280 - glennw:transform-transitions, r=nox
Also tidy up some of the ComputedMatrix code.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6280)
<!-- Reviewable:end -->
Diffstat (limited to 'components/layout/display_list_builder.rs')
-rw-r--r-- | components/layout/display_list_builder.rs | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index f2cf382a23a..5491e9d0bc6 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -1163,16 +1163,13 @@ impl FragmentDisplayListBuilding for Fragment { let matrix = match operation { &transform::ComputedOperation::Rotate(ax, ay, az, theta) => { let theta = f32::consts::PI_2 - theta.radians(); - let transform = Matrix4::create_rotation(ax, ay, az, theta); - pre_transform.mul(&transform).mul(&post_transform) + Matrix4::create_rotation(ax, ay, az, theta) } &transform::ComputedOperation::Perspective(d) => { - let transform = Matrix4::create_perspective(d.to_f32_px()); - pre_transform.mul(&transform).mul(&post_transform) + Matrix4::create_perspective(d.to_f32_px()) } &transform::ComputedOperation::Scale(sx, sy, sz) => { - let transform = Matrix4::create_scale(sx, sy, sz); - pre_transform.mul(&transform).mul(&post_transform) + Matrix4::create_scale(sx, sy, sz) } &transform::ComputedOperation::Translate(tx, ty, tz) => { let tx = tx.to_au(border_box.size.width).to_f32_px(); @@ -1181,17 +1178,17 @@ impl FragmentDisplayListBuilding for Fragment { Matrix4::create_translation(tx, ty, tz) } &transform::ComputedOperation::Matrix(m) => { - let transform = m.to_gfx_matrix(&border_box.size); - pre_transform.mul(&transform).mul(&post_transform) + m.to_gfx_matrix() } &transform::ComputedOperation::Skew(sx, sy) => { - let transform = Matrix4::create_skew(sx, sy); - pre_transform.mul(&transform).mul(&post_transform) + Matrix4::create_skew(sx, sy) } }; transform = transform.mul(&matrix); } + + transform = pre_transform.mul(&transform).mul(&post_transform); } // FIXME(pcwalton): Is this vertical-writing-direction-safe? |