Commit graph

76 commits

Author SHA1 Message Date
bors-servo
3f1ae64255 Auto merge of #16666 - pyfisch:gradients, r=emilio
Improvements to gradients.

This is a collection of commits improving the rendering of linear and radial gradients by making them conform more closely to the spec.

All commits are are independent and should work without the others.

These commits address the following issues:
* a956e3fd52 resolves #3908 but contains also some other necessary changes to `convert_gradient_stops`. The updated function has a few more copys but should be more correct. Maybe @pcwalton wants to comment since he has originally written the code.
* b230be8aaf partially solves #16638. (Partially because `border-image-outset` is not implemented. This is an older issue for border gradients: #15894.

To quickly catch regressions and see changes to gradients I have created [a set of twelve manual testcases](https://pyfisch.org/stuff/testcases-gradients.html) and placed them in a single file. Attached are two files. One shows how the gradients were rendered before the PR the other one with the changes applied.

![testcases-old](b433278e-2e7d-11e7-9396-500fef12eee0.png)
![testcases-new](b43222c6-2e7d-11e7-99ab-c0a2709baf41.png)

r? @emilio
and maybe also @jdm?

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16666)
<!-- Reviewable:end -->
2017-05-07 07:56:51 -05:00
Martin Robinson
83ac0a8505 Rename PushScrollRoot and remove PopScrollRoot
PopScrollRoot was unused and PushScrollRoot no longer pushes a scroll
root, but defines a new one.
2017-05-05 09:02:24 +02:00
Alexis Beingessner
db02979c4f Update to use webrender bincode IPC 2017-05-03 12:37:20 -04:00
Pyfisch
b230be8aaf Implement radial gradients for borders.
The property border-image-outset is not yet implemented.
Note: Also support repeating-linear-gradients for borders.
2017-04-30 22:36:45 +02:00
Pyfisch
1c4ae53a88 Pass repeating gradients to webrender. 2017-04-27 22:07:31 +02:00
Pyfisch
f4bad2d920 Partially implement radial gradients.
Missing: repeating radial gradients and keyword sizes.
2017-04-27 22:07:31 +02:00
Glenn Watson
c879584a19 Update WR (new groove/ridge border path, mix-blend-mode optimizations)
A few other minor additions too.
2017-04-26 14:34:07 +10:00
Glenn Watson
c4b1033b17 Update WR (improved double border quality, minor API changes). 2017-04-21 11:33:40 +10:00
Martin Robinson
d150cc9f95 Eliminate ScrollRootId
Just use WebRender's ClipId directly. This will allow us to create and
use ReferenceFrames in the future, if we need to do that. It will also
make it easier to have Servo responsible for creating the root
scrolling area, which will allow removing some old hacks in the future.
2017-04-20 08:51:38 +02:00
Martin Robinson
4451b8a771 Used shared clips for overflow:hidden and CSS clip
Instead of passing down a complex clipping region to each item, used
shared clipping to handle overflow:hidden and CSS clips. In addition to
being more efficient, this should also fix quite a few issues related
to absolutely positioned elements.

One existing reftest is slightly modified to avoid tickling a quirk
with the way that WebRender rasterizes masks. We are working out how to
best express these combined masks with the API or need to. The change
does not affect the original subject of the reftest.

Fixes #13109.
Fixes #10151.
Fixes #7575.
Fixes #8074.
Fixes #8780.
2017-04-17 17:06:43 +02:00
Glenn Watson
2cdd82f78e Update WR (new border code path).
This includes the new border code path for simple (solid) borders.
This gives much higher quality border rendering, including proper
support for elliptical border segments.

The quality on https://github.com/servo/servo is noticeably improved.
2017-04-13 16:41:43 +10:00
Glenn Watson
9e874f50ae Update WR (gradients, batching, text run, border changes).
- Tidy and optimize the batching code.
- Support tiling / repeat for linear and radial gradients.
- Fix some edge cases of subpixel text AA.
- Add clip mask support to border shaders.
- Optimization to text run creation on CPU.
- Handle more box-shadow clipping cases.
- Fix a panic that could occur when window size is 0.
- Clip / scroll API improvements.
2017-04-12 13:29:03 +10:00
Martin Robinson
0353aad4e3 Use real clips when generating scroll roots
This is the first step toward removing inherited clips in favor of
scroll roots for handling overflow and CSS clipping. This will allow us
to more easily handle elements that should not be clipped. While we are
still using inherited clips here, we now properly clip some types of
content that wasn't clipped before.
2017-04-06 14:46:02 +02:00
Glenn Watson
2fceb6e009 Update WR (more border fast paths, clip interface changes). 2017-04-05 10:50:06 +10:00
Martin Robinson
39600f9f4e Update to support new clipping coordinates change 2017-04-05 10:45:31 +10:00
Glenn Watson
aea7d46b91 Update WR (gradient features). 2017-04-05 05:40:29 +10:00
Glenn Watson
6dd3bc29e1 Update WR (various optimizations, gradient improvements). 2017-04-03 06:48:27 +10:00
Emilio Cobos Álvarez
fc72f096a0
style: Properly track whether <angle> or <time> values came from calc() expressions. 2017-03-27 12:42:22 +02:00
bors-servo
3b79bc2582 Auto merge of #16113 - glennw:update-wr-opaque-opt, r=mrobinson
Update WR (opaque rect optimization, stacking context culling).

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16113)
<!-- Reviewable:end -->
2017-03-26 14:04:07 -07:00
Glenn Watson
3ca0f8a9ac Update WR (opaque rect optimization, stacking context culling).
Correct viewport test references

