Skip to content

Instantly share code, notes, and snippets.

Lars Bergstrom larsbergstrom

Block or report user

Report or block larsbergstrom

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Oculus better recording
// Each value can be set independently meaning you can change resolution without changing FPS and vice versa
// we default to(1024x1024 @ 60fps w/ 5000000 bitrate (5Mbps) in the absence of setprops
adb shell setprop debug.oculus.capture.width 1920
adb shell setprop debug.oculus.capture.height 1080
adb shell setprop debug.oculus.capture.fps 30
adb shell setprop debug.oculus.capture.bitrate 10000000
// You probably want to change the FOV to match the 1080p resolution as well:
adb shell setprop debug.oculus.eyeFovDown 39
adb shell setprop debug.oculus.eyeFovUp 38
adb shell setprop debug.oculus.eyeFovOutward 50
View notes from bobby
At a high level, not very hard to lift and put in servo (despite not touching in 2 years)
Nicely asynchronous
Depends a bit on XPCOM threading stuff, but most of the explicit stuff is non-XPCOM
May want to pull in or not, as needed
abstraction boundray is between media decoder and HTMLMediaelement
it's teh main-thread media state stuff
that communicates with the HTMLMediaElement
the decoder is then async with the state machine on its own thread
and the decoder itself has async links with all the platform stuff
which is all under it
View gist:7ef6c1dde9ec5a436474
Compiling servo v0.0.1 (file:///run/shm/tmp/servo/components/servo)
error: linking with `cc` failed: exit code: 1
note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/ubuntu/.servo/rust/2016-01-31/rustc-nightly-x86_64-unknown-linux-gnu/rustc/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/run/shm/tmp/servo/target/debug/servo.0.o" "-o" "/run/shm/tmp/servo/target/debug/servo" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/run/shm/tmp/servo/target/debug" "-L" "/run/shm/tmp/servo/target/debug/deps" "-L" "/run/shm/tmp/servo/target/debug/build/angle-ee9dc8911de0d6f3/out" "-L" "/run/shm/tmp/servo/target/debug/build/azure-619033e514f5eadc/out" "-L" "/usr/lib/x86_64-linux-gnu" "-L" "/run/shm/tmp/servo/target/debug/build/harfbuzz-sys-14497f51d6b45da3/out/lib" "-L" "/run/shm/tmp/servo/target/debug/build/hbs-pow-sys-cf8ae81d4cf55502/out/_build/lib" "-L" "/run/shm/tmp/servo/target/debug/build/js-b63ddf1f18d33225/out" "-L" "/usr/lib/x86_64-linux-gnu" "-L" "/run/shm/tmp/servo/target/debug/build/miniz-sys-
View gist:e2071c2d498abc579c67
Compiling servo v0.0.1 (file:///run/shm/tmp/servo/components/servo)
error: linking with `cc` failed: exit code: 1
note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/ubuntu/.servo/rust/2016-01-31/rustc-nightly-x86_64-unknown-linux-gnu/rustc/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/run/shm/tmp/servo/target/debug/servo.0.o" "-o" "/run/shm/tmp/servo/target/debug/servo" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/run/shm/tmp/servo/target/debug" "-L" "/run/shm/tmp/servo/target/debug/deps" "-L" "/run/shm/tmp/servo/target/debug/build/angle-ee9dc8911de0d6f3/out" "-L" "/run/shm/tmp/servo/target/debug/build/azure-619033e514f5eadc/out" "-L" "/usr/lib/x86_64-linux-gnu" "-L" "/run/shm/tmp/servo/target/debug/build/harfbuzz-sys-14497f51d6b45da3/out/lib" "-L" "/run/shm/tmp/servo/target/debug/build/hbs-pow-sys-cf8ae81d4cf55502/out/_build/lib" "-L" "/run/shm/tmp/servo/target/debug/build/js-b63ddf1f18d33225/out" "-L" "/usr/lib/x86_64-linux-gnu" "-L" "/run/shm/tmp/servo/target/debug/build/miniz-sys-
View gist:54d9fc2169ff93896a12
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for x86_64-pc-linux-gnu
Reading makefiles...
Reading makefile `makefile.cargo'...
Updating goal targets....
View gist:615fec7313452d0dd480
The goal of this exercise is to see how to debug a `panic` in Servo (the equivalent of an uncaught exception in C++).
First, run Servo and see the crash in Google Maps by doing:
./mach run -d https://maps.google.com
To run the debugger, we need to call it directly (use lldb below on OSX but gdb in its place on Linux):
lldb target/debug/servo https://maps.google.com
Set a breakpoint on the `rust_panic` function, which is what is called when a panic occurs in Rust:
b rust_panic
View gist:9539dae389987037ac17
# agenda
- painting tiles in parallel
- per-tile display lists
- avoid painting
- omtc

# per-tile display lists
@larsbergstrom
larsbergstrom / Instructions
Last active Aug 29, 2015
Servo Layout Exercise
View Instructions
Reproduce a failing CSS test locally:
./mach test-css tests/wpt/css-tests/css21_dev/html4/background-color-088.htm --log-raw out.log
Open in the Gecko reftest analyzer to see the failure graphically:
http://hoppipolla.co.uk/410/reftest-analyser-structured.xhtml
(click on the test name, then mouse over the squares to see the different pixels, though it should be pretty obvious in this case).
Looking at the file and the spec (http://www.w3.org/TR/CSS2/syndata.html#value-def-color), what is the likely problem?
Extra exercise:
@larsbergstrom
larsbergstrom / Instructions
Last active Aug 29, 2015
Servo Script Exercise 1
View Instructions
Implement the `mouseover` event in Servo.
Description:
https://developer.mozilla.org/en-US/docs/Web/Events/mouseover
Copy the HTML below locally and run it:
./mach run -d test.html
Notice that mousing over the second div does not change its background color in Servo!
View gist:48acfe00515ac491cd08
larsberg@ubuntu:~/servo/build$ make VERBOSE=1
cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE)
CFLAGS="-O2" RUSTFLAGS="-D unused-imports -g -L /home/larsberg/servo/build/workspace/lib/x86_64-unknown-linux-gnu -L /home/larsberg/servo/build/x86_64-unknown-linux-gnu/src/support/glfw/glfw -L /home/larsberg/servo/build/x86_64-unknown-linux-gnu/src/support/glfw/glfw/.libs -L /home/larsberg/servo/build/x86_64-unknown-linux-gnu/src/support/glfw/glfw/src/.libs -L /home/larsberg/servo/build/x86_64-unknown-linux-gnu/src/ -L /home/larsberg/servo/build/x86_64-unknown-linux-gnu/src//.libs -L /home/larsberg/servo/build/x86_64-unknown-linux-gnu/src//src/.libs" EXT_DEPS="/home/larsberg/servo/build/x86_64-unknown-linux-gnu/src/support/glfw/glfw/lib*.dummy /home/larsberg/servo/build/x86_64-unknown-linux-gnu//rust_snapshot/rust-0.11.0-pre-x86_64-unknown-linux-gnu/bin/rustc" CC=/usr/bin/gcc CXX=/usr/bin/g++ LD=/usr/bin/ld AR=/usr/bin/ar make -C /home/larsberg/servo/build/x86_64-unknown-linux-gnu/src/support/glfw/glfw-rs
You can’t perform that action at this time.