Commit graph

33989 commits

Author SHA1 Message Date
bors-servo
c90737e6c8
Auto merge of #21118 - servo:webgl, r=emilio
Store vertex attribs data in DOM and optimise GetVertexAttrib

This is not an extremely useful change on its own but those things need to be stored on the DOM side to implement some draw checks anyway.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21118)
<!-- Reviewable:end -->
2018-07-05 08:21:45 -04:00
Anthony Ramine
15389586d9 Make gl.useProgram(null) do the right thing 2018-07-05 14:20:47 +02:00
Anthony Ramine
fc593c68c5 Store active attribs in DOM and optimise active attributes APIs 2018-07-05 14:20:47 +02:00
Anthony Ramine
0e2e834d18 Fix gl.linkProgram() signature 2018-07-05 14:20:47 +02:00
Anthony Ramine
cde6023ed4 Store vertex attribs data in DOM and optimise GetVertexAttrib 2018-07-05 14:20:47 +02:00
Anthony Ramine
0814bd6699 Rename VertexAttribs::set_from to VertexAttribs::clone_from 2018-07-05 14:20:47 +02:00
Anthony Ramine
0018e5e6ba Refactor some vertex attrib checks 2018-07-05 14:20:47 +02:00
Anthony Ramine
f108a3e797 Introduce VertexAttribData 2018-07-05 14:20:47 +02:00
Anthony Ramine
5d43f1c9bd Rename BoundAttribBuffers to VertexAttribs and make it store a slice 2018-07-05 14:20:44 +02:00
bors-servo
0125e96555
Auto merge of #21125 - servo:android-readme, r=paulrouget
Update README for Android

https://github.com/servo/servo/pull/21094 automates some things.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21125)
<!-- Reviewable:end -->
2018-07-05 01:11:37 -04:00
Simon Sapin
f0275d184b
Update README for Android
https://github.com/servo/servo/pull/21094 automates some things.
2018-07-04 20:30:50 +02:00
bors-servo
ce430566cd
Auto merge of #21087 - UK992:window-icon, r=asajeffrey
Add window icon on X11 and Windows

<!-- Please describe your changes on the following line: -->

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

<!-- Either: -->
- [ ] 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. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21087)
<!-- Reviewable:end -->
2018-07-04 02:45:25 -04:00
bors-servo
3c43fa6b1d
Auto merge of #21105 - Manishearth:dom-inheritance-assert, r=nox
Assert that DOM structs have the correct first field

Not having the right field can lead to fun bugs like https://github.com/ferjm/servo/pull/1 where the struct gets mis-reinterpreted as what should be its parent (but is not layout-wise)

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21105)
<!-- Reviewable:end -->
2018-07-03 12:52:12 -04:00
Manish Goregaokar
ad198993b1 Assert that DOM structs have the correct first field
DOM structs embed their parent type as their first field. This
introduces a `.parent()` method to the DOM struct that returns its first
field, and codegens a type assert that ensures that `.parent()` returns
the parent struct.

This generates:

On `#[dom_struct]`:

```rust
impl HasParent for Type {
    type Parent = ParentType;
    fn as_parent(&self) -> ParentType {
        &self.first_field
    }
}
```

In the codegen files:

```rust
impl Type {
    fn __assert_parent_type(&self) {
        let _: &ParentType = self.as_parent();
    }
}
````
2018-07-03 09:39:29 -07:00
UK992
3d577ba752 Update servo-tidy.yml 2018-07-03 06:14:24 +02:00
UK992
5185045389 Update Cargo.lock 2018-07-03 06:14:24 +02:00
paavininanda
5f77b60c3a Making getters and setters 2018-07-03 01:34:22 +05:30
bors-servo
1f9b07637e
Auto merge of #21094 - servo:bootstrap-android, r=paul
Add mach bootstrap-android and test-android-startup commands

This adds a `./mach boostrap-android` subcommand that downloads and installs the tools, SDK, NDK,  emulator, and system image for Android. In an environment that can build Servo at all, this should be enough to get all additional dependencies to cross-compile to Android, package an APK, and load it onto a device or an emulator.

At the moment it requires an interactive user to accept the license (and confirm no customization of the emulated virtual device hardware), and then prints environment variables to set for `mach` as well as the command to run to start the emulator (with an already-configured image). A possible next step could be to automate all this, and have `./mach build` run it automatically when needed. (I don’t know if auto-accepting the license is something we should do though.)

This also adds `--emulator` and `--usb` parameters to `./mach install --android` and `./mach run --android`, which tell `adb` what device to pick when both are present. And makes `./mach run --android` print the new process’s PID, for use with e.g. `adb -e logcat --pid 2263`.

Finally, adds the `./mach boostrap-android` subcommand which starts an emulator, installs the APK (it assumes that `mach build` and `mach package` were already executed), runs a single HTML test case, and checks for a message coming from JS through `console.log()` and `adb logcat`.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21094)
<!-- Reviewable:end -->
2018-07-02 13:02:07 -04:00
Simon Sapin
c0d1b8e808 Android: increase emulator disk size, for debug builds
Avoid INSTALL_FAILED_INSUFFICIENT_STORAGE on install.
2018-07-02 19:00:48 +02:00
Simon Sapin
eecbe83750 Add ./mach test-android-startup 2018-07-02 19:00:48 +02:00
Simon Sapin
bee3fd09c2 mach android-emulator: avoid mach error messages for Python exceptions 2018-07-02 19:00:48 +02:00
Simon Sapin
8293b295be bootstrap-android: check SHA1 hashes of downloaded archives 2018-07-02 19:00:48 +02:00
Simon Sapin
9e544c2aae Remove the egl-configs diagnostic program
It has served its purpose. If we ever need it again it’s in git history.
2018-07-02 19:00:48 +02:00
Simon Sapin
b6b9fe07e2 Add "./mach android-emulator" 2018-07-02 13:25:44 +02:00
Simon Sapin
fc77db4b09 Use the bootstraped Android toolchains by default 2018-07-02 13:25:44 +02:00
Simon Sapin
65122b10d3 bootstrap-android: always run sdkmanager
It is quick when already up to date
2018-07-02 13:25:44 +02:00
Simon Sapin
aa1c3cea2f bootstrap-android: use predictable paths for SDK and NDK
… independent of the version number
2018-07-02 13:25:44 +02:00
Simon Sapin
0e2e9cb019 Create emulator images for both ARM and x86 2018-07-02 13:25:44 +02:00
Simon Sapin
e54ad77594 Do not prompt for Android emulator hardware profile 2018-07-02 13:25:44 +02:00
Simon Sapin
f4d740f086 Typo fixes 2018-07-02 13:25:44 +02:00
Simon Sapin
b7a8b81071 egl-configs: add i686 support 2018-07-02 13:25:44 +02:00
Simon Sapin
7d7f2025b7 Fix copy/paste mistake 2018-07-02 13:25:44 +02:00
Simon Sapin
3c992af8a1 Remove debugging println from a year ago 2018-07-02 13:25:44 +02:00
Simon Sapin
484eee8624 Tidy 2018-07-02 13:25:44 +02:00
Simon Sapin
6e6870516e cargo run into Android/adb: configurable target device 2018-07-02 13:25:44 +02:00
Simon Sapin
1f8d04b8e1 egl-configs: print hex too 2018-07-02 13:25:44 +02:00
Simon Sapin
7e7316e766 egl-configs: print all config attributes 2018-07-02 13:25:44 +02:00
Simon Sapin
89f6c6dbf0 egl-configs: get the number of configs 2018-07-02 13:25:44 +02:00
Simon Sapin
90ba22b8d2 egl-configs: link to EGL and generate bindings 2018-07-02 13:25:44 +02:00
Simon Sapin
eab971cba1 Android cross-compiled command line hello world
`cargo run` Just Works®
2018-07-02 13:25:44 +02:00
Simon Sapin
4cbf3dea05 mach {package,install} --android: add --emulator and --usb 2018-07-02 13:25:44 +02:00
Simon Sapin
fe24816d12 mach run --android: show PID 2018-07-02 13:25:44 +02:00
Simon Sapin
8889742407 mach bootstrap-android: configure and show how to start an emulator 2018-07-02 13:25:44 +02:00
Simon Sapin
1ee54ab5fb Create and Android virtual device 2018-07-02 13:25:44 +02:00
Simon Sapin
244a332976 Use more recent Android tools
The older version seems to insist on updating itself when asked to install other components.
2018-07-02 13:25:44 +02:00
Simon Sapin
56df7f4220 Install complete Android SDK (as much as on Buildbot CI) 2018-07-02 13:25:44 +02:00
Simon Sapin
510cf1a2ab boostrap: set executable bits when extracting zip files 2018-07-02 13:25:44 +02:00
Simon Sapin
b9d5f11b20 Add ./mach bootstrap-android 2018-07-02 13:25:44 +02:00
OJ Kwon
e0699492db refactor(window): get hidpi factor from winit across platform 2018-07-01 14:13:26 +02:00
OJ Kwon
679af055e2 refactor(window): update to latest winit, glutin interface 2018-07-01 14:13:26 +02:00