Commit graph

19854 commits

Author SHA1 Message Date
kingdido999
951bda3600 Format hashglobe #21373 2018-09-09 10:14:36 +08:00
kingdido999
2c9e32a09e Format gfx_traits #21373 2018-09-09 10:11:08 +08:00
bors-servo
9c1c58a498
Auto merge of #21643 - servo:webgl, r=jdm
Reuse the input vector in more cases of rgba8_image_to_tex_image_data

<!-- 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/21643)
<!-- Reviewable:end -->
2018-09-08 13:18:08 -04:00
Anthony Ramine
74e6f40abe Reuse the input vector in more cases of rgba8_image_to_tex_image_data 2018-09-08 18:21:45 +02:00
Anthony Ramine
6a692228fc Fix the ALPHA/FLOAT case of rgba8_image_to_tex_image_data
I'm pretty sure this is supposed to write the ALPHA component.
2018-09-08 18:06:51 +02:00
bors-servo
5929086c36
Auto merge of #21641 - servo:webgl, r=jdm
Some drive-by perf improvements on the WebGL stack

This avoids a bunch of pointless buffer and texture copies, but is far from eliminating all which could be eliminated.

<!-- 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/21641)
<!-- Reviewable:end -->
2018-09-08 10:33:21 -04:00
Anthony Ramine
e192e4d97f Reuse input of rgba8_image_to_tex_image_data in some cases 2018-09-08 13:42:07 +02:00
Anthony Ramine
27951bb7c8 Make rgba8_image_to_tex_image_data not overallocate in some case 2018-09-08 13:42:07 +02:00
Anthony Ramine
145086e150 Make rgba8_image_to_tex_image_data a free-standing function 2018-09-08 13:42:06 +02:00
Anthony Ramine
a5f9d03229 Make remove_premultiplied_alpha mutate its input 2018-09-08 13:42:06 +02:00
Anthony Ramine
1864edbb36 Make premultiply_pixels mutate its input 2018-09-08 13:42:06 +02:00
Anthony Ramine
4bd8efa49e Use byte channels to send textures to the WebGL thread 2018-09-08 13:42:06 +02:00
Anthony Ramine
408e540c55 Use ipc::bytes_channel in ReadPixels 2018-09-08 13:42:06 +02:00
Anthony Ramine
4e9281dcbf Simplify WebGLRenderingContext::get_image_data 2018-09-08 13:42:06 +02:00
kingdido999
c0da829e33 Reorder gfx lib creates 2018-09-08 14:24:56 +08:00
kingdido999
3a3c4b8c8e Format the rest of gfx #21373 2018-09-08 08:05:42 +08:00
bors-servo
f7630dad87
Auto merge of #21630 - kingdido999:master, r=jdm
Format gfx text #21373

```bash
rustfmt $(find components/gfx/text -type f -name "*.rs")
```

<!-- 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/21630)
<!-- Reviewable:end -->
2018-09-07 11:20:11 -04:00
chansuke
25bc998f17 Format component of style_derive 2018-09-07 22:18:51 +09:00
bors-servo
51283cf77a
Auto merge of #21634 - servo:webgl, r=emilio
Use a bytes channel in BufferData

<!-- 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/21634)
<!-- Reviewable:end -->
2018-09-07 06:23:12 -04:00
Anthony Ramine
9f924013bc Use a bytes channel in BufferData
This means we don't need to copy the input ArrayBuffer at all on the DOM side.
2018-09-07 11:28:59 +02:00
Anthony Ramine
e37856a855 Remove Clone impl for WebGLMsg 2018-09-07 11:28:45 +02:00
Anthony Ramine
1293692ef8 Simplify WebGLBuffer::buffer_data
There is no need to pass the target to that buffer method, given the buffer
has been retrieved by looking up the one bound to that target in the context.
2018-09-07 11:28:11 +02:00
kingdido999
aa4a8eb88d Format gfx text #21373 2018-09-07 10:49:07 +08:00
bors-servo
41a6c0cc39
Auto merge of #21610 - kingdido999:master, r=jdm
Format gfx platform #21373

