Граф коммитов

23 Коммитов

Автор SHA1 Сообщение Дата
Anthony Ramine 8a8c2c50b0 servo: Merge #18118 - Revert "Auto merge of #18114 - emilio:revert-webgl-refactor, r=nox" (from servo:oops-webgl); r=emilio
This reverts commit 4d10d39e8fe841c5fe2ac58da2daaa13c10c140e, reversing
changes made to ee94e2b7c0bd327abe8f9545b2a1f792f67a2bdd.

Source-Repo: https://github.com/servo/servo
Source-Revision: fbabcaf614662a52eace21a64f27802c7eff4304

--HG--
rename : servo/tests/unit/style/rule_tree/mod.rs => servo/components/canvas/webgl_mode/mod.rs
rename : servo/components/canvas_traits/lib.rs => servo/components/canvas_traits/canvas.rs
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 921107267937fee7e9f6887bc9a7d129ff9af9f2
2017-08-17 00:26:08 -05:00
Emilio Cobos Álvarez 63addaeaca servo: Merge #18114 - Revert "Auto merge of #17891 - MortimerGoro:webgl_move, r=glennw,emilio" (from emilio:revert-webgl-refactor); r=nox
This reverts commit 90f55ea4580e2a15f7d70d0491444f18b972d450, reversing
changes made to 2e60b27a2186a8cba4b952960155dfcf3f47d7db.

Doing that per Josh's request, since it's causing very frequent intermittent OOMs on the android builders.

Source-Repo: https://github.com/servo/servo
Source-Revision: 4d10d39e8fe841c5fe2ac58da2daaa13c10c140e

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 0474db248269e8cf2b094bfa04e32701137c46c8
2017-08-16 09:45:13 -05:00
Imanol Fernandez e89d06f1c7 servo: Merge #17891 - Improved WebGL architecture (from MortimerGoro:webgl_move); r=glennw,emilio
<!-- Please describe your changes on the following line: -->

Info about the big picture and the goals of the WebGL refactor in this thread: https://groups.google.com/forum/#!topic/mozilla.dev.servo/0WMGz60kKzQ

I tried to reduce this PR as much as possible as requested in the thread. I'll do separate PRs for other features (e.g.: Batch messages or use shared memory to improve frame times) or fixes.

