Skip to content

Commit 4052fe4

Browse files
author
bors-servo
authored
Auto merge of #1820 - glennw:xf-clip, r=kvark
Add a workaround for inner rects on transformed clips. Fixes #1814. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/1820) <!-- Reviewable:end -->
2 parents 1a21291 + 75cd1f6 commit 4052fe4

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

webrender/src/render_task.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,10 @@ impl RenderTask {
329329
}
330330

331331
match clip_info.bounds.inner {
332-
Some(ref inner) if !inner.device_rect.is_empty() => {
332+
// Inner rects aren't valid if the item is not axis-aligned, which can
333+
// be determined by the apply_rectangles field. This is mostly a band-aid
334+
// until we have better handling of inner rectangles for transformed clips.
335+
Some(ref inner) if !work_item.apply_rectangles && !inner.device_rect.is_empty() => {
333336
inner_rect = inner_rect.and_then(|r| r.intersection(&inner.device_rect));
334337
!inner.device_rect.contains_rect(&task_rect)
335338
}
Loading
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
root:
3+
items:
4+
-
5+
bounds: [18, 18, 400, 400]
6+
"clip-rect": [18, 18, 400, 400]
7+
type: clip
8+
id: 1
9+
"content-size": [400, 400]
10+
-
11+
bounds: [0, 0, 0, 0]
12+
"clip-and-scroll": 1
13+
type: "stacking-context"
14+
transform: [0.70710677, 0.70710677, 0, 0, -0.70710677, 0.70710677, 0, 0, 0, 0, 1, 0, 218, -64.84271, 0, 1]
15+
items:
16+
-
17+
bounds: [0, 0, 400, 400]
18+
"clip-rect": [0, 0, 400, 400]
19+
"clip-and-scroll": 1
20+
image: solid-color(255, 0, 0, 255, 400, 400)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
== local-clip.yaml local-clip.png
22
== rotated-clip.yaml rotated-clip.png
3+
== image-rotated-clip.yaml image-rotated-clip.png
34
# Something leaks the state: the test passes if only run `reftest reftests/transform`
45
# but fails when all the tests are run
56
fuzzy(1,1) == rotated-image.yaml rotated-image.png

0 commit comments

Comments
 (0)