These references were using an incorrect value for the expected
container width. Now that WebRender is no longer clipping to stacking
context boundaries the rendered width is correct (100% of viewport
width = 240px).
2017-03-27 06:14:34 +10:00
bors-servo
fd8127b23b Auto merge of #15905 - mephisto41:add-border-gradient, r=emilio
Add gradient border support.

webrender add gradient border support in https://github.com/servo/webrender/pull/953. This pr add support in servo.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [X] These changes do not require tests because it should be covered by wpt

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15905)
<!-- Reviewable:end -->
2017-03-26 02:29:16 -07:00
Martin Robinson
9d72e89ce3 Stop splitting scroll roots
Now that WebRender can handle splitting scrolling layers on its own, we
don't need to do any work to split up scroll roots. This should also
make it possible to handle overflow:scroll and containing block scroll
roots in the future.
2017-03-21 16:42:31 -07:00
Morris Tseng
02c675204a Add gradient border support. 2017-03-13 17:00:26 +08:00
Glenn Watson
ce49bc5f89 Update WR (scroll root changes, border gradients, yuv updates). 2017-03-09 16:01:47 +10:00
Glenn Watson
034feafa8c Update WR (types updates, stacking context culling) 2017-03-09 10:32:40 +10:00
Glenn Watson
750794eb77 Update WR (reference frames for fixed position elements). 2017-03-03 10:33:52 +10:00
Glenn Watson
ffcb319324 Add support for most of the border-image properties, pass to WR.
This adds support for:
 * border-image (images, not gradients yet)
 * border-image-source
 * border-image-slice
 * border-image-repeat (stretch + repeat only for now)

Remaining work:
 * Connect border-image-outset (WR supports this).
 * border-image-width
2017-02-23 14:15:20 +10:00
Glenn Watson
c4a972aa7b Update WR (inset box shadow fix, border-image support).
I have a follow up PR for Servo that uses the new border-image
APIs, but I'll land that separately, so that we don't delay
landing the WR update itself.
2017-02-22 16:12:21 +10:00
Glenn Watson
cbe7f09f81 Update WR (pixel snapping improvements).
This includes a WR update that improves pixel snapping. Specifically,
the non-transform shader now snaps to device pixels in world space,
rather than local space.

This makes 31 new tests pass, and adds 4 new failures.

Of the new failures:
 - The three background size tests appear to be an OSMesa accuracy
   issue. Near the bottom of the image, a small number of pixels
   are different from the reference by a value of 1.0 / 255.0. I've
   confirmed on 3 real GPUs and also on llvmpipe that the tests
   match on those devices. This would be a good case for fuzzy test
   support in WPT.
 - The other failing test appears to have unreasonable accuracy
   requirements as it also fails on Gecko and Chromium in the same
   way that the test now fails on WR.
2017-02-13 23:46:28 +01:00
Glenn Watson
f1558b1c7b Update WR.
- Subpixel positioning improvements.
- Clipping fixes and optimizations.
- Fix panic when transform can't be inverted.
- Support multiple filters on single stacking context.
- Optimize gradients, support unlimited stops.
- Add external image + texture cache support.
- Support error path on shader compile error.
- Optimize border handling in texture atlas.
- Preliminary work towards clip/scroll root changes.
2017-02-07 17:19:16 +10:00
Anthony Ramine
db3e5be878 Update core-foundation-sys to 0.3 2017-02-07 14:35:30 +10:00
Glenn Watson
4cbefe82b5 Update WR (radial gradients, subpixel positioning, tiling changes). 2017-02-01 05:40:44 +10:00
Ms2ger
5d2a68033a Replace gfx_traits::ScrollPolicy by webrender_traits::ScrollPolicy. 2017-01-10 09:45:53 +01:00
Glenn Watson
f517d03364 Update WR (typed units, glyph cache, various features). 2016-12-15 12:11:51 +10:00
Martin Robinson
3c1c03648b Use new DisplayListBuilder improvements in Servo
In particular, we no longer to have a WebRenderFrameBuilder. All of the
complication is now handled by the DisplayListBuilder itself.
2016-11-28 13:15:39 +01:00
Glenn Watson
3d67c1cf4c Remove old shaders, updates for WR feature and API changes. 2016-11-25 06:28:21 +10:00
Gregory
fb98acbc4d update deps
switch to using webrender_traits::ImageData

