Commit graph

20062 commits

Author SHA1 Message Date
Anthony Ramine
c53db64e63 Return input as is when there is no cropping to be done 2018-10-09 14:57:04 +02:00
Anthony Ramine
2bf4fcd9bd Remove some condition in CanvasData::write_image
The surface creation should never fail.
2018-10-09 14:57:04 +02:00
Anthony Ramine
6c469b90b1 Share some code between 2D canvas and WebGL 2018-10-09 14:57:02 +02:00
Anthony Ramine
05ef233097 Add a couple of bug links 2018-10-08 13:13:24 +02:00
Anthony Ramine
551c405b0f Avoid ctx.getImageData in canvas.toDataURL 2018-10-08 12:19:10 +02:00
Anthony Ramine
77c28bdfc9 Abstract some stuff common to ctx.getImageData and ctx.putImageData 2018-10-08 11:39:09 +02:00
Anthony Ramine
e62dbabb46 Handle some transparent black cases in ctx.getImageData 2018-10-07 02:52:06 +02:00
Anthony Ramine
241dba064d Align ctx.createImageData and ctx.getImageData with the spec 2018-10-06 11:41:48 +02:00
Anthony Ramine
f13e35b2c5 Always make sure we get a surface in CanvasData::put_image_data 2018-10-06 10:53:10 +02:00
Anthony Ramine
75e6f5dfaa Avoid copying pixels in ctx.putImageData sometimes 2018-10-06 02:59:25 +02:00
Anthony Ramine
19f40cdf0b Introduce ImageData::get_rect
We use that to send only the pixels that will be actually drawn to the
canvas thread in CanvasRenderingContext2d::PutImageData.

We also make the canvas thread byte swap and premultiply colours in-place.
2018-10-06 01:12:05 +02:00
Anthony Ramine
784fbb2bc1 Merge some byte swap/premultiply functions in their own crate 2018-10-06 01:11:55 +02:00
Anthony Ramine
a2e3dd4e86 Rename byte_swap_and_premultiply to byte_swap_colors_inplace
The function did not actually premultiply.
2018-10-06 00:05:04 +02:00
Anthony Ramine
82c7d71811 Improve gl.putImageData
This commit should allow us to send smaller blobs to the canvas thread,
I made it into its own commit just to try=wpt.
2018-10-05 17:07:58 +02:00
Anthony Ramine
3d910feb3a Align canvas.putImageData with spec
The arguments are supposed to be long values, not floats.
2018-10-05 17:07:56 +02:00
Anthony Ramine
62ea3c093a Move canvas.putImageData checks to the DOM side 2018-10-05 00:35:39 +02:00
Anthony Ramine
5efbeea61c Reindent the WebGL 2 case of canvas.toDataURL 2018-10-03 10:44:36 +02:00
Anthony Ramine
cfd446218b Slightly clean up the final URL creation in canvas.toDataURL 2018-10-03 10:43:41 +02:00
Anthony Ramine
a3392610c3 Make HTMLCanvasElement::get_size return a Size2D<u32>
The changes keep trickling down.
2018-10-02 14:21:06 +02:00
Anthony Ramine
b8dbf2dddd Implement JSTraceable for Size2D<u32> 2018-10-02 14:21:06 +02:00
Anthony Ramine
426067069c Clean up ToAzurePattern for FillOrStrokeStyle 2018-10-02 14:21:06 +02:00
Anthony Ramine
435d4d9f25 Implement JSTraceable for (A, B, C, D) instead of (T, T, T, T) 2018-10-02 14:21:06 +02:00
Anthony Ramine
99b6091b7a Clean up create_webgl_context 2018-10-02 14:21:06 +02:00
bors-servo
57053e03bb
Auto merge of #21825 - jdm:backtrace-helpers, r=Manishearth
Optional backtraces for JS errors and WebGL errors

This adds two new build-time features to enable useful debugging tools when investigating why JS and WebGL content isn't working. They're optional because they're quite heavyweight.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because they're optional developer features.

<!-- 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/21825)
<!-- Reviewable:end -->
2018-10-02 06:57:38 -04:00
Josh Matthews
06bca43aee script: Optionally store backtraces when throwing DOM exceptions. 2018-10-01 16:04:56 +02:00
bors-servo
057acdca2d
Auto merge of #21828 - servo:jdm-patch-36, r=nox
Warn when using slow WebGL code path.

This will make it more obvious when one source of WebGL performance problems is present.

<!-- 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/21828)
<!-- Reviewable:end -->
2018-10-01 09:26:19 -04:00
Josh Matthews
26e1001efd
Remove trailing whitespace. 2018-10-01 13:32:34 +02:00
Josh Matthews
5dc80dd07a webgl: Add feature to store backtraces for each WebGL API call for easier debugging. 2018-10-01 10:43:13 +02:00
bors-servo
4413290de1
Auto merge of #21713 - mandreyel:track-focused-browsing-context, r=cbrewster
Update Constellation to track focused BrowsingContext instead of Pipeline

<!-- Please describe your changes on the following line: -->
I need confirmation as to whether I understand this correctly, but I don't think tracking the focused browsing context instead of the pipeline introduces the benefits described in the issue, because if the focused browsing context is an iframe nested in a document that is being changed, we need to change focus to the browsing context whose current document is being changed, i.e. above the currently focused iframe. Is this correct?

However, I think we may be able to save the slightly expensive iteration over a frame tree (which is needed to check if the currently focused browsing context is nested within the one where the page is being loaded) when the [EDIT] focused browsing is the top-level browsing context, as in this case the load doesn't change the focus. I haven't implemented this as I'm unsure whether this is correct.

