gecko-dev/layout
Alexis Beingessner 9c4535798f Bug 1357545 - handle text-shadows/decorations with webrender (layers-free) r=jrmuizel
This replaces our DrawTargetCapture hack with a similar but more powerful TextDrawTarget
hack. The old design had several limitations:

* It couldn't handle shadows
* It couldn't handle selections
* It couldn't handle font/color changes in a single text-run
* It couldn't handle decorations (underline, overline, line-through)

Mostly this was a consequence of the fact that it only modified the start and end
of the rendering algorithm, and therefore couldn't distinguish draw calls for different
parts of the text.

This new design is based on a similar principle as DrawTargetCapture, but also passes
down the TextDrawTarget in the drawing arguments, so that the drawing algorithm can
notify us of changes in phase (e.g. "now we're doing underlines"). This also lets us
directly pass data to TextDrawTarget when possible (as is done for shadows and selections).

In doing this, I also improved the logic copied from ContainsOnlyColoredGlyphs to handle
changes in font/color mid-text-run (which can happen because of font fallback).

The end result is:

* We handle all shadows natively
* We handle all selections natively
* We handle all decorations natively
* We handle font/color changes in a single text-run
    * Although we still hackily intercept draw calls
    * But we don't need to buffer commands, reducing total memcopies

In addition, this change integrates webrender's PushTextShadow and PushLine APIs,
which were designed for this use case. This is only done in the layerless path;
WebrenderTextLayer continues to be semantically limited, as we aren't actively
maintaining non-layers-free webrender anymore.

This also doesn't modify TextLayers, to minimize churn. In theory they can be
augmented to support the richer semantics that TextDrawTarget has, but there's
little motivation since the API is largely unused with this change.

MozReview-Commit-ID: 4IjTsSW335h

--HG--
extra : rebase_source : d69f69648ade5c7a8e6bb756f4b8ab9e2543e576
2017-06-19 10:58:28 -04:00
..
base Merge m-c to autoland, a=merge 2017-08-17 16:23:45 -07:00
build Bug 1384162 part 3 - Move document container setting into nsContentDLF::CreateBlankDocument before adding any nodes. r=bz 2017-07-26 20:02:58 +10:00
doc
forms merge mozilla-inbound to mozilla-central a=merge 2017-08-16 11:23:24 +02:00
generic Bug 1357545 - handle text-shadows/decorations with webrender (layers-free) r=jrmuizel 2017-06-19 10:58:28 -04:00
inspector Bug 1383992 part 1 - Disable failing mochitests. r=heycam 2017-08-09 08:31:26 +10:00
ipc Bug 1389139 - Add transforms for reflayer equivalents in the layers-free APZ world. r=jrmuizel 2017-08-16 12:50:37 -04:00
mathml Backed out changeset 8f2dd8f13b53 (bug 1388161) for failing chrome's test_animation_performance_warning.html | preserve-3d transform. r=backout 2017-08-10 14:40:21 +02:00
media
painting Bug 1357545 - handle text-shadows/decorations with webrender (layers-free) r=jrmuizel 2017-06-19 10:58:28 -04:00
printing Bug 1387381 - Remove nsXPIDLString local variables. r=erahm. 2017-08-08 16:07:55 +10:00
reftests Backed out 2 changesets (bug 577824) for reftest failures in 577824.html a=backout CLOSED TREE 2017-08-17 13:17:28 -07:00
style Merge m-c to autoland, a=merge 2017-08-17 16:23:45 -07:00
svg Merge inbound to central, a=merge 2017-08-11 13:15:33 -07:00
tables Merge inbound to central, a=merge 2017-08-11 13:15:33 -07:00
tools Bug 1386826 - Whitelist the objdir, so _tests gets covered. r=jmaher 2017-08-16 19:03:09 +02:00
xul Merge inbound to central, a=merge 2017-08-11 13:15:33 -07:00
moz.build