mirror of
https://github.com/servo/servo.git
synced 2025-07-22 14:53:49 +01:00
auto merge of #3752 : pcwalton/servo/default-cpu, r=larsbergstrom
We've discussed this some and I think there's consensus to do it as a pragmatic decision for now. CPU painting is more stable, especially with buggy drivers, and faster (because we aren't caching the necessary OpenGL objects yet and possibly for other reasons), so it provides a better "out of the box" experience for newcomers to Servo who don't know to pass the `-c` option. This patch continues to reftest both Skia and Skia-GL out of a desire to keep options open. Skia-GL remains a first-class citizen. r? @metajack
This commit is contained in:
commit
1fd7650de5
4 changed files with 15 additions and 11 deletions
|
@ -29,9 +29,9 @@ pub struct Opts {
|
|||
/// FIXME(pcwalton): This is not currently used. All rendering is sequential.
|
||||
pub n_render_threads: uint,
|
||||
|
||||
/// True to use CPU painting, false to use GPU painting via Skia-GL (`-c`). Note that
|
||||
/// True to use GPU painting via Skia-GL, false to use CPU painting via Skia (`-g`). Note that
|
||||
/// compositing is always done on the GPU.
|
||||
pub cpu_painting: bool,
|
||||
pub gpu_painting: bool,
|
||||
|
||||
/// The maximum size of each tile in pixels (`-s`).
|
||||
pub tile_size: uint,
|
||||
|
@ -127,7 +127,8 @@ pub fn from_cmdline_args(args: &[String]) -> bool {
|
|||
let args = args.tail();
|
||||
|
||||
let opts = vec!(
|
||||
getopts::optflag("c", "cpu", "CPU rendering"),
|
||||
getopts::optflag("c", "cpu", "CPU painting (default)"),
|
||||
getopts::optflag("g", "gpu", "GPU painting"),
|
||||
getopts::optopt("o", "output", "Output file", "output.png"),
|
||||
getopts::optopt("r", "rendering", "Rendering backend", "direct2d|core-graphics|core-graphics-accelerated|cairo|skia."),
|
||||
getopts::optopt("s", "size", "Size of tiles", "512"),
|
||||
|
@ -197,7 +198,7 @@ pub fn from_cmdline_args(args: &[String]) -> bool {
|
|||
from_str(period.as_slice()).unwrap()
|
||||
});
|
||||
|
||||
let cpu_painting = FORCE_CPU_PAINTING || opt_match.opt_present("c");
|
||||
let gpu_painting = !FORCE_CPU_PAINTING && opt_match.opt_present("g");
|
||||
|
||||
let mut layout_threads: uint = match opt_match.opt_str("y") {
|
||||
Some(layout_threads_str) => from_str(layout_threads_str.as_slice()).unwrap(),
|
||||
|
@ -232,7 +233,7 @@ pub fn from_cmdline_args(args: &[String]) -> bool {
|
|||
let opts = Opts {
|
||||
urls: urls,
|
||||
n_render_threads: n_render_threads,
|
||||
cpu_painting: cpu_painting,
|
||||
gpu_painting: gpu_painting,
|
||||
tile_size: tile_size,
|
||||
device_pixels_per_px: device_pixels_per_px,
|
||||
time_profiler_period: time_profiler_period,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue