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

Allow clip masks for picture tasks. #2443

Merged
merged 1 commit into from Feb 22, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Now that we draw pictures by using their local rect as a normal

primitive, we also need to apply clip masks to them, when they
are required.

For example, a picture may have a transform on it, and when it
gets drawn it needs to sample from a clip mask in this case since
the coordinate systems are not equal and the local clip rect
can not be applied in this case.

This fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1439059.
  • Loading branch information
gw3583 committed Feb 22, 2018
commit f274acab8c9a487c9a89ca355baf62304724cb8e
@@ -1722,8 +1722,8 @@ impl PrimitiveStore {
}

let (draw_text_transformed, original_reference_frame_id) = match pic.kind {
PictureKind::Image { reference_frame_id, .. } => {
may_need_clip_mask = false;
PictureKind::Image { reference_frame_id, composite_mode, .. } => {
may_need_clip_mask = composite_mode.is_some();
(true, Some(reference_frame_id))
}
PictureKind::BoxShadow { .. } |
Binary file not shown.
@@ -0,0 +1,29 @@
---
root:
items:
-
bounds: [260, 260, 231, 231]
"clip-rect": [260, 260, 231, 231]
type: border
width: 3
"border-type": normal
color: 0 0 255 1.0000
style: dashed
-
bounds: [300, 300, 0, 0]
"clip-rect": [300, 300, 0, 0]
type: "stacking-context"
transform: [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 75, -75, 1]
transform-style: preserve-3d
items:
-
type: "stacking-context"
transform: [1, 0, 0, 0, 0, 0.8660254, -0.5, 0, 0, 0.5, 0.8660254, 0, 0, 10.048096, 37.5, 1]
transform-style: preserve-3d
items:
-
bounds: [0, 0, 150, 150]
"clip-rect": [0, 0, 150, 150]
"clip-and-scroll": 0
type: rect
color: 255 255 0 0.4000
Binary file not shown.
@@ -0,0 +1,27 @@
---
root:
items:
-
bounds: [260, 260, 231, 231]
"clip-rect": [260, 260, 231, 231]
type: border
width: 3
"border-type": normal
color: 0 0 255 1.0000
style: dashed
-
bounds: [300, 300, 0, 0]
"clip-rect": [300, 300, 0, 0]
type: "stacking-context"
transform: [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 75, -75, 1]
items:
-
type: "stacking-context"
transform: [1, 0, 0, 0, 0, 0.8660254, -0.5, 0, 0, 0.5, 0.8660254, 0, 0, 10.048096, 37.5, 1]
items:
-
bounds: [0, 0, 150, 150]
"clip-rect": [0, 0, 150, 150]
"clip-and-scroll": 0
type: rect
color: 255 255 0 0.4000
@@ -14,3 +14,5 @@ fuzzy(1,11) == prim-suite.yaml prim-suite.png
zoom(4) == border-zoom.yaml border-zoom.png
fuzzy(1,520) == perspective-origin.yaml perspective-origin.png
fuzzy(1,120) == screen-space-blit.yaml screen-space-blit.png
== nested-rotate-x.yaml nested-rotate-x.png
== nested-preserve-3d.yaml nested-preserve-3d.png
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.