```bash
rustfmt $(find components/gfx/platform -type f -name "*.rs")
```

<!-- 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/21610)
<!-- Reviewable:end -->
2018-09-06 20:56:50 -04:00
bors-servo
1343c7de50
Auto merge of #21560 - JacksonCoder:chunk-file, r=jdm
Read file URL in chunks

<!-- Please describe your changes on the following line: -->
This is a very straightforward PR: essentially, I replaced a `read_to_end` call that occurs when processing a file URL fetch with a loop that reads the file in chunks (with a `FILE_CHUNK_SIZE` constant that specifies the chunk size, which I've put at 32KB), and then calls `target.process_response_chunk` to process the chunk. The chunk is then appended to the fetch result, and once the end of the file is reached, the result is returned.

---
<!-- 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 #21466.

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because there isn't really a way to observe this.

<!-- 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/21560)
<!-- Reviewable:end -->
2018-09-06 19:52:16 -04:00
Jackson Lewis
430ba86668 Tidy things up 2018-09-06 16:09:35 -07:00
Anthony Ramine
5a206d5137 Make validate_framebuffer return a WebGLResult<()> 2018-09-06 11:25:22 +02:00
Anthony Ramine
0579fbe4fa Use WebGLResult for returns of instanced draw methods 2018-09-06 10:41:58 +02:00
bors-servo
af777fcf15
Auto merge of #21623 - emilio:gecko-sync, r=emilio
style: Sync changes from mozilla-central.

See each commit for details.

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

<!-- 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/21623)
<!-- Reviewable:end -->
2018-09-05 16:32:19 -04:00
Emilio Cobos Álvarez
6dcf9b7630
style: Use decomposition to interpolate matched perspective transform operations.
Looks like this produces sensible results for interpolation with 0, though I'm
not really convinced about the results from, let's say, 1px to 2000px in the
attached test-case, I would've expected a linear interpolation from that to go
through normal length interpolation.

css-transforms-1 says:

  > Two transform functions with the same name and the same number of arguments
  > are interpolated numerically without a former conversion. The calculated
  > value will be of the same transform function type with the same number of
  > arguments.
  >
  > Special rules apply to <matrix()>.

Which is what we do... I was going to file a spec issue but turns out that it's
already addressed in css-transforms-2:

  https://drafts.csswg.org/css-transforms-2/#interpolation-of-transform-functions

Which says:

  > The transform functions <matrix()>, matrix3d() and perspective() get
  > converted into 4x4 matrices first and interpolated as defined in section
  > Interpolation of Matrices afterwards.

Differential Revision: https://phabricator.services.mozilla.com/D4942
2018-09-05 19:11:26 +02:00
Emilio Cobos Álvarez
3e0250ae61
style: Only no-op visited <-> unvisited changes.
Other changes should really be (and are) indistinguishable.

Differential Revision: https://phabricator.services.mozilla.com/D4847
2018-09-05 19:11:18 +02:00
Boris Chiou
cf6215c85f
style: Add a pref for |clip-path:path()|.
Add a preference, layout.css.clip-path-path.enabled, for |clip-path:path()|.

Differential Revision: https://phabricator.services.mozilla.com/D4965
2018-09-05 19:11:12 +02:00
Emilio Cobos Álvarez
3f08d2cc02
style: Make the author styles disabled stuff actually disable style attribute, animations, and XBL rules.
This also removes one of my FIXMEs from when I was looking at this code.

We don't seem to have a pre-existing test for this feature, sigh. I'll try to
write one if I have cycles for it...

Note that it not applying XBL rules is a feature, given the current state of
affairs. Video controls and such are right now unusable with no styles enabled.

Differential Revision: https://phabricator.services.mozilla.com/D4795
2018-09-05 19:10:46 +02:00
Emilio Cobos Álvarez
0c0018e4d6
style: Make <svg:use> in shadow tree apply the rules from the originating tree.
Differential Revision: https://phabricator.services.mozilla.com/D4674
2018-09-05 19:10:37 +02:00
chansuke
812d4a479a Format component of url 2018-09-05 22:53:03 +09:00
kingdido999
f8d850bf38 Fix comments indentation issue in gfx platform 2018-09-05 20:34:01 +08:00
bors-servo
9070d4bc65
Auto merge of #21614 - pyfisch:layout_traits-fmt, r=nox
Rustfmt layout_traits crate

