Commit graph

44 commits

Author SHA1 Message Date
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
Corey Farwell
449f6337d4 Rename Reflectable to DomObject.
Fixes https://github.com/servo/servo/issues/8473.
2016-12-08 08:50:35 -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
Anthony Ramine
d8e92bb271 Rename Reflectable::global_scope to global 2016-10-06 21:36:41 +02:00
Anthony Ramine
ae6af5172b Introduce Reflectable::global_scope 2016-10-06 21:35:38 +02:00
Anthony Ramine
fcb59d3057 Make reflect_dom_object take a &GlobalScope 2016-10-06 20:59:09 +02:00
Imanol Fernandez
a07d6b37cc Fix WebGL tests & Implement WebGLRenderingContext::{validateProgram, getProgramInfoLog, disableVertexAttribArray}, r=emilio 2016-10-03 16:17:19 +02:00
Eric Anholt
847ab63de6 webgl: Add isProgram() support.
There's one failure still, where a deleted program should still be
considered to be a program until it's unbound.  However, I recently
made it so that we unbind at delete time, and we may need to partially
back that change out.
2016-08-28 17:18:09 -07:00
Anthony Ramine
89a0b55c61 Use wrappers for GL IDs
See https://github.com/servo/webrender_traits/pull/62.
2016-06-28 20:11:55 +02:00
Anthony Ramine
cdc7bca944 Move DOMString back to script
This entirely removes the 'non-geckolib' feature of the util crate.
2016-05-24 10:54:57 +02:00
Daniel
8a5b0b8972 Implement IsShader fn and IsTexture fn for WebGLRenderingContext 2016-05-09 20:54:57 -04:00
bors-servo
f1defb446e Auto merge of #10443 - emilio:webgl-teximage2d-overload, r=jdm
webgl: Implement the pending texImage2D overload, and add more validation

This is a large-ish refactor of the Texture2D code, but it should be
easier to read and of course more correct.

I tried to annotate every error condition with a spec paragraph.

I made just a reftest to ensure this works as intended, since I expect #10373 to land pretty soon.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10443)
<!-- Reviewable:end -->
2016-04-22 11:25:29 -07:00
Emilio Cobos Álvarez
f470ad0d88
webgl: Refactor WebGLProgram::link
This makes it more correct, since we don't blindly send the Link
command. It's not observable though.
2016-04-19 13:25:45 +02:00
David Zbarsky
a67a744057 Prevent use of reserved names in BindAttribLocation 2016-04-17 11:52:40 -07:00
David Zbarsky
34644401c6 Implement GetActiveAttrib 2016-04-11 23:12:04 -07:00
Saurav Sachidanand
56eef10718 Implement WebGLRenderingContext.getActiveUniform() 2016-04-06 20:02:45 +05:30
Connor Brewster
3fd7634f54 webgl: finish, flush, detachShader, generateMipmap, Uniform1i 2016-04-02 12:31:47 -06:00
Jan-Fabian Humann
d778562844 #10211: Stop re-exporting webrender_traits WebGL types from canvas_traits 2016-03-30 20:05:16 +02:00
Emilio Cobos Álvarez
5ed93a5c4a Change old references of ecoal95 2016-03-23 18:12:40 +01:00
Emilio Cobos Álvarez
4092ffd245 webgl: Check shader compilation status on use_program. 2016-01-13 15:28:36 +01:00
Emilio Cobos Álvarez
221a583784 webgl: Track uniformlocation's program 2016-01-13 13:41:30 +01:00
David Zbarsky
0f4d6d58aa Implement various WebGL functions 2015-12-13 17:39:20 -08:00
Alan Jeffrey
84bde75b42 Replaced DOMString constructor by conversion functions.
Replaced DOMString(...) by DOMString::from(...).
Replaced ....0 by String::from(...).
Removed any uses of .to_owner() in DOMString::from("...").
2015-11-12 17:52:59 -06:00
Ms2ger
6b75078503 Make DOMString a newtype around String, rather than a typedef.
This should make it somewhat easier to experiment with alternative
representations in the future. To reduce churn, this commit leaves the String
field public, though.

Also, this will allow us to use the default String type to represent the IDL
USVString type, which explicitly forbids unpaired surrogates, ans as such is
a better match to the Rust String type.
2015-11-04 12:09:11 +01:00
rohan.prinja
6e774ea6eb merge from master 2015-11-03 19:01:23 +09:00
Emilio Cobos Álvarez
95a0d0584f webgl: Add destructors for texture, program, shader, buffer and framebuffer
This allows to cleanup resources earlier if they stop being used. Right
now all resources were cleaned up when the context was destroyed, this is
a slightly better approach.

