Commit graph

25 commits

Author SHA1 Message Date
Pyfisch
9e92eb205a Reorder imports 2018-11-06 22:35:07 +01:00
Simon Sapin
76e59a46d3 Sort use statements 2018-11-06 15:26:02 +01:00
Simon Sapin
45f7199eee cargo fix --edition 2018-11-06 15:26:02 +01:00
Pyfisch
d9b1950d74 Layout: Remove redundant deny unsafe and format
Add license to two files.

Bypass DisplayListBuilder for some items.
2018-10-22 16:15:48 +02:00
Pyfisch
2ff330a5c9 Split layout/background.rs file
Have background, border and gradient modules
for calculation functions.
Use shorter names for functions that are qualified
by the module name like `border::radii`.

Use push_item and push_iter to add items to WebRender.
2018-10-22 16:15:46 +02:00
Emilio Cobos Álvarez
856886c40d
Fix Servo build. 2018-10-19 01:01:27 +02:00
Josh Matthews
171469c27c Update webrender to 923ee495bd9b0fda8a4a94c5a6cf42e2f0548731. 2018-10-09 18:23:19 -04:00
Pyfisch
60d0c8cd76 Layout: stylistic changes
Additionally if an image border can't be displayed show solid border.
Introduce build_display_list_for_border_image to display border images.
2018-09-28 22:33:02 +02:00
Pyfisch
fabb70f874 Improve border images
Respect CSS border-image-width.
Properly support gradients as a border-image-source.
Only emit a border item if the border-width is non-zero
for simple borders but still emit one if the item is
an image as paint worklet that are not drawn cause servo
to hang and fail tests.

Add a new test and mark 4 more as passing.
2018-09-15 09:48:03 +02:00
Pyfisch
349047b096 Rustfmt layout crate 2018-09-01 13:24:57 +02:00
Pyfisch
9e971f9d8f Replace Servo DL items with WR ones
The Servo internal display list items are already pretty much
equivalent to the WebRender ones. Except that Servo items contain
base information and associated glyphs and gradient stops which are
stored implicitly in WebRender. Remove the display items for
rectangles, text, images, border, gradients and box shadow and
replace them with their WebRender counter parts.
2018-08-06 19:47:00 +02:00
Emilio Cobos Álvarez
083857a4b0
Fix Servo build. 2018-06-18 20:01:48 +02:00
Emilio Cobos Álvarez
bbb59614fa
Fix Servo build. 2018-05-28 16:02:31 +02:00
bors-servo
ea214e9bc3
Auto merge of #20752 - pyfisch:backgrounds42, r=emilio
Fix crash in DL building

Fix one crash and some style changes.

This HTML crashed servo before. Key parts are `background-clip: content-box` and `direction: rtl`

```html
<!DOCTYPE html>
<html>
    <style>
        #span1 {
            background-clip: content-box;
        }
        #span2
        {
            direction: rtl;
        }
    </style>
    <span id="span1">Filler Text <span id="span2">txeT relliF</span></span>
</html>
```
Should I add this as a test? And where do I put this "does-it-crash?" test?

I find always passing rectangles by value a lot easier as it avoids many references and dereferences and I assume that the compiler will always use the faster one either way. If you don't like the change feel free to only merge the first commit.

<!-- 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/20752)
<!-- Reviewable:end -->
2018-05-19 11:02:01 -04:00
Pyfisch
ee38fd6f0a Rustfmt components/layout/display_list/ 2018-05-05 22:19:03 +02:00
Pyfisch
4b3ccc7c8c Pass Rect<Au> by value and not by reference
Style change in display_list/builder.rs to reduce
the number of & and * found in the code.
Rect<Au> are basically 4 integers so there is no
need to pass by reference.
2018-05-05 22:16:23 +02:00
Anthony Ramine
0f91712800 Update to gleam 0.5 2018-05-05 13:08:36 +02:00
Pyfisch
7eff53e250 Implement border-image-outset
Add an automatic test for border-image-outset with a gradient.
Convert two tests from UTF-8 LE with CRLF line endings to
UTF-8 with LF endings as the old files could not be viewed with servo.

Closes #16638
2018-05-02 22:11:38 +02:00
Pyfisch
c0be925bed Move DL items from gfx to layout
Implement corner clipping.
Remove PixelFormat from WebrenderImageInfo.
Use WebRender text shadow.
Remove MallocSizeOf and Deserialize for DL items.

Closes #19649, #19680, #19802
2018-04-22 13:13:45 +02:00
Pyfisch
0d0f2abf12 Move calculation functions out of builder.rs 2018-02-24 10:56:11 +01:00
Pyfisch
8d061118c4 Remove now unnecessary fix_gradient_stops function
Webrender solved the issue with servo/webrender#1189.
2018-02-24 10:36:10 +01:00
Mauricio Collares
8e411105ce
style: Rename background::RepeatKeyword and border::RepeatKeyword. 2018-02-01 15:23:41 +01:00
Pyfisch
8c7c5f6e79 Use more WebRender types in gfx/display_list
This uses floating-point (Layout) coordinates in where possible.
Replace NormalBorder struct with WebRender equivalent.
Remove ToPointF and ToRectF traits.
Convert border RepeatKeyword with ToLayout.
Add some definitions to malloc_size_of for WebRender types.
2018-01-17 23:29:57 +01:00
Pyfisch
246b54507a Use the new WebRender conversion functions.
Remove the old ones.
2018-01-07 22:53:51 +01:00
Pyfisch
ea062e6e47 Create own file for background calculations in layout
Move display_list_builder.rs and webrender_helpers.rs
along with the new file to components/layout/display_list/

Remove apparently unused IdType enum.
Only variant used was OverflowClip.

See #19676
2018-01-06 20:19:32 +01:00