Merge mozilla-central to autoland. CLOSED TREE
[gecko.git] / gfx / wr / README.md
blob6162a5f86b193a96a028a9e7d8e55675fe3f1b32
1 # WebRender
3 [![Version](https://img.shields.io/crates/v/webrender.svg)](https://crates.io/crates/webrender)
5 WebRender is a GPU-based 2D rendering engine written in [Rust](https://www.rust-lang.org/). [Firefox](https://www.mozilla.org/firefox), the research web browser [Servo](https://github.com/servo/servo), and other GUI frameworks draw with it. It currently uses the OpenGL API internally.
7 Note that the canonical home for this code is in gfx/wr folder of the
8 mozilla-central repository at https://hg.mozilla.org/mozilla-central. The
9 Github repository at https://github.com/servo/webrender should be considered
10 a downstream mirror, although it contains additional metadata (such as Github
11 wiki pages) that do not exist in mozilla-central. Pull requests against the
12 Github repository are still being accepted, although once reviewed, they will
13 be landed on mozilla-central first and then mirrored back. If you are familiar
14 with the mozilla-central contribution workflow, filing bugs in
15 [Bugzilla](https://bugzilla.mozilla.org/enter_bug.cgi?product=Core&component=Graphics%3A%20WebRender)
16 and submitting patches there would be preferred.
18 ## Update as a Dependency
19 After updating shaders in WebRender, go to servo and:
21   * Go to the servo directory and do ./mach update-cargo -p webrender
22   * Create a pull request to servo
25 ## Use WebRender with Servo
26 To use a local copy of WebRender with servo, go to your servo build directory and:
28   * Edit Cargo.toml
29   * Add at the end of the file:
31 ```
32 [patch."https://github.com/servo/webrender"]
33 "webrender" = { path = "<path>/webrender" }
34 "webrender_api" = { path = "<path>/webrender_api" }
35 ```
37 where `<path>` is the path to your local copy of WebRender.
39   * Build as normal
41 ## Documentation
43 The Wiki has a [few pages](https://github.com/servo/webrender/wiki/) describing the internals and conventions of WebRender.
45 ## Testing
47 Tests run using OSMesa to get consistent rendering across platforms.
49 Still there may be differences depending on font libraries on your system, for
50 example.
52 See [this gist](https://gist.github.com/finalfantasia/129cae811e02bf4551ac) for
53 how to make the text tests useful in Fedora, for example.