Граф коммитов

26 Коммитов

Автор SHA1 Сообщение Дата
Lee Salzman 1a23b6eab1 Bug 1400384 - support text writing modes with WebRender. r=gankro 2018-01-17 07:51:20 -05:00
Lee Salzman 4b892d44b0 Bug 1429806 - Initialize new field in WR GlyphOptions introduced in WR PR 2288. r=kats
MozReview-Commit-ID: JRm6VKBeUuL

--HG--
extra : rebase_source : 20ea49bec54e8a99304628348c1fd63b0d950129
2018-01-16 10:28:54 -05:00
Ethan Lin 7ab691c827 Bug 1424673 - Fix the clip region for text draw target. r=kats
For draw target, the initial clip region should be the draw target's size.

MozReview-Commit-ID: 2z2EobkYFs2

--HG--
extra : rebase_source : 9631cf189330b089992b8458113800ea9a3fd4a0
2018-01-08 10:59:01 +08:00
Jeff Muizelaar 644c528356 Bug 1422466. Drop a copy from TextDrawTarget::FillGlyphs. r=Gankro
We try hard to ensure that the glyph buffers are of the same type.
2017-12-04 13:01:55 -05:00
Markus Stange 78303f13ce Bug 1414154 - Remove GlyphRenderingOptions. r=lsalzman
MozReview-Commit-ID: JtwnTj1hhPV

--HG--
extra : rebase_source : 2a3e896eec8b6839097baf6e2cccc10eb162827b
2017-11-02 21:42:56 -04:00
Daniel Holbert 680815cd6e Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame
This patch was generated automatically by the "modeline.py" script, available
here: https://github.com/amccreight/moz-source-tools/blob/master/modeline.py

For every file that is modified in this patch, the changes are as follows:
 (1) The patch changes the file to use the exact C++ mode lines from the
     Mozilla coding style guide, available here:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Mode_Line

 (2) The patch deletes any blank lines between the mode line & the MPL
     boilerplate comment.

 (3) If the file previously had the mode lines and MPL boilerplate in a
     single contiguous C++ comment, then the patch splits them into
     separate C++ comments, to match the boilerplate in the coding style.

MozReview-Commit-ID: EuRsDue63tK

--HG--
extra : rebase_source : 3356d4b80ff6213935192e87cdbc9103fec6084c
2017-10-27 10:33:53 -07:00
Alexis Beingessner 168deb7b2b Bug 1401653 - fixup webrender text-decoration bindings. r=jrmuizel
This does 3 things that were all a bit too intermixed to split out cleanly:

1. Teaches TextDrawTarget to handle rectangular clips (while also completely
forbidding other ones). This is necessary to handle how gecko "overdraws"
decorations with clips to create the illusion of continuous lines when they're
actually made out of multiple lines, possibly from different display items
with different lines. Previously gecko *was* handing these clips to
TextDrawTarget to use these clips, but we were just ignoring them.

This is also necessary work to support partial glyphs natively (which apply
rectangular clips to glyphs). Also note that this currently causes a bug
in webrender if combined with zero-blur shadows, but it's not a regression
since we already mishandle clipped decorations. I will work on fixing this
upstream.

2. Changes the intermediate representation of lines from the old webrender
format to a rect-based one. This is in preperation for webrender adopting
that format in a future update.

3. Changes the way wavy lines are processed, correcting some errors in the
old wavy line bindings that lead to them being positioned incorrectly. Also
introduces a wavyLineThickness property that the will be required in a
future webrender update. Wavy lines are unlike any other line, so it's
ultimately desirable to distinguish them.

