62 Commits

Author SHA1 Message Date
Euclid Ye
cae0752676 cargo: Rename workspace-local library starting with b to servo_* (#43552)
Follow up of #43526. This addresses Nico's comment:
https://github.com/servo/servo/pull/43526#issuecomment-4104953308

- `bluetooth_traits` -> `servo_bluetooth_traits`
- `base` -> `servo_base`
- `bluetooth` -> `servo_bluetooth`
- `background_hang_monitor` -> `servo_background_hang_monitor`

Testing: This should not change any behaviour.

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-03-23 08:26:49 +00:00
Euclid Ye
317e5ee7de cargo: Rename Workspace-local dependencies starting with b to servo-* (#43526)
Also reorders alphabetically for the corresponding user .toml.

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-03-22 11:19:21 +00:00
Jonathan Schwender
eac6ff8509 Metadata: Add missing repository information (#43451)
This fixes a warning of `cargo publish`: 

```
warning: manifest has no description, documentation, homepage or repository
```

Testing: Compiling. Manual testing of `cargo publish --dry-run` (with
some additional patches, and until the next error, shows this warning
has been fixed)

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2026-03-19 08:54:18 +00:00
Euclid Ye
a1fde82cb0 pixels: Properly format the panic message in webrender_image_descriptor_and_data_for_frame (#43009)
`expect` is not a macro.

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-03-04 05:49:30 +00:00
Jonathan Schwender
37dfa42731 Unify servo package naming (#42916)
This is a preparation for publishing to crates.io. Changes include:
- Add `servo-` prefixes to avoid name collisions on crates.io
- Use `-` instead of `_` in package names.
- Rename the crates to their original names in Cargo.toml,
  to keep the diff minimal
- Rename `media` to `servo-media-thread` to avoid name collision with
  `servo-media` (originally from the media repository).

This is an outcome of the previous discussion at [#general > Switch
remaining git dependencies to
crates.io](https://servo.zulipchat.com/#narrow/channel/263398-general/topic/Switch.20remaining.20git.20dependencies.20to.20crates.2Eio/with/576336288)

Testing: This should be mostly covered by our CI, but some amount of
breakage is to be expected, since some package names could still be
referenced from scripts which are not tested or run in CI. [mach try
run](https://github.com/jschwe/servo/actions/runs/22502945949)

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2026-03-01 14:15:27 +00:00
Narfinger
0c623f5281 pixels: Avoid unnecessary clone (#42684)
We do not need to clone the vector just to clone it again for an
GenericSharedMemory to take it.

In real life tests this copy can take up to 30% of the
`webrender_image_descriptor_and_data_for_frame` function.


Testing: This does not change functionality and just reorders the
allocation.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2026-02-17 16:47:37 +00:00
TIN TUN AUNG
6438cb1cd6 image: take exif orientation into account when decoding static image (#42567)
When decoding static image, change the layout of rgba value based on
exif orientation metadata.

Testing: More wpt are passing
Fixes: N/A

Note: 
This change will make the wpt test related to `image-orientation: none`
failed, because this change apply the exif orientation unconditionally.
But, given the [`image-orientation`
spec](https://drafts.csswg.org/css-images/#the-image-orientation):
> This property is optional for implementations.

And there are more wpt tests passing, we may be able to deprioritize the
tests for `image-orientation`.

---------

Signed-off-by: rayguo17 <rayguo17@gmail.com>
2026-02-13 06:55:12 +00:00
Narfinger
d41bb930e1 painter: Insert a cache for animation with smarter updates (#41956)
This inserts a cache in painter that keeps data for animating images in
Painter.
We then can send cheap ImageUpdate::UpdateAnimation to just get the
required bytes from the cache.

There are some warts with the current design:
- ImageUpdate::AddImage only adds images in the cache that have the data
in SerializableImageData::Raw. Potentially there could be image
animations in other ways which then for a following
ImageUpdate::UpdateAnimation we do not have the data. We can probably
fix this on the sender side.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>

Testing: Tested on the usecase in
https://github.com/servo/servo/issues/41818 and WPT test here:
https://github.com/Narfinger/servo/actions/runs/21063721427
Fixes: https://github.com/servo/servo/issues/41818

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2026-01-28 14:07:27 +00:00
Narfinger
15aa6ee8c0 Base: Rename IpcSharedMemory to GenericSharedMemory (#41198)
In the future, servo components should depend on the generic channels in
base instead of IpcChannels to correctly optimize for multiprocess vs
non-multiprocess mode.
This reexports IpcSharedMemory as GenericSharedMemory in GenericChannel
and changes all dependencies on it.

Currently this is only a type/name change and does not change
functionality. But in the future we would want want to use non-ipc
things for the data.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>

Testing: This changes types and does not need testing.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-12-31 13:07:59 +00:00
Ashwin Naren
435fa2696d Fix some typos in comments across various parts of the codebase (#40492)
Testing: This only updates comments, so should not need new tests.

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-11-08 04:49:04 +00:00
Narfinger
3bfd107686 net: Do not implement Serialize/Deserialize for RasterImage and introduce`SharedRasterImage (#40459)
RasterImage is now not seralizeable and backed by Vec<u8> storage. Add a
new struct `SharedRasterImage` that allows serializeing. This can be
constructed from RasterImage. This introduces some more copying but I
think the tradeoff is ok. Newly introduced copies are for favicon
response to the embedder and EmbedderNotifications.

Testing: Should not change functionality, so covered by existing tests.
Fixes: https://github.com/servo/servo/issues/39626 and related issues.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-11-07 16:49:32 +00:00
Martin Robinson
ea5929e2a4 pixels: Store decoded images as RGBA premultiplied data (#40158)
Canvas expects input data to be in RGBA premultiplied format and
WebRender already supports RGBA and BGRA data as long as they are
premultiplied. Pre-multiplying up front allows:

- Avoiding many conversions when painting images to canvas.
- Passing the `RasterImage` IpcSharedMemory of the image instead of
creating
  a new one with the premultiplied data every time we upload to
  WebRender. This is a big deal for animated gifs, because before every
  frame was creating a new shared memory segment.

It seems that for rasterized SVGs were were already putting
premultplied data into the `RasterImage` so it's quite likely SVGs were
being composited incorrectly.

Testing: This causes 8 tests to start passing and 2 tests to fail in the
WebGL conformance suite.
The failures are due to the fact that premultiplying alpha is lossy when
alpha is 0. In that case,
the resulting color of a blend operation might be wrong. This is
typically only a problem if you
use RGBA data as RGB data, which is pretty unusual. In the case that you
are blending with
RGBA the final color values will be 0 or close to 0 anyway. Gecko solves
this issue by having a
cacheable surface generation API that can fetch both premulitplied and
unpremulitplied data
from things like image elements. We do not have that yet, but I argue
that this change
is important anyway due to the amount that it reduces memory and file
descriptor usage
as well as the cost of copying image data so much in memory.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-10-31 10:07:38 +00:00
Martin Robinson
8be7ec73fd pixels: Split Snapshot into SharedSnapshot and Snapshot (#40136)
This splits `Snapshot` into two structs:

- `Snapshot`: A non-serializable owned image buffer that might contain
  either shared memory or a `Vec<u8>`. When mutated the shared memory
  version is converted into a `Vec<u8>` avoiding a copy of the data
  until absolutely necessary.
- `SharedSnapshot`: A serialzable version of `Snapshot` that contains
  only shared memory and is suitable for sending across IPC channels.
  This version is cheaply convertible from and to owned `Snapshot`s as
  long as the source is also a shared memory `Snapshot`.

In addition, it does copyless conversions of `RasterImage` into
`Snapshot`s (including for frame offsets in animated images). Finally,
there are a few minor changes to try harder not to have to do a
`transform()` operation.

Testing: This should not change observable behavior, so is covered by
existing
tests. It should come with a mild performance improvement and open up
the
opportunity for others.
Fixes: #36594.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-10-26 15:03:30 +00:00
Sam
228b240635 layout: Convert animated image delays < 10ms into 100 ms delays (#39189)
Some animated images in the wild have delays <10ms and browsers usually
change them into 100ms as such small timings are unusual.

Relevant code in FF:
https://searchfox.org/firefox-main/source/image/FrameTimeout.h#35

Testing: Manually tested
Fixes: #39187

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-09-08 14:16:21 +00:00
Simon Wülker
c4dcd17214 Update image to 0.25 (#38950)
Testing: These changes should be covered by existing web platform tests
and `image`'s own test suite.

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-08-27 00:51:14 +00:00
Martin Robinson
2f44ba5168 script: Do not iterate through all image frames when advancing animated images (#38857)
Instead of iterating through all frames every time we are looking for a
particular frame, just index into the `Vec` of frames directly. This
should do less work on every frame transition.

Testing: This is just a small optimization, so shouldn't change
observable
behavior.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-22 17:44:57 +00:00
webbeef
3225d19907 cargo: Bump rustc to 1.89 (#36818)
Update Rustc to 1.89.

Reviewable by commit.

Leftover work:
- #37330 
- #38777

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Co-authored-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-08-19 11:07:53 +00:00
Martin Robinson
8743a11ba4 tidy: Add a rule ensuring that // comments are followed by a space in Rust (#38698)
This shows up sometimes in code reviews, so it makes sense that tidy
enforces it. `rustfmt` supports this via comment normalization, but it
does many other things and is still an unstable feature (with bugs).

Testing: There are new tidy tests for this change.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-18 12:09:09 +00:00
TIN TUN AUNG
f88dd2a12c add support for apng and webp animated image decoding (#37637)
Add support for APNG animated image decoding. Rework `load_from_memory`
image decoding api, to handle all the image format that currently
supported.

Testing: This change should allow `apng` and `webp` format image start
moving, and should make some WPT test related to APNG pass.

Partially address: https://github.com/servo/servo/issues/37493

[wpt try
run](https://github.com/rayguo17/servo/actions/runs/15840339570)

cc @xiaochengh

Signed-off-by: rayguo17 <rayguo17@gmail.com>
2025-07-10 08:54:16 +00:00
sagudev
e1a891ea96 canvas: Use snapshot in canvas backends (#37863)
This removes assumption about pixel format from backend abstraction to
actual backend implementation. This is important for vello.

Testing: WPT tests

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-04 20:22:20 +00:00
Andrei Volykhin
6ba54e4d79 canvas: Add OffscreenCanvas 'convertToBlob' method (#37786)
Follow the HTML speficication and add missing 'convertToBlob' method
to OffscreenCanvas interface.

https://html.spec.whatwg.org/multipage/#dom-offscreencanvas-converttoblob

Testing: Improvements in the following tests
-
html/canvas/offscreen/manual/convert-to-blob/offscreencanvas.convert.to.blob*
-
html/canvas/offscreen/manual/wide-gamut-canvas/2d.color.space.p3.convertToBlobp3.canvas.html

Fixes: #24272

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-07-04 06:58:12 +00:00
sagudev
a631b42e60 pixels: Ensure expected formats when accesing bytes of snapshot (#37767)
I introduced snapshot in #36119 to pack raw bytes and metadata together,
now we take the next step and require for user to always specify what
kind of byte data they want when calling `as_bytes` or `to_vec`
(basically joining transform and data). There are also valid usages when
one might require just one property of bytes (textures can generally
handle both RGBA and BGRA). There are also valid usages of using just
raw bytes (when cropping). This PR tries to make such usages more
obvious.

This will make it easier to fix stuff around 2d canvas (we do not want
to assume any bytes properties in abstraction).

Testing: Code is covered by WPT tests.

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-07-03 15:02:41 +00:00
Martin Robinson
309485d2db pixels: Move Snapshot and related data structures to pixels (#37590)
1. The `shared` directory is for the "_traits" crates, which will likely
   be moved out of this directly at some point and renamed "_api". These
   crates expose the API of crates to avoid circular dependencies.
   `Snapshot` isn't really this.
2. `Snapshot` is essentially a specialied kind of `Image` so it makes
   sense that it is grouped with other image-related things in `pixels`.

Testing: This should not change any behavior so is covered by existing
tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-06-20 14:47:06 +00:00
Andrei Volykhin
d8c552f3ab pixels: Multiply by alpha with less loss of precision (#37503)
Integer color components representation has performance and memory
storage benefits
but suffers from precision loss after multiple consequence alpha
(un)premultiply operations.

Rounding any fractional bits (to the nearest integer) during alpha
multiplication should reduce the loss of precision.
Expensive division will be replaced by multiplication and bits shift.

https://research.swtch.com/divmult

https://docs.google.com/document/d/1tNrMWShq55rfltcZxAx1N-6f82Dt7MWLDHm-5GQVEnE

Other browsers and graphics libraries have the similar approach:

- Chromium (Skia):
https://github.com/google/skia/blob/main/include/private/base/SkMath.h#L73
- Firefox:
https://github.com/mozilla/gecko-dev/blob/master/gfx/2d/Swizzle.cpp#L276
- Servo (Raqote):
https://github.com/jrmuizel/sw-composite/blob/master/src/lib.rs#L878

Testing: Improvements in the following WPT test
-
html/canvas/element/manual/imagebitmap/createImageBitmap-premultiplyAlpha.html

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-06-18 06:52:42 +00:00
Andrei Volykhin
bcade589e7 imagebitmap: Crop bitmap data with formatting (#37397)
Follow the ImageBitmap specification and make cropping of the bitmap
data to the source rectangle with formatting:
https://html.spec.whatwg.org/multipage/#cropped-to-the-source-rectangle-with-formatting

For now the next functionality not implemented:
- image orientation support (such as EXIF metadata)
- color space conversion (image, blob)

The convertion from ResizeQuality to "image" FilterType:
 - pixelated/low/medium/high -> Nearest/Triangle/CatmullRom/Lanczos3

Other browsers use the following sample filtering:
 - chromium (skia): Nearest/Linear/Linear/CatmullRom
 - firefox (skia): Lanczos3

Testing: Improvements in the following WPT tests
 - html/canvas/element/manual/imagebitmap/*

Fixes (partially): #34112

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-06-16 12:09:04 +00:00
Sam K
a625420b23 Change canvas/context/snapshot size from u64 -> u32 (#36827)
Replaces uses of `euclid::default::Size2D<u64>` with
`euclid::default::Size2D<u32>` for the canvas/context/snapshot.

This PR includes changes to the following components:
 - canvas
 - pixels
 - script
 - script_bindings
 - shared/canvas
 - shared/snapshot

Testing: https://github.com/hashcatHitman/servo/actions/runs/15426115391
(as of 892edc0048)

Fixes: #36706

---------

Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
2025-06-07 14:37:21 +00:00
Andrei Volykhin
801ac9e22a pixels: Add limitation to max image total bytes length (#37172)
Limit the maximum image allocation size to 2GB to minimize the
possibility of out of memory errors on some `ImageBitmap`, `ImageData`,
`Canvas`, and `OffscreenCanvas` operations such as construction,
`toBlob`, and `toDataURL`. Other browsers have similar limits:
 - Chromium: 2^32-1 (~4GB)
- Firefox: 2^31-1 (~2GB)

Testing: Improvements to the following tests:
-
`html/canvas/element/pixel-manipulation/2d.imageData.object.ctor.basics.html`
assert_throws_dom("INDEX_SIZE_ERR", function() { new ImageData(1 << 31,
1 << 31); });
-
`html/canvas/element/manual/imagebitmap/createImageBitmap-invalid-args.html`
   makeOversizedCanvas + makeOversizedOffscreenCanvas

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-05-29 10:43:27 +00:00
Mukilan Thiyagarajan
8a20e42de4 Add support for static SVG images using resvg crate (#36721)
This change adds support for rendering static SVG images using the
`resvg` crate, allowing svg sources in the `img` tag and in CSS
`background` and `content` properties. There are some limitations in
using resvg:

1. There is no support for animations or interactivity as these would
require implementing the full DOM layer of SVG specification.
2. Only system fonts can be used for text rendering. There is some
mechanism to provide a custom font resolver to usvg, but that is not
explored in this change.
3. resvg's handling of certain edge cases involving lack of explicit
`width` and `height` on the root svg element deviates from what the
specification expects from browsers. For example, resvg uses the values
in `viewBox` to derive the missing width or height dimension, but
without scaling that dimension to preserve the aspect ratio. It also
doesn't allow overriding this behavior.

Demo screenshot:
![servo - resvg
img](https://github.com/user-attachments/assets/8ecb2de2-ab7c-48e2-9f08-2d09d2cb8791)

<details>
<summary>Source</summary>

```
<style>
 #svg1 {
   border: 1px solid red;
 }

 #svg2 {
   border: 1px solid red;
   width: 300px;
 }
 #svg3 {
   border: 1px solid red;
   width: 300px;
   height: 200px;
   object-fit: contain;
 }
 #svg4 {
   border: 1px solid red;
   width: 300px;
   height: 200px;
   object-fit: cover;
 }
 #svg5 {
   border: 1px solid red;
   width: 300px;
   height: 200px;
   object-fit: fill;
 }
 #svg6 {
   border: 1px solid red;
   width: 300px;
   height: 200px;
   object-fit: none;
 }
</style>
</head>
<body>
        <div>
          <img id="svg1" src="https://raw.githubusercontent.com/servo/servo/refs/heads/main/resources/servo.svg" alt="Servo logo">
        </div>
        <div>
          <img id="svg2" src="https://raw.githubusercontent.com/servo/servo/refs/heads/main/resources/servo.svg" alt="Servo logo">
          <img id="svg3" src="https://raw.githubusercontent.com/servo/servo/refs/heads/main/resources/servo.svg" alt="Servo logo">
          <img id="svg4" src="https://raw.githubusercontent.com/servo/servo/refs/heads/main/resources/servo.svg" alt="Servo logo">
        </div>
        <div>
          <img id="svg5" src="https://raw.githubusercontent.com/servo/servo/refs/heads/main/resources/servo.svg" alt="Servo logo">
          <img id="svg6" src="https://raw.githubusercontent.com/servo/servo/refs/heads/main/resources/servo.svg" alt="Servo logo">
        </div>
</body>
```

</details>

---------

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-05-27 11:02:40 +00:00
Simon Wülker
384d8f1ff8 Coalesce animated image frame data into a single shared memory region (#37058)
This makes servo use less file descriptors for animated images and
avoids the crash described in
https://github.com/servo/servo/issues/36792.

Doing this also forces the end users to be more explicit about whether
they want to deal with all image frames or just the first one.
Previously, `Image::bytes` silently returned only the data for the first
frame. With this change there's now a `frames` method which returns an
iterator over all frames in the image.

Testing: No tests - this simply reduces the number of fds used. Servo
doesn't currently display animated gifs anyways.
Fixes: https://github.com/servo/servo/issues/36792

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-05-20 20:40:46 +00:00
Andrei Volykhin
bc9f55bcc9 pixels: Actually write pixels in MULTIPLY generic_transform_inplace operations (#36895)
Multiply operations applied in `generic_transform_inplace` were
calculating the new pixel values, but not actually writing them.
This changes fixes that issue.

Testing: /webgl/tests/conformance/context/premultiplyalpha-test.html
Fixes: #35759

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-05-08 07:38:02 +00:00
sagudev
73b778e67f Introduce snapshot concept of canvas (#36119)
Each canvas context returns snapshot instead of just raw bytes. This
allows as to hold off conversions (BGRA <-> RGBA, (un)premultiply) to
when/if they are actually needed. For example when loading snapshot into
webgl we can load both RGBA and BGRA so no conversion is really needed.

Currently whole thing is designed to be able to be extend on
https://github.com/servo/ipc-channel/pull/356, to make less copies.
Hence some commented out code.


Fixes #35759
There are tests for these changes in WPT

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-04-23 07:32:47 +00:00
Josh Matthews
594c04dc7c Report memory usage for image frames. (#36581)
These changes make the image-cache memory reporter report much larger
values after loading image-heavy pages.

Testing: Manual testing on https://www.nist.gov/image-gallery
Fixes: #36559

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-04-17 11:57:04 +00:00
Alex Touchet
1aac377e62 Organize component Cargo.toml dependencies (#36224)
Signed-off-by: Alex Touchet <26315797+atouchet@users.noreply.github.com>
2025-03-30 19:03:54 +00:00
TIN TUN AUNG
ec20d9a3d7 pixels: Extend Image to allow for multiple frames (#36058)
Signed-off-by: rayguo17 <rayguo17@gmail.com>
2025-03-21 10:32:14 +00:00
Jonathan Schwender
42e873e9d9 pixels: Fix webp detection (#35474)
According to the riff_container specification, the suffix is only WEBP.
Additionally, this commit also verifies that the length of the byte
buffer matches the length declared by the riff header.

Source: https://developers.google.com/speed/webp/docs/riff_container

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-02-19 11:09:16 +00:00
Euclid Ye
0de6d1bc3a Update pixels::unmultiply_inplace to support RB swap and use it in canvas_state (#35313)
* update unmultiply_inplace to handle reversed RGB

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>

* Reuse unmultiply_inplace instead of manual compute; remove unused

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-02-06 05:02:49 +00:00
Shalvin
022a95a2cd Optimized unmultiply_inplace to remove fp ops (#33582)
Signed-off-by: Shalvin Deo <shalvin.deo@live.com>
2024-09-30 19:39:27 +00:00
Samson
1ddfde96ce Add a benchmark for for unmultiply_inplace in pixels (#33584)
* bench unmultiply_inplace

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* create data in one line

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* number_of_pixels

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-09-30 10:56:18 +00:00
Taym Haddadi
02953d2fb6 Move unmultiply_inplace to pixels crate (#33553)
Signed-off-by: Taym <haddadi.taym@gmail.com>
2024-09-27 04:28:00 +00:00
Martin Robinson
aa0029c11c Add rust-version to all Cargo.toml files (#33483)
This is another step preparing for building Servo without `mach`.

Fixes #33430.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-09-17 16:39:07 +00:00
Martin Robinson
4a7f3bac7c Use workspace definitions for all crates and update to the 2021 edition (#32544) 2024-06-18 09:22:08 +00:00
Mukilan Thiyagarajan
2af6fe0b30 compositor: Move WebRender-ish messages and types to webrender_traits (#32315)
* Move WebRender related types to `webrender_traits`

This refactor moves several WebRender related types
from `compositing_traits`, `script_traits` and `net_traits`
crates to the `webrender_traits` crate.

This change also moves the `Image` type and associated
function out of `net_traits` and into the `pixels` crate.

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* Move `script_traits::WebrenderIpcSender` to `webrender_traits::WebRenderScriptApi`

---------

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-05-20 10:35:18 +00:00
eri
3a5ca785d3 clippy: fix warnings in various modules in components (#31568)
* clippy: fix warnings in various modules in components

* fix: unit tests

* fix: build on android

* fix: all samplers use new_boxed
2024-03-08 14:28:04 +00:00
Delan Azabani
faf754dfa6 Move Stylo to its own repo (#31350)
* Remove packages that were moved to external repo

* Add workspace dependencies pointing to 2023-06-14 branch

* Fix servo-tidy.toml errors

* Update commit to include #31346

* Update commit to include servo/stylo#2

* Move css-properties.json lookup to target/doc/stylo

* Remove dependency on vendored mako in favour of pypi dependency

This also removes etc/ci/generate_workflow.py, which has been unused
since at least 9e71bd6a70.

* Add temporary code to debug Windows test failures

* Fix failures on Windows due to custom target dir

* Update commit to include servo/stylo#3

* Fix license in tests/unit/style/build.rs

* Document how to build with local Stylo in Cargo.toml
2024-02-27 15:39:06 +00:00
Samson
aad2dccc9c Strict import formatting (grouping and granularity) (#30325)
* strict imports formatting

* Reformat all imports
2023-09-11 19:16:54 +00:00
Samson
711dbbd4af remove extern crate (#30311)
* remove extern crate

* Update components/script_plugins/lib.rs

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2023-09-08 12:11:31 +00:00
Martin Robinson
2f4c47bfe7 Start the transition to workspace dependencies
This will ultimately make it simpler to update crate dependencies and
reduce duplicate when specifying requirements. Generally, this change
does not touch dependencies that are only used by a single crate. We
could consider moving them to workspace dependencies in the future.
2023-05-17 11:59:35 +02:00
Martin Robinson
423cc34cb0 Bump euclid to 0.22
- Also updates raqote to latest with an upgrade of font-kit to 0.11
  applied on as a patch
- Update lyon_geom to the latest version

Major change:

- All matrices are now stored in row major order. This means that
  parameters to rotation functions no longer should be negated.
- `post_...()` functions are now named `then()`. `pre_transform()` is removed,
  so `then()` is used and the order of operations changed.
2023-01-26 08:59:21 +01:00
atouchet
77f7fa552d More Cargo.toml updates 2020-05-30 18:18:57 -07:00
Bailey Blankenship
ec2961920b Addresses issues raised in #24465; removes redundancy in set_bitmap_dimensions
Removed passing test .ini files and moved euclid extensions to euclidext.rs to factor out redundant code
2019-11-10 18:37:14 -05:00