Some tips to ease the review process:
- Most changes in DOM objects follow the same pattern (remove CanvasMsg wrapper and use the new sender method).
- WebGLCommands are the same ones as before (moved from webrender_api). So those lines are already reviewed.
- See WebGL traits in [components/canvas_traits/webgl.rs](https://github.com/servo/servo/pull/17891/files#diff-8701045d01505418701d0631d4d45562)
- See WebGLThread and WR External Image bridge in [components/canvas/webgl_thread.rs](https://github.com/servo/servo/pull/17891/files#diff-281554879f39a2a041f7a69d442a5d2e)
- The implementation submitted in this PR creates a single `WebGLThread` for all ScriptThread/Pipelines. See that in [components/canvas/webgl_mode/inprocess.rs](https://github.com/servo/servo/pull/17891/files#diff-250070c6c5a38c7f9fa0f5b3c101f68b)

The conformance tests will help to guarantee that we don't miss anything.

---
<!-- 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 #__ (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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 90f55ea4580e2a15f7d70d0491444f18b972d450

--HG--
rename : servo/tests/unit/style/rule_tree/mod.rs => servo/components/canvas/webgl_mode/mod.rs
rename : servo/components/canvas_traits/lib.rs => servo/components/canvas_traits/canvas.rs
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : d476816b29986c4abfd61ff3c7b46aa189f2f50a
2017-08-15 16:00:10 -05:00
Martin Robinson d42609fdf5 servo: Merge #17694 - Upgrade to the latest version of WebRender (from glennw:webrender-update); r=glennw
Source-Repo: https://github.com/servo/servo
Source-Revision: 173181a491f18a292ea80acbc25dd561e6e678d8

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : e76e3e725e124e01505676aedcf0d8f6e7d67971
2017-07-12 21:52:27 -07:00
Anthony Ramine be2b512750 servo: Merge #15715 - Make #[dom_struct] a proc_macro attribute (from nox:custom-derive); r=SimonSapin
The rustup is needed for https://github.com/rust-lang/rust/pull/40039.

Source-Repo: https://github.com/servo/servo
Source-Revision: a204c4176dcccdad8ec99d74055c66794c3f64ba

--HG--
rename : servo/components/domobject_derive/Cargo.toml => servo/components/dom_struct/Cargo.toml
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 2cad140c3d6b99837f0bd15a6f3ccba0f353e049
2017-02-24 05:56:30 -08:00
Anthony Ramine 8a68e5aa5a servo: Merge #14376 - Make WebIDL static items take a more specific global if possible (from nox:specialized-constructors); r=KiChjang,nox
Source-Repo: https://github.com/servo/servo
Source-Revision: e315da07319c115bd85f7da1baa1cf0577a1980b
2016-11-30 15:43:48 -08:00
Glenn Watson 208596903e servo: Merge #14286 - Update to webrender 0.10.0 (from gterzian:update_canvas_with_offscreen_context); r=jdm
<!-- Please describe your changes on the following line: -->

Changes necessary to build servor with webrender 0.10.0

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

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

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: e1eff691f8a1d8c9c7ab33344364f0419626b80e
2016-11-24 12:29:52 -08:00
Eric Anholt ebe823e990 servo: Merge #14081 - webgl: out-of-bounds readPixels() fixes (from anholt:webgl-readpix-negative-width); r=emilio
<!-- Please describe your changes on the following line: -->
Fix crashes in two WebGL readPixels() tests by adding framebuffer size validation.

---
<!-- 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 #13901

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

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 2601d8eb8b5988f1f72a2449b904a75f5dab0c59
2016-11-09 10:03:42 -06:00
Eric Anholt bf218ec238 servo: Merge #13872 - webgl: Add basic support for framebuffer attachments (from anholt:webgl-fbo); r=emilio
This is by no means a complete implementation, but I've slowed down on working on it, so I think we should look at what it takes to merge the current code.  There are some major features missing, like initializing renderbuffers to 0 (uninitialized memory leak), tracking the attachments' attributes (width/height/format) for parameter requests, and lots of missing glCheckFramebufferStatus() validation.  On the other hand, this is enough to run some demos using FBOs.

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

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

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: fbec79e920c0b0ddeaeeb6c0cc97b20ad85729e0
2016-10-27 21:39:15 -05:00
Anthony Ramine b95407a112 servo: Merge #13596 - Get rid of dom::bindings::global (from nox:inline); r=Ms2ger
Globals in that PR are now represented by the fake IDL interface `GlobalScope`.

Source-Repo: https://github.com/servo/servo
Source-Revision: a6e4b5bb86ad707a0863acff87344ca4239cfd2c

--HG--
rename : servo/components/script/dom/webidls/ServoXMLParser.webidl => servo/components/script/dom/webidls/GlobalScope.webidl
2016-10-07 07:52:09 -05:00
Anthony Ramine 82df62fcd8 servo: Merge #11892 - Use wrappers for GL IDs (from nox:webgl-wrappers); r=emilio
See https://github.com/servo/webrender_traits/pull/62.

Source-Repo: https://github.com/servo/servo
Source-Revision: dca85ae98d620723eb7466615d11a032c58d5ca3
2016-06-28 13:13:44 -05:00
Daniel 95d70551db servo: Merge #11426 - Implement IsBuffer, IsFramebuffer and IsRenderbuffer for WebGLRenderingContext (from DDEFISHER:master); r=emilio
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy --faster` does not report any errors
- [X] These changes fix #11357
- [X] There are tests for these changes

Source-Repo: https://github.com/servo/servo
Source-Revision: b11648903bb07a31ec93f3030058ed41b3472b17
2016-05-29 20:03:56 -05:00
Jan-Fabian Humann b60a127aa6 servo: Merge #10291 - #10211: Stop re-exporting webrender_traits WebGL types from canvas_traits (from jfhumann:10211); r=emilio
Source-Repo: https://github.com/servo/servo
Source-Revision: 524a004e771b465e3de9ebbc33816e50949d6a25
2016-04-01 01:28:20 +05:01
rohan.prinja e8b504412b servo: Merge #8221 - move modules around (from ajnirp:8130-reorganise); r=jdm
for #8130

Source-Repo: https://github.com/servo/servo
Source-Revision: daad09d44245228fba9118316937add71bec7c58
2015-11-04 02:27:02 +05:01
Emilio Cobos Álvarez 8641baaa51 servo: Merge #8291 - Add destructors to some WebGL objects, remove duplicated glutin dependency and try to enable the webgl reftests (from emilio:webgl-drop); r=jdm
The first commit allows to cleanup the gl resources of the webgl task earlier if they aren't being used.
Right now all resources were cleaned up when the context was destroyed, so I think this is
a slightly better approach.

The second commit bumps rust-offscreen-rendering-context to remove the duplicated glutin dependency.

The third one tries to reenable the webgl reftests.
Since the errored builds are deleted, It's the only way I can try to troubleshoot it.

Source-Repo: https://github.com/servo/servo
Source-Revision: 3282174a9941ec1f8d8821dfac44b850b77e7668
2015-11-02 18:23:33 +05:01
Brandon Fairchild f7fb1e4b4a servo: Merge #7662 - Check for multiple import blocks separated by whitespace (from nerith:import); r=frewsxcv
Fixes #7381.

Source-Repo: https://github.com/servo/servo
Source-Revision: a0d3c9223f09757124b1520c4f17e94fa8bbe249
2015-09-19 13:34:51 -06:00
Anthony Ramine d2ee701ee9 servo: Merge #7401 - Remove helper traits (from nox:rm-helpers); r=Manishearth
Now that `JSRef<T>` is gone, there is no need to have helper traits.

Source-Repo: https://github.com/servo/servo
Source-Revision: 909429702972d53bf02dfe9a4aa93ea0cb588cf4
2015-08-27 09:38:48 -06:00
João Oliveira d39bd47b08 servo: Merge #7361 - make dom_struct derive HeapSizeOf (from jxs:master); r=Ms2ger
closes #7357

Source-Repo: https://github.com/servo/servo
Source-Revision: 532fd19d69fd11d06bca7539c722a46fab2c4419
2015-08-27 02:35:45 -06:00
Bogdan Cuza b3e4dcef5f servo: Merge #7097 - Measure heap memory usage for more types. Fixes #6951 (from boghison:memtypes); r=jdm
Also adds HeapSizeOf implementations/derive for some types. I've used "Cannot calculate Heap size" as a reason everywhere, because my imagination is rather limited. If you'd like me to change this message for specific types, please write something like this: "Trusted - Cannot calculate Heap size for Trusted" so that it would be easier for me to replace them through a script :)

Source-Repo: https://github.com/servo/servo
Source-Revision: a03616f379c255cc6c9b6e1d04dd7d98bd9926ce
2015-08-13 13:16:14 -06:00
Patrick Walton d4fd20dc7c servo: Merge #6616 - script: Make most of 2D canvas and WebGL run over IPC (from pcwalton:canvas-webgl-ipc); r=jdm
To actually make the multiprocess communication work, we'll need to
reroute the task creation to the pipeline or the compositor. But this
works as a first step.

r? @jdm

Source-Repo: https://github.com/servo/servo
Source-Revision: 1764267379a00b96a1df89f3917299a0c6fd325c
2015-07-25 01:50:31 -06:00
ecoal95 4f37e0ba01 servo: Merge #6380 - Refactor WebGL implementation to move logic inside the DOM interfaces (from emilio:webgl-refactoring); r=jdm
This improves the encapsulation and consistency in our WebGL
implementation.

Also allows to implement new methods such as `getShaderSource()`.

It will also allow us to use `delete()` in the destructors of them (note
that we will probably want to keep track of them from the context before).

Some concerns:

**Trait method repetition**:
I'm aware that the traits `WebGL{Buffer,Renderbuffer,Framebuffer,Texture}Helpers` are basically the same, but `delete()` and `id()` methods are everywhere. I've thought something like:

```rust
pub trait WebGLIdentifiable {
    type WebGLId; // id is sometimes i32 (see WebGLUniformLocation)
    fn id(&self) -> Self::WebGLId;
}

pub trait WebGLBindable {
    fn bind(&self);
}

pub trait WebGLDeletable {
    fn delete(&self);
}
```

But I'd want to know your opinion first.

**`renderer` repetition**:
Thought of moving the field: `renderer: Sender<CanvasMsg>` to `WebGLObject`, but I think it makes it way more complicated to read, and also a bit unnecessary, at least IMO (`WebGLObject` will never interact with the field directly). It would also mean that all `WebGLObject`s should have one, which is true at this moment, but maybe not with WebGL 2, for example.

Source-Repo: https://github.com/servo/servo
Source-Revision: 0f8095b950dd144497919cfea65a1f154ed3ae9a
2015-07-06 09:12:59 -06:00
Michael Wu 7512d04e93 servo: Merge #6150 - Upgrade to Spidermonkey 39 (from servo:smupgrade3); r=mbrubeck
> Here it is.
>
> ~~There's two major things that are unfinished here:~~
> - ~~Dealing with the unroot_must_root lint. I'm not sure about the value of this lint with the new rooting API.~~ Done.
> - ~~Updating the Cargo.locks to point to the new SM and SM binding.~~ Done.
>
> I also included my fixes for the rust update, but these will disappear in a rebase. A rust update is necessary to support calling `Drop` on `Heap<T>` correctly when `Heap<T>` is inside a `Rc<T>`. Otherwise `&self` points to the wrong location.
>
> Incremental GC is disabled here. I'm not sure how to deal with the incremental barriers so that's left for later.
>
> Generational GC works. SM doesn't work without it.
>
> The biggest change here is to the rooting API. `Root` was made movable, and `Temporary` and `JSRef` was removed. Movable `Root`s means there's no need for `Temporary`, and `JSRef`s aren't needed generally since it can be assumed that being able to obtain a reference to a dom object means it's already rooted. References have their lifetime bound to the Roots that provided them. DOM objects that haven't passed through `reflect_dom_object` don't need to be rooted, and DOM objects that have passed through `reflect_dom_object` can't be obtained without being rooted through `native_from_reflector_jsmanaged` or `JS::<T>::root()`.
>
> Support for `Heap<T>` ended up messier than I expected. It's split into two commits, but only because it's a bit difficult to fold them together. Supporting `Heap<T>` properly requires that that `Heap::<T>::set()` be called on something that won't move. I removed the Copy and Clone trait from `Heap<T>` so `Cell` can't hold `Heap<T>` - only `UnsafeCell` can hold it.
>
> `CallbackObject` is a bit tricky - I moved all callbacks into `Rc<T>` in order to make sure that the pointer inside to a `*mut JSObject` doesn't move. This is necessary for supporting `Heap<T>`.
>
> `RootedCollectionSet` is very general purpose now. Anything with `JSTraceable` can be rooted by `RootedCollectionSet`/`RootedTraceable`. Right now, `RootedTraceable` is only used to hold down dom objects before they're fully attached to their reflector. I had to make a custom mechanism to dispatch the trace call - couldn't figure out how to get trait objects working for this case.
>
> This has been tested with the following zeal settings:
>
> GC after every allocation
> JS_GC_ZEAL=2,1
>
> GC after every 100 allocations (important for catching use-after-free bugs)
> JS_GC_ZEAL=2,100
>
> Verify pre barriers
> JS_GC_ZEAL=4,1
>
> Verify post barriers
> JS_GC_ZEAL=11,1

Source-Repo: https://github.com/servo/servo
Source-Revision: e7808c526c348fea5e3b48af70b7f1a066652097
2015-06-19 16:46:55 -06:00
ecoal95 ed9a142a22 servo: Merge #6293 - Implement new WebGL interfaces and methods (from emilio:webgl-objects); r=nox
This commit implements:
* WebGLFramebuffer
* WebGLRenderbuffer
* WebGLTexture

And adds the following methods to `WebGLRenderingContext`:
* create{Texture,Framebuffer,Renderbuffer}
* bind{Texture,Framebuffer,Renderbuffer}
* destroy{Buffer,Texture,Framebuffer,Renderbuffer}

Fixes:
* WebGLUniform location shouldn't inherit from WebGLObject.

Known Issues:
* WebGL objects have to be destroyed on drop, we may want to keep a reference to the context, or maybe a clone of the renderer to achieve this

Also refactors a huge part of the current implementation, to allow
failing on creation of different WebGL objects.

Blocked on https://github.com/servo/gleam/pull/22

A reftest for most of the added functionality is not doable right now,
we need a few more functions in order to upload a texture, for example.

Source-Repo: https://github.com/servo/servo
Source-Revision: e09c555a41b0803388e54013ac8885fb789a0fa6
2015-06-09 10:06:37 -05:00