---
<!-- 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
- [x] These changes fix #15507 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because because no new behaviour was introduced.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/21713)
<!-- Reviewable:end -->
2018-09-30 17:48:04 -04:00
bors-servo
97e3c5f3a9
Auto merge of #21608 - pyfisch:border-gradients, r=emilio
Improve border images

Respect CSS border-image-width.
Properly support gradients as a border-image-source.

Add a new test and mark two more as passing.

<!-- 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/21608)
<!-- Reviewable:end -->
2018-09-28 16:36:53 -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
mandreyel
dab49a217f Update Constellation to track focused BrowsingContext instead of Pipeline 2018-09-28 15:01:21 +02:00
Josh Matthews
e5892989ca
Warn when using slow WebGL code path. 2018-09-27 18:44:02 -04:00
bors-servo
9ee8890a72
Auto merge of #21506 - ferjm:webaudio.wpts, r=Manishearth
Fix some WebAudio WPTs

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] There are tests for these changes

<!-- 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/21506)
<!-- Reviewable:end -->
2018-09-25 13:21:37 -04:00
bors-servo
81fe52bd9a
Auto merge of #21757 - ferjm:offlineaudiocontext.constructor, r=jdm
Check constraints in both overloaded OfflineAudioContext constructors

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] There are WPTs tests for these changes and this should fix the remaining OfflineAudioContext failures.

<!-- 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/21757)
<!-- Reviewable:end -->
2018-09-25 12:02:36 -04:00
Fernando Jiménez Moreno
bc6586a9d0 Throw if time given to AudioScheduledSourceNode.stop is negative 2018-09-25 17:16:17 +02:00
Fernando Jiménez Moreno
bbc3565900 Use buffer_set flag for AudioBufferSourceNode buffer setter 2018-09-25 17:16:17 +02:00
Paul Rouget
95d660e077 jni-rs update 2018-09-24 16:24:50 +08:00
bors-servo
647796ede6
Auto merge of #21784 - servo:jdm-patch-33, r=nox
Use standard buffer format for DEPTH_STENCIL

This makes the Going Home title display for me on my Pixel 2.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #21763
- [x] There are tests for these changes

<!-- 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/21784)
<!-- Reviewable:end -->
2018-09-23 06:38:27 -04:00
bors-servo
196bec2b87
Auto merge of #21789 - mbrubeck:deps, r=nox
Upgrade to uluru 0.3

- [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/21789)
<!-- Reviewable:end -->
2018-09-23 05:32:17 -04:00
Matt Brubeck
7f4efd4b71 Upgrade to uluru 0.3 2018-09-22 17:24:47 -07:00
bors-servo
d2a79b39c5
Auto merge of #21787 - emilio:gecko-sync, r=emilio
style: Sync changes from mozilla-central.

See each individual commit for details.

https://bugzilla.mozilla.org/show_bug.cgi?id=1493435

<!-- 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/21787)
<!-- Reviewable:end -->
2018-09-22 15:11:25 -04:00
Emilio Cobos Álvarez
1954a0a1a1
Partially revert #21746.
This reverts the relevant bits from #21746 so that style and dependencies can
build with stable.

This is important because:

 * `selectors` is a published crate.

 * Gecko compiles with stable (more or less).

I reviewed that PR under the assumption that the union feature was stable, since
untagged unions are stable since 1.19, but turns out that smallvec uses non-Copy
types in unions, which are still unstable.

This leaves the union feature used on Servo, so that it gets testing, taking
advantage of features being additive.
2018-09-22 18:51:42 +02:00
Boris Chiou
e5f8155d6c
style: Flip boolean half way for path interpolation.
According to the new svg 2 spec update (#543), we flip the flag half way for
path interpolation.

Differential Revision: https://phabricator.services.mozilla.com/D6192
2018-09-22 17:54:03 +02:00
Brad Werth
b55bfc49fb
style: Provide a specialized parse_method for mask-image to use CORS.
Differential Revision: https://phabricator.services.mozilla.com/D5714
2018-09-22 17:53:49 +02:00
Emilio Cobos Álvarez
3c6be59d22
style: Back out bug 1481866.
The behavior the WG proposed is way more subtle than what that bug implements,
including:

 * Implementing two logical overflow longhands.
 * Expanding the overflow shorthand to different longhands depending on the
   syntax of that.

Meanwhile, Blink hasn't done the swap and will ship the same behavior that we
shipped in Firefox 61 (bug 1453148), that is, overflow-x, then overflow-y.

So I think lacking a clear way forward we should revert this change and preserve
our shipped behavior.

Differential Revision: https://phabricator.services.mozilla.com/D6317
2018-09-22 17:53:26 +02:00
Xidorn Quan
0bcffa7094
style: Merge the two scrollbar color properties into scrollbar-color.
Differential Revision: https://phabricator.services.mozilla.com/D6115
2018-09-22 17:53:15 +02:00
Jonathan Kew
5c66290142
style: Use nsAtom instead of nsString for FontFamilyName.
Bug: 1490997
Reviewed-by: lsalzman
2018-09-22 17:52:38 +02:00
Josh Matthews
2ea6e9c813
webgl: Use standard texture format for WebGL-specific DEPTH_STENCIL format. 2018-09-21 18:40:49 -04:00
Josh Matthews
46f4b18722
webgl: Restore active texture if it's changed while deleting a texture. 2018-09-21 15:22:12 -04:00