Commit graph

71 commits

Author SHA1 Message Date
Simon Sapin
bea73951db Use #![register_tool] instead of #![register_attr]
CC https://github.com/rust-lang/rust/issues/66079
2019-11-15 17:24:42 +01:00
bors-servo
56537fad58
Auto merge of #24616 - teapotd:imageinfo-option-refactoring, r=jdm
Store Option<ImageInfo> instead of making fields of ImageInfo optional

Fixes #24582

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #24582
- [X] These changes do not require tests
2019-11-01 20:13:59 -04:00
teapotd
a4fa36f9fb Store Option<ImageInfo> instead of making fields optional 2019-11-01 14:48:16 +01:00
Patrick Walton
a358bca766 Use surfman for managing GL surfaces
Co-authored-by: Alan Jeffrey <ajeffrey@mozilla.com>
Co-authored-by: Zakor Gyula <gyula.zakor@h-lab.eu>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2019-11-01 08:47:11 -05:00
Josh Matthews
ea715a7a4c webgl: Update framebuffer completion status when attached renderbuffer/texture storage changes. 2019-09-23 12:01:08 -04:00
Josh Matthews
7e4cf13f5b webgl: Support RGB color attachments for complete framebuffers. 2019-09-20 01:28:22 -04:00
Josh Matthews
8f5c37c0b5 Don't panic if WebGL thread can't be reached during finalization. 2019-07-29 10:09:24 -04:00
Simon Sapin
be69f9c3e6 Rustfmt has changed its default style :/ 2018-12-28 13:17:47 +01:00
Jan Andre Ikenmeyer
a1a14459c1
Update MPL license to https (part 3) 2018-11-19 14:47:12 +01:00
Pyfisch
9e92eb205a Reorder imports 2018-11-06 22:35:07 +01:00
Simon Sapin
45f7199eee cargo fix --edition 2018-11-06 15:26:02 +01:00
chansuke
c37a345dc9 Format script component 2018-09-19 17:40:47 -04:00
Josh Matthews
59b8f971b5 webgl: Mark framebuffers as uninitialized when their attached renderbuffer's storage changes. 2018-09-14 16:17:47 -04:00
Josh Matthews
4edb7b194c webgl: Remove knowledge of attached framebuffers from renderbuffers and textures. 2018-09-10 16:31:33 -04:00
Josh Matthews
8ede221a83 webgl: Ensure that renderbuffers have been bound before attaching to a framebuffer. 2018-09-10 16:31:31 -04:00
Josh Matthews
bb8d9ba74c webgl: Ensure that depth and stencil attachments are rebound after messing with DEPTH_STENCIL attachments. 2018-09-10 16:31:30 -04:00
Josh Matthews
1b08dd5232 webgl: Move framebuffer initialization logic to WebGL thread. 2018-09-10 16:31:29 -04:00
Josh Matthews
df8e36aa78 webgl: Differentiate between missing colour attachments and incomplete attachments. 2018-09-10 16:31:28 -04:00
Josh Matthews
690c98dda7 webgl: return missing attachment status from framebuffers with no attachments. 2018-09-10 15:56:17 -04:00
Josh Matthews
da3b0ef88f webgl: Clear renderbuffers on first read/write operation. 2018-09-10 15:56:16 -04:00
Josh Matthews
944d1d1f29 webgl: Check internal format of textures when determining attachment completeness. 2018-09-10 15:56:16 -04:00
Josh Matthews
d179435eab webgl: Ensure that framebuffers have a color attachment before reading or writing. 2018-09-10 15:56:15 -04:00
Josh Matthews
80ed829241 webgl: Mark framebuffers as incomplete if attachments do not meet format requirements. 2018-09-10 15:54:41 -04:00
Josh Matthews
3334e477c1 webgl: Mark zero-sized framebuffers as incomplete attachments. 2018-08-01 15:40:46 -04:00
Anthony Ramine
661e258b28 Store a reference to the WebGLRenderingContext in WebGLObject 2018-07-24 13:27:33 +02:00
Igor Gutorov
ee5bdbbd8b Implement WebGL getFramebufferAttachmentParameter API 2018-03-22 18:26:18 +02: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
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
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
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
Martin Robinson
e58e8ab42e Upgrade to the latest version of WebRender 2017-07-13 07:44:08 +10:00
Anthony Ramine
31e9d81c0f Make #[dom_struct] a proc_macro attribute 2017-02-24 01:50:51 +01:00
Anthony Ramine
1327ebd52f Remove HeapGCValue
It could be used to have mutable JSVal fields without GC barriers.
With the removal of that trait, MutHeap and MutNullableHeap can respectively
be replaced by MutJS and MutNullableJS.
2016-12-12 10:47:54 -10:00
Anthony Ramine
8af2327e95 Expose WebGL-related interfaces only in Window 2016-11-30 23:23:39 +01:00
Gregory
fb98acbc4d update deps
switch to using webrender_traits::ImageData

update use of webrender_traits::StackingContext in layout

use webrender_traits::channel::msg_channel in webgl ipc

fix use of resource_override_path in components/servo/lib
2016-11-22 07:46:42 +10:00
Eric Anholt
eaec5de184 webgl: Only update FBO status once in framebufferTexture2D().
We update it below after we send the actual FramebufferTexture2D
command to the GL.
2016-11-05 11:49:31 -07:00
Eric Anholt
5e5eb18b0b webgl: Fix out-of-bounds readpixels handling.
This fixes the crash in read-pixels-pack-alignment (which was trying
to read out of bounds).

Fixes #13901
2016-11-05 11:49:30 -07:00
Eric Anholt
3277c5281c webgl: Validate that framebuffer attachment sizes match.
This is required by the WebGL spec, and we need to figure out the FB
size like this for validating ReadPixels.
2016-11-05 11:49:29 -07:00
Eric Anholt
d77373654a webgl: Update FBO status when textures or RBs are reallocated.
FBO status is supposed to depend on the size of the attachments all
matching, so we need to re-check when it changes.  We don't ensure
matching yet, but this will prevent regressions when we do.
2016-11-05 10:43:12 -07:00
Eric Anholt
8e681dddc1 webgl: Don't forget to update FBO status after detaching a texture.
We had this in the renderbuffer detach process, but missed it in this
one.
2016-11-05 10:31:41 -07:00
Eric Anholt
bf5a3db745 webgl: Don't update texture attachment state if we throw an error.
If we're going to return from this function without updating the
underlying GL state because of a WebGLError, we shouldn't have updated
our shadow of the GL state.
2016-11-05 10:30:40 -07:00
Eric Anholt
59634cf78e webgl: Track the level with texture attachments.
We need this to be able to get the size of the attached texture for
completeness validation.

Signed-off-by: Eric Anholt <eric@anholt.net>
2016-11-05 10:30:15 -07:00
Eric Anholt
71d266052b webgl: Re-check FBO status on binding an FBO.
When the FBO has been unbound, anything that happened to its
attachments (deletion, new binding, reallocation) may have caused it
to change status.

This doesn't change any test results currently, because we're not
checking if the attachments are deleted, the wrong size, or have
appropriate formats.
2016-10-25 22:19:29 -07:00
Eric Anholt
dba7d5eb51 webgl: Detach RBs and textures from the bound FBO on deletion.
This is part of general GL behavior: when an object is deleted, look
through the currently bound objects and detach the deleted object from
them.  Detaching an object from an FBO causes it to need to be
re-checked for its status.
2016-10-25 22:19:26 -07:00