This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define VRB_LOG(format, ...) __android_log_print(ANDROID_LOG_INFO, "VRB", format, ##__VA_ARGS__); | |
static already_AddRefed<SharedSurfaceTextureClient> | |
CloneSurface(gl::SharedSurface* src, gl::SurfaceFactory* factory) | |
{ | |
RefPtr<SharedSurfaceTextureClient> dest = factory->NewTexClient(src->mSize); | |
if (!dest) { | |
return nullptr; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Android SurfaceView initialization example | |
void init(final Activity activity) { | |
mSurfaceView = new SurfaceView(activity); | |
mSurfaceView.getHolder().addCallback(OVRService.this); | |
// Enabling setZOrderOnTop is very important! If not enabled a single swap_buffers | |
// on the NativeActivity's window will make the SurfaceView invisible. | |
mSurfaceView.setZOrderOnTop(true); | |
activity.getApplication().registerActivityLifecycleCallbacks(OVRService.this); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn submit_frame(&mut self, layer: &VRLayer) { | |
let mut frame_params = ovr::helpers::vrapi_DefaultFrameParms(self.render_ovr_java.handle(), | |
ovr::ovrFrameInit::VRAPI_FRAME_INIT_DEFAULT, | |
self.predicted_display_time, | |
ptr::null_mut()); | |
frame_params.FrameIndex = self.frame_index; | |
let eye_projection = self.eye_projection.get(); | |
for (i, eye) in self.eye_framebuffers.iter_mut().enumerate() { | |
let swap_chain_index = (self.frame_index % eye.swap_chain_length as i64) as i32; |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------- beginning of system | |
07-03 16:58:41.761 447 455 I QISL : QSEE Interrupt Service Listener Thread is started | |
07-03 16:58:41.762 447 455 I QISL : QSEE Interrupt Service Listener was activated successfully | |
07-03 16:58:43.880 545 545 I vold : Vold 3.0 (the awakening) firing up | |
07-03 16:58:43.888 545 545 V vold : Detected support for: ext4 vfat | |
07-03 16:58:43.942 545 552 I vold : e4crypt_initialize_global_de | |
07-03 16:58:44.149 545 552 D vold : Added key 353542628 (ext4:5a0dc95cb48db9de) to keyring 936389460 in process 545 | |
07-03 16:58:44.204 545 552 D vold : e4crypt_init_user0 | |
07-03 16:58:44.204 545 552 D vold : Preparing: /data/misc/vold/user_keys | |
07-03 16:58:44.205 545 552 D vold : Preparing: /data/misc/vold/user_keys/ce |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub trait VRGamepad { | |
fn id(&self) -> u32; | |
// Constant data for the gamepad. | |
fn data(&self) -> VRGamepadData; | |
// Data that should be polled every frame. | |
fn state(&self) -> VRGamepadState; | |
} | |
pub struct VRGamepadState { | |
pub connected: bool, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if self.fbo_texture != layer.texture_id { | |
// Attach external texture to the used later in BlitFramebuffer. | |
gl::BindFramebuffer(gl::FRAMEBUFFER, self.fbo_id); | |
gl::FramebufferTexture2D(gl::FRAMEBUFFER, gl::COLOR_ATTACHMENT0, gl::TEXTURE_2D, layer.texture_id, 0); | |
self.fbo_texture = layer.texture_id; | |
} | |
let texture_size = layer.texture_size.unwrap_or_else(|| { | |
(self.render_size.width as u32, self.render_size.height as u32) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
getWindow().takeSurface(null); | |
FrameLayout layout = new FrameLayout(this); | |
layout.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, | |
FrameLayout.LayoutParams.MATCH_PARENT)); | |
SurfaceView nativeSurface = new SurfaceView(this); | |
nativeSurface.getHolder().addCallback(this); | |
layout.addView(nativeSurface, new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, | |
FrameLayout.LayoutParams.MATCH_PARENT)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Creates a typed JS array from a Rust slice | |
pub fn slice_to_array_buffer_view<T>(cx: *mut JSContext, data: &[T]) -> *mut JSObject | |
where T: ArrayBufferViewContents | |
{ | |
unsafe { | |
let js_object = T::new(cx, data.len() as u32); | |
assert!(!js_object.is_null()); | |
update_array_buffer_view(js_object, data); | |
js_object | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[dom_struct] | |
pub struct VRDisplay { | |
eventtarget: EventTarget, | |
#[ignore_heap_size_of = "Defined in rust-webvr"] | |
display: DOMRefCell<WebVRDisplayData>, | |
depth_near: Cell<f64>, | |
depth_far: Cell<f64>, | |
presenting: Cell<bool>, | |
left_eye_params: MutHeap<JS<VREyeParameters>>, | |
right_eye_params: MutHeap<JS<VREyeParameters>>, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub enum VRCompositorCommand { | |
Create(VRCompositorId), | |
SyncPoses(VRCompositorId, f64, f64, IpcSender<Result<Vec<u8>,()>>), | |
SubmitFrame(VRCompositorId, [f32; 4], [f32; 4]), | |
Release(VRCompositorId) | |
} |
NewerOlder