update use of webrender_traits::StackingContext in layout

use webrender_traits::channel::msg_channel in webgl ipc

fix use of resource_override_path in components/servo/lib
2016-11-22 07:46:42 +10:00
Martin Robinson
e164e87e98 Deal with changes to the WebRender API
The WebRender display list is now similar to the Servo display list,
which simplifies the conversion.
2016-11-15 08:44:13 +01:00
Martin Robinson
ef82d772c1 Don't promote all scrollable regions to stacking contexts
Instead annotate all flows with their owning ScrollRoots. When
processing the display list items into a flattened display list, we add
PushScrollRoot and PopScrollRoot to signal when scrolling regions start
and end. It is possible for content from different scrolling regions to
intersect and when they do, the stack of scrolling regions is
duplicated.  When these duplicated scrolling regions stacks reach
WebRender, it will scroll them in tandem.

The PushScrollRoot and PopScrollRoot items are currently represented as
StackingContexts in WebRender, but eventually these will be replaced
with special WebRender display items.

Fixes #13529.
Fixed #13298.
2016-11-05 18:36:45 +01:00
Ms2ger
81ee81cbb0 Remove the direct azure dependencies from gfx, layout and layout_thread.
This does not cover transitive dependencies through canvas_traits, though that
should not be too hard to solve either.
2016-11-04 12:14:42 +01:00
Glenn Watson
04cd35914a Update WR (resource cache changes, various optimizations). 2016-11-04 12:48:47 +10:00
Martin Robinson
71d285af80 Use a new id type for tracking scrolling areas
This is a step in disassociating scrolling areas from stacking
contexts. Now scroll areas are defined by unique ids, which means that
in the future stacking context will be able to contain more than one.
2016-10-30 21:10:04 +01:00
bors-servo
3c16dde1f2 Auto merge of #13902 - Wafflespeanut:keyword, r=emilio
Prefer auto-generation for some keyword props

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build-geckolib` does not report any errors

<!-- Either: -->
- [x] These changes do not require tests because it's a refactor

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

r? @Manishearth or @emilio

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13902)
<!-- Reviewable:end -->
2016-10-26 02:27:13 -05:00
Ravi Shankar
e7cbd10ece Auto-generate 'image-rendering' using 'single_keyword' 2016-10-26 12:56:11 +05:30
Glenn Watson
86eaef237b Update WR - texture layers, image mask, profiler, optimizations. 2016-10-26 12:09:27 +10:00
Martin Robinson
8a12c15582 Produce WR display lists without nested stacking contexts
WebRender now supports display lists that do not use nested stacking
contexts for overflow scroll regions. We can remove a bit of code in
Servo now.
2016-10-23 12:31:01 +02:00
Martin Robinson
ccb7ab926a Remove concept of Layers from Servo
Layers were a feature of the legacy drawing path. If we re-add them at
some point, it probably makes more sense to make them a product of
display list inspection.

This change also remove a bunch of dead painting code.
2016-10-21 08:38:34 +02:00
bors-servo
e667e62f0c Auto merge of #13820 - mrobinson:remove-nesting, r=glennw
Remove the concept of nested stacking contexts from display list builder

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they should not change behavior.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

With the removal of the legacy rendering path, we don't need to worry
about nested stacking contexts. This change just pushes the
complication to the WebRender conversion step, but a later change will
remove the concept from WebRender as well.

This also helps to prepare for the introduction of ids for particular
scrolling regions, an integral part of multiple ScrollLayers per block.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13820)
<!-- Reviewable:end -->
2016-10-19 12:54:40 -05:00
Martin Robinson
2219b14be9 Remove the concept of nested stacking contexts from display list builder
With the removal of the legacy rendering path, we don't need to worry
about nested stacking contexts. This change just pushes the
complication to the WebRender conversion step, but a later change will
remove the concept from WebRender as well.

This also helps to prepare for the introduction of ids for particular
scrolling regions, an integral part of multiple ScrollLayers per block.
2016-10-19 12:55:28 +02:00
Ms2ger
6d09843586 Remove unused DisplayItem::LayeredItem. 2016-10-18 09:36:31 +02:00