The net result of these changes is that a companion upstream change (webrender#1923)
will make decoration rendering nearly identical to gecko, and much nicer.
However the clipped shadows issue will need to be seperately resolved before
actually closing this issue.

MozReview-Commit-ID: 6O2wLA6bU3C

--HG--
extra : rebase_source : 17254c45145229b75f77f87f85874e66e6edd05e
2017-10-24 12:44:38 -04:00
Attila Craciun 1fc19f42dc Backed out 1 changesets (bug 1401653) for failing no matching function for call in src/layout/generic/TextDrawTarget.h:143:43 r=backout on a CLOSED TREE.
Backed out changeset 5055d2703f2f (bug 1401653)
2017-10-25 16:32:17 +03:00
Alexis Beingessner 7d07e76ce2 Bug 1401653 - fixup webrender text-decoration bindings. r=jrmuizel
This does 3 things that were all a bit too intermixed to split out cleanly:

1. Teaches TextDrawTarget to handle rectangular clips (while also completely
forbidding other ones). This is necessary to handle how gecko "overdraws"
decorations with clips to create the illusion of continuous lines when they're
actually made out of multiple lines, possibly from different display items
with different lines. Previously gecko *was* handing these clips to
TextDrawTarget to use these clips, but we were just ignoring them.

This is also necessary work to support partial glyphs natively (which apply
rectangular clips to glyphs). Also note that this currently causes a bug
in webrender if combined with zero-blur shadows, but it's not a regression
since we already mishandle clipped decorations. I will work on fixing this
upstream.

2. Changes the intermediate representation of lines from the old webrender
format to a rect-based one. This is in preperation for webrender adopting
that format in a future update.

3. Changes the way wavy lines are processed, correcting some errors in the
old wavy line bindings that lead to them being positioned incorrectly. Also
introduces a wavyLineThickness property that the will be required in a
future webrender update. Wavy lines are unlike any other line, so it's
ultimately desirable to distinguish them.

The net result of these changes is that a companion upstream change (webrender#1923)
will make decoration rendering nearly identical to gecko, and much nicer.
However the clipped shadows issue will need to be seperately resolved before
actually closing this issue.

MozReview-Commit-ID: 6O2wLA6bU3C

--HG--
extra : rebase_source : 98da45bc7f2eaabd63ae226c505cb1580b5c8500
2017-10-24 12:44:38 -04:00
Lee Salzman 6235863fa6 Bug 1408481 - pass AA via GlyphOptions to WR PushGlyphs. r=gankro
MozReview-Commit-ID: LVieyPaaouc
2017-10-19 22:54:28 -04:00
Kartikaya Gupta d8ac050c91 Bug 1409856 - Update all the WebRender code to use LayoutDevice units instead of Layer units. r=jrmuizel
MozReview-Commit-ID: DP3hwlFWyZC
2017-10-18 22:25:11 -04:00
Alexis Beingessner 896f3904ab Bug 1407213 - Update bindings for changes in WR PR 1853. r=jrmuizel
MozReview-Commit-ID: KjSQkZXXIaX

--HG--
extra : rebase_source : b7df3a991ee74e2ee2bbdce58a1b4970fd4ad012
2017-10-13 12:58:32 -04:00
Alexis Beingessner eeaa4695dc Bug 1406510 - rewrite TextDrawTarget to push directly into display list. r=jrmuizel
MozReview-Commit-ID: 7rPGlYmmgeg
2017-10-12 17:17:41 -04:00
Alexis Beingessner c0bfb121ad Bug 1405927 - Change PushGlyphs to take webrender formats. r=jrmuizel
Also cleans up a bunch of TextDrawTarget code as fallout.

This is a significant perf win for textFrames.

MozReview-Commit-ID: J1BDkXZdvnc

--HG--
extra : rebase_source : 5a0769a53cadb55a074cfe5d718e259401fa7028
2017-10-04 13:49:51 -04:00
Kartikaya Gupta 561b271b7d Bug 1405399 - Update due to API change in WR cset 75216e5. r=Gankro
MozReview-Commit-ID: GM8qA0MKaHv

--HG--
extra : rebase_source : cb8cddeab931e34ad5cc7392308f177970cdabde
2017-10-04 14:54:37 -04:00
Alexis Beingessner b5bacff9f8 Bug 1404370 - TextDrawTarget: add fallbacks for remaining cases, remove some hacks. r=jrmuizel
This adds fallbacks for:
* synthetic bold
* synthetic italics
* text-writing-modes

This also removes an old hack to make synthetic italics less broken.

This also prevents special opacity handling for color fonts so that webrender
gets that information.

MozReview-Commit-ID: DKiTUBR6hzy

--HG--
extra : rebase_source : 22b445d40ee46bb09d4325828a8e959d3da7a9c7
2017-09-29 12:05:34 -04:00
Alexis Beingessner 6c9882ed08 Bug 1400411 - stop mocking most of DrawTarget. r=jrmuizel
Also fixes a bad debug assertion

MozReview-Commit-ID: 5OV5KkvbRwZ

--HG--
extra : rebase_source : 5de35738733c8f18b2b227109eed7fcd9b4d9ed9
2017-09-16 10:42:11 -04:00
Alexis Beingessner 6803f63105 Bug 1400411 - text-layers: fallback if SVG fonts or tofu is found. r=jrmuizel
MozReview-Commit-ID: 9vUK5r5sKWB

--HG--
extra : rebase_source : 5e4c026cf6c802554772a99064898fde3b414ea8
2017-09-22 10:57:30 -04:00
Alexis Beingessner c9ae89e98d Bug 1400382 - Factor out text WebRenderCommand code to TextDrawTarget. r=mstange
MozReview-Commit-ID: EQtFvLQCT2U

--HG--
extra : rebase_source : 8774f6723250cbcb59eb62382b24767d9f9b8f75
2017-09-21 15:15:58 -04:00
Alexis Beingessner 9022c22b82 Bug 1400382 - Replace explicit TextDrawTarget passing with cast-based system. r=mstange
MozReview-Commit-ID: EQtFvLQCT2U

--HG--
extra : rebase_source : 1fff1b545c18d42403cf9c30172528e553a6af48
2017-09-21 15:15:58 -04:00
Ryan VanderMeulen 81f5fe50b0 Backed out changeset 8a0b8dfa2d7d (bug 1400411) for causing various font-related crashes. 2017-09-18 14:15:03 -04:00
Alexis Beingessner aa97eca262 Bug 1400411 - stop mocking most of DrawTarget. r=jrmuizel
Also fixes a bad debug assertion

MozReview-Commit-ID: 5OV5KkvbRwZ

--HG--
extra : rebase_source : dbb41ecff52934f498b6d96b4cd174da246429f2
2017-09-16 10:42:11 -04:00
Alexis Beingessner 39e87f69a6 Bug 1395748 - Fix text selection shadow interaction. r=jrmuizel
Selections in gecko are used to hack in style changes to subsets of text frames.
Mostly this works fine because decorations don't care where they are, and
textRunFragments already exist to do style changes midFrame. However we mishandled
shadows because we were assuming they applied to the entire run, which isn't
the case when shadows are involved.

Applying shadows to everything was desirable because the way nsTextFrame is written,
it's difficult for us to associate the glyphs and decorations with a "range".
However the selections iterator provides a natural grouping, so we use that.

The result is that TextDrawTarget effectively becomes an array of what TextDrawTarget
used to be (now called SelectedTextRunFragment). Everything else is just fallout
of this change.

MozReview-Commit-ID: 5GWPruo6daW

--HG--
extra : rebase_source : 8e1c1d61e43151ee6651f8c6cfbcb0912262df56
2017-09-12 16:50:44 -04:00
Alexis Beingessner 9a02daa232 Bug 1397361 - Apply skew transform to glyphs to undo inverse transform in font code. r=jrmuizel
MozReview-Commit-ID: GBpDmWp1Hnm

--HG--
extra : rebase_source : 85f7071e6306669c8628e26a39379436ba6cad56
2017-09-06 13:08:09 -04:00
Alexis Beingessner 3ce36bee8a Bug 1395729 - Disable frame merging for nsTextFrame. r=mattwoodrow
MozReview-Commit-ID: C0kq5IYgUMG

--HG--
extra : rebase_source : 554424e067dba4c5ed39712a51f48f79912e6e6a
2017-09-06 13:49:31 -04:00
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