Commit graph

355 commits

Author SHA1 Message Date
Tetsuharu OHZEKI
4d562f893c Rename TaskState::RENDER -> TaskState::PAINT 2014-12-08 14:25:08 +09:00
Timothy B. Terriberry
65575bf8a7 Change time::profile's meta booleans to enums.
This makes these parameters self-documenting.
This patch does not attempt to push those enums into the data
structures that feed calls to this function.

Fixes #4158.
2014-12-05 14:23:27 -08:00
Simon Sapin
2f413c8937 Move the servo crate from root to components/servo 2014-12-02 18:03:39 -08:00
Mike Blumenkrantz
0341444ce9 util::opts::default_opts() is now pub 2014-11-21 21:52:56 -05:00
Glenn Watson
898c1ecc8f Remove unused exit after load option.
This simplifies some upcoming changes to how event handling works.
2014-11-21 09:15:02 +10:00
Glenn Watson
0278920343 Add glutin port (supported on Linux only currently).
Default build uses glfw, but glutin can be enabled via:

./mach cargo build --no-default-features --features=glutin
2014-11-19 08:31:34 +10:00
bors-servo
1fd94adb3d auto merge of #4013 : glennw/servo/android-resources, r=larsbergstrom
This is a temporary solution, until they are packaged properly.
2014-11-16 18:12:28 -07:00
Glenn Watson
e4bc2ca82a Redirect android resource folder (user-agent.css and friends) to /sdcard/servo. This is a temporary solution, until they are packaged properly. 2014-11-17 09:51:13 +10:00
Patrick Walton
a4a9a46a87 gfx: Rewrite display list construction to make stacking-contexts more
first-class.

This implements the scheme described here:

    https://groups.google.com/forum/#!topic/mozilla.dev.servo/sZVPSfPVfkg

This commit changes Servo to generate one display list per stacking
context instead of one display list per layer. This is purely a
refactoring; there are no functional changes. Performance is essentially
the same as before. However, there should be numerous future benefits
that this is intended to allow for:

* It makes the code simpler to understand because the "new layer needed"
  vs. "no new layer needed" code paths are more consolidated.

* It makes it easy to support CSS properties that did not fit into our
  previous flat display list model (without unconditionally layerizing
  them):

  o `opacity` should be easy to support because the stacking context
    provides the higher-level grouping of display items to which opacity
    is to be applied.

  o `transform` can be easily supported because the stacking context
    provides a place to stash the transformation matrix. This has the side
    benefit of nicely separating the transformation matrix from the
    clipping regions.

* The `flatten` logic is now O(1) instead of O(n) and now only needs to
  be invoked for pseudo-stacking contexts (right now: just floats),
  instead of for every stacking context.

* Layers are now a proper tree instead of a flat list as far as layout
  is concerned, bringing us closer to a production-quality
  compositing/layers framework.

* This commit opens the door to incremental display list construction at
  the level of stacking contexts.

Future performance improvements could come from optimizing allocation of
display list items, and, of course, incremental display list
construction.
2014-11-14 17:31:15 -08:00
Glenn Watson
f823186345 Fix unit test compile error. 2014-11-13 11:17:43 +10:00
Jack Moffitt
d1b433a3b3 Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
Ms2ger
c2fa5f3b4f Fix the documentation comment for logical_geometry.rs. 2014-11-10 09:45:34 +01:00
Patrick Walton
bdab68ab60 gfx: Micro-optimize DList and StackingContext a bit.
I'm sad to say that this improved performance significantly. A lot of
this win is due to the Rust compiler not being smart about not zeroing
objects out if it doesn't need to.
2014-11-05 00:56:56 -08:00
Patrick Walton
10f7b49cf7 Invert control flow, fix resizing, and improve checkerboarding
significantly by giving tiles some time to paint before we render
unrendered content.
2014-11-04 13:51:56 -08:00
bors-servo
e483a189a3 auto merge of #3879 : mrobinson/servo/debug-options, r=cgaebel
This should make help output a lot cleaner and simplify the way that
uncommon debug options are passed.
2014-11-04 11:36:30 -07:00
Martin Robinson
628cf9c0df Corral debug command-line options into a --debug/-Z flag
This should make help output a lot cleaner and simplify the way that
uncommon debug options are passed.
2014-11-04 10:32:06 -08:00
Clark Gaebel
d22a64884d Implements case insensitive font family names.
One part (of 8!) of css font family disambiguation is that font families should
be matched case-insensitively.

