Commit graph

268 commits

Author SHA1 Message Date
Anthony Ramine
2f2331f149 Use a byte channel to retrieve pixels of 2D canvas 2018-09-13 22:04:30 +02:00
Anthony Ramine
b5c469d52e Merge byte swap and unmultiplying loops in ctx.getImageData() 2018-09-13 22:04:30 +02:00
Brody-Eastwood
f3065f3707 Moved Canvas rendering to a single thread. 2018-04-23 20:50:05 -04:00
Brody Eastwood
8a1590efc6 Add unique canvas IDs to all canvas operations. 2018-04-02 22:02:22 -04:00
Anthony Ramine
ce81420bef Use ByteBuf for the canvas messages
The type Vec<u8> is super unefficient to work with in Serde if all you want
to represent is a simple blob.
2018-03-26 20:48:02 +02:00
Nakul Jindal
7d4e2b11e9 Implements profiler for blocked recv 2018-03-22 11:48:27 -07:00
Alex Fong
8d09398230 Avoid Window::GetComputedStyle when checking for display: none 2018-02-26 19:07:04 +08:00
Josh Matthews
0e211d0d8f Revert "Send IPC receiver for canvas as part of CreateCanvasPaintThread message"
This reverts commit a504c9358b.
2017-12-18 10:51:00 -05:00
tigercosmos
a504c9358b Send IPC receiver for canvas as part of CreateCanvasPaintThread message 2017-12-16 12:04:59 +08:00
tigercosmos
80a81f2774 use entry global's origin in is_origin_clean check for canvas rendering 2017-12-05 15:10:55 +08:00
Nicholas Nethercote
4506f0d30c Replace all uses of the heapsize crate with malloc_size_of.
Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`.
`malloc_size_of` is better -- it handles various cases that `heapsize` does not
-- so this patch changes Servo to use `malloc_size_of`.

This patch makes the following changes to the `malloc_size_of` crate.

- Adds `MallocSizeOf` trait implementations for numerous types, some built-in
  (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`).

- Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't
  support that operation.

- For `HashSet`/`HashMap`, falls back to a computed estimate when
  `enclosing_size_of_op` isn't available.

- Adds an extern "C" `malloc_size_of` function that does the actual heap
  measurement; this is based on the same functions from the `heapsize` crate.

This patch makes the following changes elsewhere.

- Converts all the uses of `heapsize` to instead use `malloc_size_of`.

- Disables the "heapsize"/"heap_size" feature for the external crates that
  provide it.

- Removes the `HeapSizeOf` implementation from `hashglobe`.

- Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of`
  doesn't derive those types, unlike `heapsize`.
2017-10-18 22:20:37 +11:00
Simon Sapin
aa15dc269f Remove use of unstable box syntax.
http://www.robohornet.org gives a score of 101.36 on master,
and 102.68 with this PR. The latter is slightly better,
but probably within noise level.
So it looks like this PR does not affect DOM performance.

This is expected since `Box::new` is defined as:

```rust
impl<T> Box<T> {
    #[inline(always)]
    pub fn new(x: T) -> Box<T> {
        box x
    }
}
```

With inlining, it should compile to the same as box syntax.
2017-10-16 17:16:20 +02:00
Anthony Ramine
f87c2a8d76 Rename Root<T> to DomRoot<T>
In a later PR, DomRoot<T> will become a type alias of Root<Dom<T>>,
where Root<T> will be able to handle all the things that need to be
rooted that have a stable traceable address that doesn't move for the
whole lifetime of the root. Stay tuned.
2017-09-26 09:49:10 +02:00
Anthony Ramine
577370746e Rename DOMRefCell<T> to DomRefCell<T>
I don't want to do such a gratuitous rename, but with all the other types
now having "Dom" as part of their name, and especially with "DomOnceCell",
I feel like the other cell type that we already have should also follow
the convention. That argument loses weight though when we realise there
is still DOMString and other things.
2017-09-26 09:49:08 +02:00
Anthony Ramine
e2dac78d36 Rename LayoutJS<T> to LayoutDom<T> 2017-09-26 09:49:04 +02:00
Anthony Ramine
7be32fb237 Rename JS<T> to Dom<T> 2017-09-26 09:48:55 +02:00
Anthony Ramine
0e3c54c191 Rename dom::bindings::js to dom::bindings::root 2017-09-26 02:19:05 +02:00
Joone Hur
57e283aaab Implement Ellipse Canvas 2D API
* Update rust-azure to 0.21.0
* Mark the following test case as fail:
  tests/wpt/mozilla/tests/mozilla/css-paint-api/background-image-tiled.html
* Make the ellipse test case pass.

BUG: https://github.com/servo/servo/issues/17598
2017-09-01 16:04:06 -07:00
bors-servo
4743696189 Auto merge of #18179 - davidcl:master, r=jdm
Automatically verify that derive() lists are alphabetically ordered #…

<!-- Please describe your changes on the following line: -->
Automatically verify that derive() lists are alphabetically ordered #18172

---
<!-- 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 #18172 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/18179)
<!-- Reviewable:end -->
2017-08-23 17:18:31 -05:00
Clément DAVID
c5fe235112 order derivable traits lists
Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02:00
Bruno Bernardino
2af828485f
Implement CanvasRenderingContext2d.fillText's "unimplemented" message 2017-08-23 17:34:55 +01:00
Anthony Ramine
676f2c8acf Revert "Auto merge of #18114 - emilio:revert-webgl-refactor, r=nox"
This reverts commit 4d10d39e8f, reversing
changes made to ee94e2b7c0.
2017-08-16 23:23:18 +02:00
Emilio Cobos Álvarez
cfe22e3979
Revert "Auto merge of #17891 - MortimerGoro:webgl_move, r=glennw,emilio"
This reverts commit 90f55ea458, reversing
changes made to 2e60b27a21.
2017-08-16 16:42:13 +02:00
Imanol Fernandez
703962fe61 Improve WebGL architecture. 2017-08-15 22:14:32 +02:00
Paul Rouget
d241389129 make use of ScriptToConstellationChan 2017-08-15 08:22:09 +02:00
Alan Jeffrey
2318caf002 Implement drawing an image from a CSS style value into a canvas. 2017-07-21 16:39:11 -05:00
Alan Jeffrey
328fb25a65 Implemented paint worklet rendering context. 2017-06-30 16:41:08 -05:00
Simon Sapin
7af5a7fd54 Untry script 2017-06-18 13:21:49 +02:00
Glenn Watson
e7b1e041c8 Update WR (CPU text optimizations, image format renames). 2017-06-16 15:27:22 +10:00
Nicolas Silva
8617320500 Bump euclid to 0.14. 2017-06-14 16:00:59 +02:00
Josh Matthews
27ae1ef2e7 Thread ParseError return values through CSS parsing. 2017-06-09 16:46:25 -04:00
SendilKumar N
5acee23f5d Use the origin of the actual image response when determining if a canvas is origin clean. 2017-05-19 09:38:50 -04:00
n0max
49820a6797 Remove IndexSizeError in CanvasRenderingContext2D::drawImage 2017-04-29 19:27:00 +02:00
Fernando Jiménez Moreno
72d7ee613b Make image cache per-document rather than global 2017-03-27 19:54:13 +02:00
Lucjan Suski
c83ac31e71 Make ImageData::new return Fallible instead of panic 2017-03-20 21:16:55 +01:00
lucantrop
d6568e608b removed instances of -> () in existing code 2017-03-13 17:38:33 +01:00
Anthony Ramine
31e9d81c0f Make #[dom_struct] a proc_macro attribute 2017-02-24 01:50:51 +01:00
Josh Matthews
c890c9143c Make script thread initiate requests for images needed by layout.
In support of this goal, the layout thread collects information about
CSS images that are missing image data and hands it off to the script
thread after layout completes. The script thread stores a list of
nodes that will need to be reflowed after the associated network
request is complete. The script thread ensures that the nodes are
not GCed while a request is ongoing, which the layout thread is
incapable of guaranteeing.

The image cache's API has also been redesigned in support of this
work. No network requests are made by the new image cache, since it
does not possess the document-specific information necessary to
initiate them. Instead, there is now a single, synchronous
query operation that optionally reserves a slot when a cache
entry for a URL cannot be found. This reserved slot is then
the responsibility of the queryer to populate with the contents
of the network response for the URL once it is complete. Any
subsequent queries for the same URL will be informed that the
response is pending until that occurs.

The changes to layout also remove the synchronous image loading
code path, which means that reftests now test the same code
that non-test binaries execute. The decision to take a screenshot
now considers whether there are any outstanding image
requests for layout in order to avoid intermittent failures in
reftests that use CSS images.
2017-02-22 14:19:35 -05:00
Emilio Cobos Álvarez
0c102e2350
style: Unbox a bunch of color properties.
This builds on https://github.com/servo/rust-cssparser/pull/118.
2017-02-14 20:18:31 +01:00
Prudhvi Rampey
e3d8131698 Error handled canvas closing 2016-12-28 23:14:46 +05:30
Corey Farwell
449f6337d4 Rename Reflectable to DomObject.
Fixes https://github.com/servo/servo/issues/8473.
2016-12-08 08:50:35 -10:00
Emilio Cobos Álvarez
913c874cb5
Urlmageddon: Use refcounted urls more often. 2016-11-17 18:34:23 +01:00
Glenn Watson
acfdfd2fa9 Remove old rendering backend.
This removes paint threads, rust-layers dependency, and changes
optional webrender types to be required.

The use_webrender option has been removed, however I've left
the "-w" command line option in place so that wpt
runner can continue to pass that. Once it's removed from there
we can also remove the -w option.

Once this stage is complete, it should be fine to change the
display list building code to generate webrender display
lists directly and avoid the conversion step.
2016-10-18 10:21:27 +10:00
Anthony Ramine
0b3ab875f4 Remove intrinsic Root::r() 2016-10-11 19:44:32 +02:00
Anthony Ramine
d8e92bb271 Rename Reflectable::global_scope to global 2016-10-06 21:36:41 +02:00
Anthony Ramine
a8c05c6962 Make CanvasRenderingContext2d::new take a &GlobalScope 2016-10-06 21:35:39 +02:00
Anthony Ramine
ae6af5172b Introduce Reflectable::global_scope 2016-10-06 21:35:38 +02:00
Anthony Ramine
f789e73fd2 Introduce GlobalScope::constellation_chan 2016-10-06 20:59:12 +02:00
Anthony Ramine
fcb59d3057 Make reflect_dom_object take a &GlobalScope 2016-10-06 20:59:09 +02:00
Arthur Marble
dbec9d8454 More code refactoring (exampleVar to example_var) 2016-09-18 01:02:57 -05:00