We ignore the possible failure of the send() call, since we don't keep
track of these resources from the `WebGLRenderingContext` structure, so
a texture could be destroyed after the context and give us problems.
2015-11-01 13:39:20 +01:00
rohan.prinja
45224028db more refactoring 2015-10-30 20:26:29 +09:00
Eli Friedman
57584e74c6 Make get() and set() on MutNullableHeap use the correct types.
get() must always return a rooted value, because we have no way of
ensuring the value won't be invalidated. set() takes an &T because it's
convenient; there isn't any need to expose JS<T>.
2015-10-15 14:03:56 -07:00
Ravi Shankar
889eec364b sorted the extern crate, mod & use declarations 2015-09-24 02:12:45 +05:30
Brandon Fairchild
de3547e401 Fix reported test-tidy errors for unmerged import blocks
This merges import blocks that were reported by tidy as unmerged.
2015-09-19 12:50:14 -04:00
Anthony Ramine
c831c2c0a5 Remove helper traits
Now that JSRef<T> is gone, there is no need to have helper traits.

On components/script/*.rs:

    # Remove imports.
    /^ *use dom::[a-z]+::\{.*Helpers/ {
        s/\{(Raw[^L]|[^L][^a])[a-zA-Z]+Helpers, /\{/
        s/, (Raw[^L]|[^L][^a])[a-zA-Z]+Helpers([,}])/\2/g
        s/\{([a-zA-Z]+)\}/\1/
        /\{\}/d
        s/::self;$/;/
    }
    /^ *use dom::[a-z]+::\{?(Raw[^L]|[^L][^a])[a-zA-Z]+Helpers\}?;$/d

On components/script/dom/*.rs:

    # Ignore layout things.
    /^(pub )?(impl|trait).*Layout.* \{/,/^}$/ { P; D; }

    # Delete helpers traits.
    /^(pub )?trait ([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? \{$/,/^\}$/D

    # Patch private helpers.
    /^impl.*Private.*Helpers/,/^\}$/ {
        s/^impl<'a> Private([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? for &'a ([^ ]+) \{$/impl \3 {/
        /^ *(unsafe )?fn .*\(self.*[<&]'a/ {
            s/&'a /\&/g
            s/<'a, /</g
        }
        /^ *(unsafe )?fn /s/\(self([,)])/\(\&self\1/
    }

    # Patch public helpers.
    /^impl.*Helpers/,/^\}$/ {
        s/^impl(<'a>)? ([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? for (&'a )?([^ ]+) \{$/impl \5 {/
        /^ *(unsafe )?fn .*\(self.*[<&]'a/ {
            s/&'a /\&/g
            s/<'a, /</g
        }
        /^ *(unsafe )?fn .*\(&?self[,)]/s/(unsafe )?fn/pub &/
        /^ *pub (unsafe )?fn /s/\(self([,)])/\(\&self\1/
    }

The few error cases were then fixed by hand.
2015-08-27 16:59:02 +02:00
João Oliveira
fd87c8cb3e make dom_struct derive HeapSizeOf,
closes #7357
2015-08-27 01:17:48 +01:00
Johann Tuffe
ec07178b6f sort all uses 2015-08-20 20:47:12 +08:00
Bogdan Cuza
45145108da Measure heap memory usage for more types. Fixes #6951 2015-08-13 21:44:41 +03:00
Patrick Walton
bb99b2f3c8 script: Make most of 2D canvas and WebGL run over IPC.
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.
2015-07-25 00:50:12 -07:00
ecoal95
8438db89e1 address review comments 2015-07-06 23:02:51 +02:00
ecoal95
42bd43a696 webgl: Make bind* calls more spec-compliant 2015-07-06 19:54:06 +02:00
ecoal95
b1765c6882 webgl: Refactor implementation to move logic inside the DOM interfaces
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 want to keep track of them from the context).
2015-07-06 19:54:05 +02:00
Michael Wu
675267b782 Upgrade to SM 39 2015-06-19 18:42:48 -04:00
ecoal95
ad414824b2 Fix WebGL objects inheritance 2015-05-04 02:06:20 +02:00
Diego Marcos
79b8e7aa34 It implements enough WebGL spec to draw a triangle 2015-05-02 19:21:05 -07:00