Skip to content

Commit 9eaeaa3

Browse files
committed
wip
1 parent 36b5f54 commit 9eaeaa3

File tree

9 files changed

+99
-27
lines changed

9 files changed

+99
-27
lines changed

Cargo.lock

Lines changed: 71 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,14 @@ opt-level = 3
1414
# debug = true
1515
# lto = false
1616

17-
[patch.crates-io]
17+
#[patch.crates-io]
1818
# If you need to temporarily test Servo with a local fork of some upstream
1919
# crate, add that here. Use the form:
2020
#
2121
# <crate> = { path = "/path/to/local/checkout" }
22+
23+
[replace]
24+
"rust-webvr:0.6.1" = { path = "/home/mortimer/Projects/rust-webvr" }
25+
"https://github.com/servo/webrender#0.48.0" = { path = '/home/mortimer/Projects/1ec6fb9/webrender' }
26+
"https://github.com/servo/webrender#webrender_api:0.48.0" = { path = '/home/mortimer/Projects/1ec6fb9/webrender_api' }
27+
"offscreen_gl_context:0.11.0" = { path = "/home/mortimer/Projects/rust-offscreen-rendering-context" }

components/canvas/webgl_thread.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ impl<VR: WebVRRenderHandler + 'static, OB: WebGLThreadObserver> WebGLThread<VR,
195195
let result = self.gl_factory.new_shared_context(size, attributes)
196196
.map(|r| (r, WebGLContextShareMode::SharedTexture))
197197
.or_else(|_| {
198+
panic!("readback");
198199
let ctx = self.gl_factory.new_context(size, attributes);
199200
ctx.map(|r| (r, WebGLContextShareMode::Readback))
200201
});
@@ -502,8 +503,8 @@ impl<T: WebGLExternalImageApi> webrender::ExternalImageHandler for WebGLExternal
502503
webrender::ExternalImage {
503504
u0: 0.0,
504505
u1: size.width as f32,
505-
v1: 0.0,
506-
v0: size.height as f32,
506+
v0: 0.0,
507+
v1: size.height as f32,
507508
source: webrender::ExternalImageSource::NativeTexture(texture_id),
508509
}
509510

@@ -763,8 +764,8 @@ impl WebGLImpl {
763764

764765
// TODO: update test expectations in order to enable debug assertions
765766
//if cfg!(debug_assertions) {
766-
let error = ctx.gl().get_error();
767-
assert!(error == gl::NO_ERROR, "Unexpected WebGL error: 0x{:x} ({})", error, error);
767+
//let error = ctx.gl().get_error();
768+
//assert!(error == gl::NO_ERROR, "Unexpected WebGL error: 0x{:x} ({})", error, error);
768769
//}
769770
}
770771

components/script/dom/webglrenderingcontext.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,10 @@ impl WebGLRenderingContext {
278278
// NativeContext handling library changes the scissor after a resize, so we need to reset the
279279
// default scissor when the canvas was created or the last scissor that the user set.
280280
let rect = self.current_scissor.get();
281-
self.send_comand(WebGLCommand::Scissor(rect.0, rect.1, rect.2, rect.3));
281+
self.send_command(WebGLCommand::Scissor(rect.0, rect.1, rect.2, rect.3));
282282

283283
if let Some(id) = self.bound_texture_2d.get() {
284-
self.send_comand(WebGLCommand::BindTexture(constants::TEXTURE_2D, Some(id.id())));
284+
self.send_command(WebGLCommand::BindTexture(constants::TEXTURE_2D, Some(id.id())));
285285
}
286286
}
287287

components/webvr_traits/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ path = "lib.rs"
1212
[dependencies]
1313
ipc-channel = "0.8"
1414
msg = {path = "../msg"}
15-
rust-webvr = {version = "0.5", features = ["serde-serialization"]}
15+
rust-webvr = {version = "0.6", features = ["serde-serialization", "oculusvr"]}
1616
serde = "1.0"

support/android/apk/app/build.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,11 @@ android {
175175
}
176176

177177
dependencies {
178-
compile 'com.google.vr:sdk-base:1.30.0'
179-
compile 'com.google.vr:sdk-audio:1.30.0'
180-
compile project(':GVRService')
178+
//compile 'com.google.vr:sdk-base:1.30.0'
179+
//compile 'com.google.vr:sdk-audio:1.30.0'
180+
//compile project(':GVRService')
181+
182+
compile project(':OVRService')
181183

182184
//Dependency list
183185
def deps = [

support/android/apk/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,17 @@
1212
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
1313

1414
<application android:label="Servo" android:icon="@mipmap/servo">
15+
<meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only"/>
1516
<activity android:name=".MainActivity"
1617
android:label="Servo"
1718
android:launchMode="singleTop"
1819
android:screenOrientation="landscape"
1920
android:configChanges="orientation|keyboardHidden|screenSize"
20-
android:enableVrMode="@string/gvr_vr_mode_component"
2121
android:resizeableActivity="false">
2222
<meta-data android:name="android.app.lib_name" android:value="servo" />
2323
<intent-filter>
2424
<action android:name="android.intent.action.MAIN" />
2525
<category android:name="android.intent.category.LAUNCHER" />
26-
<category android:name="com.google.intent.category.DAYDREAM"/>
2726
</intent-filter>
2827

2928
<!-- Web browser intents -->

support/android/apk/app/src/main/java/com/mozilla/servo/MainActivity.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ public class MainActivity extends android.app.NativeActivity {
4646
Log.i(LOGTAG, "Loading the NativeActivity");
4747

4848
// Libaries should be loaded in reverse dependency order
49-
System.loadLibrary("gvr");
50-
System.loadLibrary("gvr_audio");
49+
//System.loadLibrary("gvr");
50+
//System.loadLibrary("gvr_audio");
51+
System.loadLibrary("vrapi");
5152
System.loadLibrary("c++_shared");
5253
System.loadLibrary("servo");
5354
}

support/android/apk/settings.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
include ':app'
2-
include ':GVRService'
3-
project(':GVRService').projectDir = new File('/home/mortimer/Projects/rust-webvr/src/api/googlevr/gradle')
2+
//include ':GVRService'
3+
//project(':GVRService').projectDir = new File('/home/mortimer/Projects/rust-webvr/src/api/googlevr/gradle')
4+
include ':OVRService'
5+
project(':OVRService').projectDir = new File('/home/mortimer/Projects/rust-webvr/src/api/oculusvr/gradle')

0 commit comments

Comments
 (0)