This code replaces glut with glfw. The motivation here is address the GPU driver bugs on Linux when using multiple `Display *` pointers with shared GL contexts instead of a single common one. GLFW has native access methods which provide access to its `Display *`, which appears to be unique among all the similar toolkits.
Details:
- Adds glfw and glfw-rs to the build
- Removes GLUT code and replaces it with GLFW versions
- Fixes hard coded initial window values
- Fixes clean targets
- Event loop doesn't block on windowing events anymore
Also fixes initial window size to get based on the windowing code instead of
being hardcoded everywhere. This code works on HiDPI displays, but does not
appropriately scale the output up yet.
When loading pages, the constellation spawns a new script<-->layout<-->renderer pipeline that loads in the background while scripts continue executing on the currently loaded page.
script caches last loaded url -- currently no caching policy
naive caching of render layers for near-instant forward/back
handling evicted pipelines is currently broken
Performance will be better and benchmarking easier if we don't run layout an extra unnecessary time when loading a page from the commandline. This is happening because we always send a resize event to the script task from the compositor whenever the platform tells us one happened, even if the window size didn't change. This PR fixes this by checking that the window size is actually different before sending the event.
This PR makes text runs store the results of shaping as a vector of ARC<GlyphStore>; each element of the vector holds the shaped glyphs for a nonbreakable unit of text (basically a word). This change allows us to cache the shaped glyphs for the words, an approach that Gecko (and probably WebKit) uses. We get pretty good cache hit ratios even on the first run of layout for a page (I saw 62% on Wikipedia's main page today), although a lot of that is due to whitespace. This really comes into its own on subsequent layout runs, though, which are completely cached in the typical case.
This is a preliminary step to adding parallel text shaping. In order to have enough time to do a useful amount of work in parallel, we need to trigger text shaping earlier. This PR moves TextRun creation into the box building phase of layout.
I'm pushing this in before the rest of the text shaping patches to avoid bitrot; it's already been through one unpleasant rebase.
I added the minimal amount of code needed to place left-floats on the screen (right floats should also be possible soon). Text does not wrap around floats yet.
One thing I'm curious about is whether some existing abstractions (like Cell) can be used instead of this weird overwriting thing done in float_context.rs.