-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #2980 - gw3583:clip-opt-3, r=kvark
Correctness and optimizations for clips in different coord systems. For clips that are in a different coordinate system, it's not generally feasible to get a correct mapping into a different coordinate system - so handle these clips in world space. For now, the world space is actually screen space. However, it is trivial to modify this so that the world space is the coordinate system that we are rasterizing this picture in. As an optimization, if we encounter a primitive that is large, and has clips from a different coord system, but no local clips, then segment it into a uniform grid. This allows large primitives that would not otherwise be segmented to opt in to segmenting, which can significantly reduce the size of the allocated clip masks for that primitive. As a further optimization, we are now able to generate a custom clip chain instance for each segment, rather than using the clip chain from the primitive. This allows us to build a more optimized clip chain, based on the segment rectangle, which can often remove redundant clips from the mask for each segment, or even determine that this segment is not affected by any clips at all. <!-- 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/2980) <!-- Reviewable:end -->
- Loading branch information
Showing
12 changed files
with
303 additions
and
197 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
root: | ||
items: | ||
- | ||
bounds: [100, 146, 150, 107] | ||
type: rect | ||
color: 0 128 0 1.0000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
root: | ||
items: | ||
- | ||
type: clip | ||
bounds: [0, 0, 2000, 2000] | ||
clip-rect: [0, 0, 2000, 2000] | ||
items: | ||
- | ||
bounds: [100, 0, 150, 150] | ||
type: "stacking-context" | ||
transform: rotate-x(45) | ||
transform-origin: [0, 500] | ||
items: | ||
- | ||
bounds: [0, 0, 150, 150] | ||
type: rect | ||
color: 0 128 0 1.0000 |