This patch implements that. Once it lands, a bug needs to be filed to do lowercasing
properly (as a string, instead of char-by-char -- it's a unicode thing).

r? @gw
2014-11-03 17:15:51 -08:00
Clark Gaebel
eef969a23f Removes the useless 'static constraint on SmallVec.
It was likely added accidentally after a rustc upgrade.

r? @jdm
2014-11-03 12:03:47 -08:00
bors-servo
4418a28e7a auto merge of #3830 : pcwalton/servo/persistent-list-floats, r=kmcallister
r? @kmcallister
2014-10-31 14:00:39 -06:00
Patrick Walton
c4c4988ee1 util: Add persistent lists as a useful general-purpose thread-safe data
structure.

This will be used to improve our storage management for float lists.
2014-10-31 12:42:32 -07:00
Patrick Walton
7321373d6b util: Add a Show implementation to SmallVec 2014-10-31 10:12:08 -07:00
bors-servo
59fc795025 auto merge of #3829 : cgaebel/servo/fix-into_iter, r=pcwalton
into_iter used to use `inline_size` as the capacity insetad of the actual
capacity. This patch fixes that, adds some utility methods to `SmallVec`
to bring it closer in functionality to `Vec`, and removes the obsolete
`owns_managed` calls.
2014-10-28 16:36:47 -06:00
Glenn Watson
90d793cdc8 Add task profiler, which works by instrumenting each task runtime when enabled. 2014-10-29 07:34:47 +10:00
bors-servo
c109f6ff77 auto merge of #3831 : pcwalton/servo/append-from, r=mbrubeck
This is tracked upstream as Rust bug #18402.

r? @mbrubeck
2014-10-28 13:48:58 -06:00
Clark Gaebel
d661ec8414 fix the build 2014-10-28 12:01:33 -07:00
bors-servo
5bd0a578fd auto merge of #3823 : glennw/servo/default-opts, r=mbrubeck
This is required for unit tests like the image cache task, which can pass through code paths that query the command line options.
2014-10-28 12:36:51 -06:00
Patrick Walton
1a28960bd2 util: Add a method to push all elements from another doubly-linked list
without any moves.

This is tracked upstream as Rust bug #18402.
2014-10-28 10:47:04 -07:00
Clark Gaebel
fe36399628 use size hints 2014-10-28 10:36:41 -07:00
Clark Gaebel
4d610e36bd util: Primarily fixes a bug where SmallVec.into_iter just doesn't work.
into_iter used to use `inline_size` as the capacity insetad of the actual
capacity. This patch fixes that, adds some utility methods to `SmallVec`
to bring it closer in functionality to `Vec`, and removes the obsolete
`owns_managed` calls.
2014-10-28 10:22:34 -07:00
Clark Gaebel
6df1cc8e4c Run all task spawning through util, to allow for easy hooking.
During debugging, I found it useful to hook all task creation in a
central location, and util::task was the perfect place for it.

r? @pcwalton (or maybe someone else, I'm kinda sending you a bunch of
reviews today because I don't know who better to give them to)
2014-10-28 09:53:45 -07:00
Glenn Watson
743ea6381a If opts is retrieved, but not set by platform layer, return a default set.
This is required for unit tests like the image cache task, which can
pass through code paths that query the command line options.
2014-10-28 14:58:31 +10:00
Clark Gaebel
293969cb7d Addressed code review comments. 2014-10-27 14:19:44 -07:00
LalehB
b0d16462ff Adding back-off instead of busy-spinning
Also changed the total number of spinning similar to Cilk
2014-10-27 14:14:21 -07:00
Keegan McAllister
f508a82582 Provide safety check helpers in release builds
debug_assert! uses

    if cfg!(not(ndebug)) { ... }

so the body in a release build is dead code, but it still needs to compile.
2014-10-24 16:53:58 -07:00
Keegan McAllister
4dee8ecdf0 task_state: Generate the list of task types
Also fix warnings.
2014-10-24 16:44:34 -07:00
Keegan McAllister
49234484d6 Ignore the HTML parser's borrow flag in GC tracing
Adds some other dynamic checks in debug builds.
2014-10-24 16:27:37 -07:00
Keegan McAllister
6ec0939a22 Dynamically check DOMRefCell access from layout in debug builds 2014-10-24 16:27:37 -07:00
Josh Matthews
766c3815ab Add layers dependency to util crate. Fixes #3783. 2014-10-23 19:29:05 -04:00
bors-servo
a6f0159cb8 auto merge of #3765 : pcwalton/servo/profiler-cleanups, r=cgaebel
The only real user-visible change this effects is to trim URLs to 30 characters so they don't make huge lines on the terminal.

r? @cgaebel
2014-10-22 14:45:35 -06:00
Patrick Walton
d2d012165f util: Make some minor formatting cleanups to profiling and gfx 2014-10-22 07:49:56 -07:00
Patrick Walton
55222336b5 gfx: Paint in parallel in CPU painting mode 2014-10-22 07:47:47 -07:00
bors-servo
213178b6b9 auto merge of #3742 : saneyuki/servo/opt, r=jdm
This follows up #3711.
2014-10-22 01:27:36 -06:00
bors-servo
1fd7650de5 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
2014-10-21 21:18:33 -06:00
bors-servo
9e48010c8f auto merge of #3748 : mrobinson/servo/trimmer-flow-tree-output, r=mbrubeck
Logical geometry is complicated, so the string formatted output is
verbose. This means that flow tree dumps often go well beyond the
edge of the terminal screen. With a simple notation, we can shorten the
output and make it slightly easier to read. This notation also makes it
more similar to the formatted output of Rect, Point2D, and Size2D.
2014-10-21 19:00:37 -06:00
Tetsuharu OHZEKI
d530e8def9 Remove the help text for render backend option. follow up #3711. 2014-10-22 09:58:58 +09:00
bors-servo
f5ad89f927 auto merge of #3747 : mrobinson/servo/validate-display-list, r=pcwalton
When this option is enabled, the layout task will print an error when
display list items draw outside their owning Flow's position rect. This
will make it easier to detect layout errors before they break rendering.

This is a command-line option for the moment, because we violate this
rule quite a bit still. Once all bugs causing this are fixed, we can be
more aggressive about enabling the option.
2014-10-21 17:51:43 -06:00
bors-servo
3936d14260 auto merge of #3746 : mrobinson/servo/debug-fragment-borders, r=pcwalton
This is quite a bit cleaner than abusing the rust debug functionality.
If we start collecting too many debugging options in the servo
executable we could opt to organize them into a single option.

Fixes #2263.
2014-10-21 17:06:40 -06:00
bors-servo
4795e9cf0b auto merge of #3730 : glennw/servo/taskpool, r=pcwalton
r? @pcwalton - Is this the kind of thing you were thinking of in terms of task queue?
2014-10-21 15:15:42 -06:00
Patrick Walton
32e34663cd gfx: Switch the default to CPU painting.
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.
2014-10-21 11:13:21 -07:00
Martin Robinson
2d5168a1e5 Add an option to show debug fragment borders
This is quite a bit cleaner than abusing the rust debug functionality.
If we start collecting too many debugging options in the servo
executable we could opt to organize them into a single option.

Fixes #2263.
2014-10-21 08:49:25 -07:00