Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
MortimerGoro committed Aug 15, 2017
1 parent 36b5f54 commit 9eaeaa3
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 27 deletions.
81 changes: 71 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@ opt-level = 3
# debug = true
# lto = false

[patch.crates-io]
#[patch.crates-io]
# If you need to temporarily test Servo with a local fork of some upstream
# crate, add that here. Use the form:
#
# <crate> = { path = "/path/to/local/checkout" }

[replace]
"rust-webvr:0.6.1" = { path = "/home/mortimer/Projects/rust-webvr" }
"https://github.com/servo/webrender#0.48.0" = { path = '/home/mortimer/Projects/1ec6fb9/webrender' }
"https://github.com/servo/webrender#webrender_api:0.48.0" = { path = '/home/mortimer/Projects/1ec6fb9/webrender_api' }
"offscreen_gl_context:0.11.0" = { path = "/home/mortimer/Projects/rust-offscreen-rendering-context" }
9 changes: 5 additions & 4 deletions components/canvas/webgl_thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ impl<VR: WebVRRenderHandler + 'static, OB: WebGLThreadObserver> WebGLThread<VR,
let result = self.gl_factory.new_shared_context(size, attributes)
.map(|r| (r, WebGLContextShareMode::SharedTexture))
.or_else(|_| {
panic!("readback");
let ctx = self.gl_factory.new_context(size, attributes);
ctx.map(|r| (r, WebGLContextShareMode::Readback))
});
Expand Down Expand Up @@ -502,8 +503,8 @@ impl<T: WebGLExternalImageApi> webrender::ExternalImageHandler for WebGLExternal
webrender::ExternalImage {
u0: 0.0,
u1: size.width as f32,
v1: 0.0,
v0: size.height as f32,
v0: 0.0,
v1: size.height as f32,
source: webrender::ExternalImageSource::NativeTexture(texture_id),
}

Expand Down Expand Up @@ -763,8 +764,8 @@ impl WebGLImpl {

// TODO: update test expectations in order to enable debug assertions
//if cfg!(debug_assertions) {
let error = ctx.gl().get_error();
assert!(error == gl::NO_ERROR, "Unexpected WebGL error: 0x{:x} ({})", error, error);
//let error = ctx.gl().get_error();
//assert!(error == gl::NO_ERROR, "Unexpected WebGL error: 0x{:x} ({})", error, error);
//}
}

Expand Down
4 changes: 2 additions & 2 deletions components/script/dom/webglrenderingcontext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,10 @@ impl WebGLRenderingContext {
// NativeContext handling library changes the scissor after a resize, so we need to reset the
// default scissor when the canvas was created or the last scissor that the user set.
let rect = self.current_scissor.get();
self.send_comand(WebGLCommand::Scissor(rect.0, rect.1, rect.2, rect.3));
self.send_command(WebGLCommand::Scissor(rect.0, rect.1, rect.2, rect.3));

if let Some(id) = self.bound_texture_2d.get() {
self.send_comand(WebGLCommand::BindTexture(constants::TEXTURE_2D, Some(id.id())));
self.send_command(WebGLCommand::BindTexture(constants::TEXTURE_2D, Some(id.id())));
}
}

Expand Down
2 changes: 1 addition & 1 deletion components/webvr_traits/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ path = "lib.rs"
[dependencies]
ipc-channel = "0.8"
msg = {path = "../msg"}
rust-webvr = {version = "0.5", features = ["serde-serialization"]}
rust-webvr = {version = "0.6", features = ["serde-serialization", "oculusvr"]}
serde = "1.0"
8 changes: 5 additions & 3 deletions support/android/apk/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,11 @@ android {
}

dependencies {
compile 'com.google.vr:sdk-base:1.30.0'
compile 'com.google.vr:sdk-audio:1.30.0'
compile project(':GVRService')
//compile 'com.google.vr:sdk-base:1.30.0'
//compile 'com.google.vr:sdk-audio:1.30.0'
//compile project(':GVRService')

compile project(':OVRService')

//Dependency list
def deps = [
Expand Down
3 changes: 1 addition & 2 deletions support/android/apk/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>

<application android:label="Servo" android:icon="@mipmap/servo">
<meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only"/>
<activity android:name=".MainActivity"
android:label="Servo"
android:launchMode="singleTop"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden|screenSize"
android:enableVrMode="@string/gvr_vr_mode_component"
android:resizeableActivity="false">
<meta-data android:name="android.app.lib_name" android:value="servo" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="com.google.intent.category.DAYDREAM"/>
</intent-filter>

<!-- Web browser intents -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ public class MainActivity extends android.app.NativeActivity {
Log.i(LOGTAG, "Loading the NativeActivity");

// Libaries should be loaded in reverse dependency order
System.loadLibrary("gvr");
System.loadLibrary("gvr_audio");
//System.loadLibrary("gvr");
//System.loadLibrary("gvr_audio");
System.loadLibrary("vrapi");
System.loadLibrary("c++_shared");
System.loadLibrary("servo");
}
Expand Down
6 changes: 4 additions & 2 deletions support/android/apk/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include ':app'
include ':GVRService'
project(':GVRService').projectDir = new File('/home/mortimer/Projects/rust-webvr/src/api/googlevr/gradle')
//include ':GVRService'
//project(':GVRService').projectDir = new File('/home/mortimer/Projects/rust-webvr/src/api/googlevr/gradle')
include ':OVRService'
project(':OVRService').projectDir = new File('/home/mortimer/Projects/rust-webvr/src/api/oculusvr/gradle')

0 comments on commit 9eaeaa3

Please sign in to comment.