gecko-dev/gfx
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
..
2d merge mozilla-inbound to mozilla-central a=merge 2017-08-15 11:42:11 +02:00
angle Bug 1372083 - Do not compare depth in attachmentsHaveSameDimensions() r=jgilbert 2017-07-18 19:25:29 +09:00
cairo Bug 1377257 part 1 - Add cairo_scaled_font_get_hint_metrics to avoid malloc/free that is required to use cairo_scaled_font_get_font_options. r=jfkthame 2017-08-14 12:35:30 +01:00
config Bug 1359416: Allow blocklisting of D3D11 keyed mutex and block it for Intel Gen 6. r=bas,dvander 2017-07-25 14:02:36 -04:00
doc Bug 1388719 - Update webrender to commit 101c69db1a989fe89c308dabd53cf50aedfe4a96. r=jrmuizel 2017-08-11 09:21:41 -04:00
docs
gl Bug 1382292 - Revert PLANAR_YCBCR case in GLBlitHelper.cpp on Android so that when a canvas uses a video frame as source, it is not flipped r=kvark 2017-08-17 12:02:17 -07:00
graphite2 Bug 1349310 - Update graphite2 to release 1.3.10. r=milan 2017-05-08 12:08:24 +01:00
harfbuzz Bug 1388551 - Update harfbuzz to version 1.4.8. r=jfkthame 2017-08-09 08:57:22 -04:00
ipc Bug 1380081 - Part 9: Transmit BHR Hangs from the Content and GPU process to the parent process, r=froydnj 2017-08-15 16:35:42 -04:00
layers Bug 1357545 - handle text-shadows/decorations with webrender (layers-free) r=jrmuizel 2017-06-19 10:58:28 -04:00
ots Backed out changeset 15956a990499 (bug 1369672) for build bustage a=backout CLOSED TREE 2017-08-17 13:51:05 -07:00
qcms
sfntly
skia Bug 1378130 - backport of fix for bounds violation in Skia's AAA path rendering. r=jrmuizel 2017-08-14 16:44:14 -04:00
src Bug 1387514: Upgrade BaseRect (derived classes) width and height direct member variable use to instead use Width()/SetWidth() and Height()/SetHeight() in .cpp files in gfx/*. r=milan 2017-08-14 08:29:28 -04:00
tests Bug 1387514: Upgrade BaseRect (derived classes) width and height direct member variable use to instead use Width()/SetWidth() and Height()/SetHeight() in .cpp files in gfx/*. r=milan 2017-08-14 08:29:28 -04:00
thebes Backed out changeset 15956a990499 (bug 1369672) for build bustage a=backout CLOSED TREE 2017-08-17 13:51:05 -07:00
vr Bug 1387514: Upgrade BaseRect (derived classes) width and height direct member variable use to instead use Width()/SetWidth() and Height()/SetHeight() in .cpp files in gfx/*. r=milan 2017-08-14 08:29:28 -04:00
webrender Bug 1388719 - Update webrender to commit 101c69db1a989fe89c308dabd53cf50aedfe4a96. r=jrmuizel 2017-08-11 09:21:41 -04:00
webrender_api Bug 1388719 - Update webrender to commit 101c69db1a989fe89c308dabd53cf50aedfe4a96. r=jrmuizel 2017-08-11 09:21:41 -04:00
webrender_bindings Bug 1357545 - handle text-shadows/decorations with webrender (layers-free) r=jrmuizel 2017-06-19 10:58:28 -04:00
ycbcr
moz.build