Part of #21373. This is a small PR, just one function is formatted as the layout_traits crate contains only this one trait.

<!-- 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/21614)
<!-- Reviewable:end -->
2018-09-05 07:26:29 -04:00
bors-servo
d05cebdc6b
Auto merge of #21613 - pyfisch:layout_thread-fmt, r=Manishearth
Rustfmt layout_thread crate

Part of  #21373. Checked all changes looks good. 🎉 Manually removed two optional semicolons within unsafe so that it is formatted in one line.

<!-- 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/21613)
<!-- Reviewable:end -->
2018-09-05 06:33:16 -04:00
bors-servo
4d18014241
Auto merge of #21615 - pyfisch:malloc_size_of-fmt, r=Manishearth
Rustfmt malloc_size_of & derive

Part of #21373. Formatting looks good.

<!-- 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/21615)
<!-- Reviewable:end -->
2018-09-05 04:52:26 -04:00
Pyfisch
5ba4df0441 Rustfmt malloc_size_of & derive 2018-09-05 10:32:44 +02:00
Pyfisch
7566906f34 Rustfmt layout_traits crate 2018-09-05 10:16:52 +02:00
Pyfisch
840e696ad9 Rustfmt layout_thread crate 2018-09-05 10:11:10 +02:00
kingdido999
c57c99d9f7 Format gfx platform #21373 2018-09-05 08:39:05 +08:00
Jackson Lewis
04288748ee Make file fetch asynchronous 2018-09-04 14:50:33 -07:00
bors-servo
04929fe527
Auto merge of #21603 - chansuke:format_webdriver_server, r=jdm
Format component of webdriver_sever

<!-- Please describe your changes on the following line: -->
Format `webdriver_server` with `rustfmt components/webdriver_server/*.rs`.

---
<!-- 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 #21373.
- [x] These changes do not require tests because they format the code only.

<!-- 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/21603)
<!-- Reviewable:end -->
2018-09-04 15:22:35 -04:00
bors-servo
162826d6a9
Auto merge of #21583 - AgustinCB:add-task-source-name, r=jdm
Add task source name

Refactor `CommonScriptMsg::Task` to include `TaskSourceName`.

Sorry for the delay, between doing this after work and the time I spent trying to ramp up on the project, it took me a bit longer than I expected.

Test still don't pass in local, but they fail the same way on master, so I guess it's ok.

I may have forgotten something, I refactored mostly the stuff that the compiler complained about. Please let me know if I missed anything.

I tried to dump my thought process on the commit messages, so feel free to go commit by commit to understand context.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #21527

- [ ] There are tests for these changes OR
- [x] These changes do not require tests because it's mostly refactor, no new behavior added.

<!-- 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/21583)
<!-- Reviewable:end -->
2018-09-04 14:17:33 -04:00
chansuke
511dfe8e1b Format component of webdriver_sever 2018-09-04 23:43:00 +09:00
bors-servo
02c689625b
Auto merge of #21601 - servo:descobj, r=jdm
Properly set desc.obj in CodegenRust.py (fixes #11868)

<!-- 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/21601)
<!-- Reviewable:end -->
2018-09-04 09:24:39 -04:00
Agustin Chiappe Berrini
e286fdcc53 Add the TaskSourceName to CommonScriptMsg::Task
Update QueuedTaskConversion and the TaskQueue to use it
2018-09-04 09:17:11 -04:00
bors-servo
73459d5b36
Auto merge of #21597 - chansuke:format_webvr, r=jdm
Format component of webvr #21373

<!-- Please describe your changes on the following line: -->
Formated `webvr` component with:

```
rustfmt components/webvr/*.rs
```

---
<!-- 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 part of #21373.
- [x] These changes do not require tests because they format the code only.

<!-- 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/21597)
<!-- Reviewable:end -->
2018-09-04 08:27:42 -04:00