Commit Graph

1176 Commits

Author SHA1 Message Date
Lee Salzman
1fbbefb71f Bug 1408481 - pass AA via GlyphOptions to WR PushGlyphs. r=gankro
MozReview-Commit-ID: LVieyPaaouc
2017-10-19 22:54:28 -04:00
Alexis Beingessner
f365063fa9 Bug 1406510 - rewrite TextDrawTarget to push directly into display list. r=jrmuizel
MozReview-Commit-ID: 7rPGlYmmgeg
2017-10-12 17:17:41 -04:00
Jonathan Kew
4811e19857 Bug 1403521 - Correct positioning of text-decoration lines in vertical writing modes. r=dholbert 2017-10-11 14:01:53 +01:00
Xidorn Quan
e3ed90a7c8 Bug 1384691 - Unconditionally set mHasSelectionShadow when -moz-selection pseudo element is used. r=jfkthame
The HasAuthorSpecifiedRules check was from the initial implementation
of text-shadow support on ::-moz-selection in bug721750. There doesn't
seem to be anything mentioning why this check is necessary.

Also given text-shadow is inherited by default, it doesn't seems this
change would lead to any difference.

MozReview-Commit-ID: 6Qbotdxykwi
2017-09-13 14:30:58 +10:00
Nicholas Nethercote
7dbfdaf890 Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP
2017-10-03 09:05:19 +11:00
Alexis Beingessner
41c8b961e6 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
2017-10-04 13:49:51 -04:00
Alexis Beingessner
1c3c55828c Bug 1405927 - Remove TextLayer support from nsDisplayText. r=mattwoodrow
MozReview-Commit-ID: J1BDkXZdvnc
2017-10-04 13:49:51 -04:00
Kartikaya Gupta
d42b152e67 Bug 1405399 - Update due to API change in WR cset 75216e5. r=Gankro
MozReview-Commit-ID: GM8qA0MKaHv
2017-10-04 14:54:37 -04:00
Kartikaya Gupta
cbacb77052 Bug 1403915 - Remove the IsLayersFreeTransaction() machinery and assume it's always true. r=jrmuizel
MozReview-Commit-ID: 7FYVirQ5pal
2017-10-03 16:31:07 -04:00
David Major
f26d864ed9 Bug 1403220 followup: Limit the PGO workaround to just where it's needed.
No rush merging this one around. Feel free to back this out if the crashes come back.
2017-09-28 13:27:01 -04:00
David Major
bb343e20a7 Bug 1403220 - De-optimize some font functions to work around an MSVC PGO crash. r+a=RyanVM 2017-09-27 10:17:00 -04:00
Alexis Beingessner
e294bce8d0 Bug 1403259 - TextDrawTarget: fallback on -webrender-text-stroke. r=jrmuizel
MozReview-Commit-ID: 9taTLk0RLQq
2017-09-26 14:12:12 -04:00
Alexis Beingessner
986029558c Bug 1400382 - Factor out text WebRenderCommand code to TextDrawTarget. r=mstange
MozReview-Commit-ID: EQtFvLQCT2U
2017-09-21 15:15:58 -04:00
Alexis Beingessner
4c657ebe03 Bug 1400382 - Replace explicit TextDrawTarget passing with cast-based system. r=mstange
MozReview-Commit-ID: EQtFvLQCT2U
2017-09-21 15:15:58 -04:00
Alexis Beingessner
965e218e6b Bug 1400382 - Defer TextDrawTarget analysis until GetLayerState. r=jrmuizel
This ensures the mutations TextOverflow does have already occured when we compute contents.

This also reverts my previous folded opacity patch, as this also handles that case.

MozReview-Commit-ID: 6A4F98GGHyL
2017-09-20 20:11:12 -04:00
Morris Tseng
d7ade017fc Bug 1392200 - Add backface-visibility support for layers-free mode. r=kats
For layers-full mode, we set the backface-visibility to visible because
visibility would be handled by FLB and layers.

MozReview-Commit-ID: CUbeUabfC7K
2017-09-21 14:41:38 +08:00
Nicolas Silva
3c8f9ba825 Bug 1393031 - Remove unused nsTArray<WebRenderParentCommand>& parameter all over the place. r=jrmuizel 2017-09-20 13:36:53 +02:00
Jonathan Watt
b691d3e6b4 Bug 1399824, part 2 - Always use nsIFrame::AddStateBits instead of manual bit twiddling. r=xidorn
MozReview-Commit-ID: JoEiQQI2kZ5
2017-08-24 12:09:42 +01:00
Jonathan Watt
3423986d9b Bug 1399824, part 1 - Always use nsIFrame::RemoveStateBits instead of manual bit twiddling. r=xidorn
MozReview-Commit-ID: KynEge1U4aS
2017-08-24 10:55:28 +01:00
Ting-Yu Lin
92845bb45f Bug 1341009 - Convert nsReflowStatus::Reset() to nsReflowStatus::IsEmpty() assertion in ReflowText(). r=dholbert
MozReview-Commit-ID: Fa1Dq7xLP3n
2017-09-14 16:22:21 +08:00
Ting-Yu Lin
d93880e505 Bug 1341009 - Add nsReflowStatus::IsEmpty() assertions to all nsIFrame::Reflow() methods and some reflow helpers, and remove unneeded Reset(). r=dholbert
nsReflowStatus::IsEmpty() assertions are added after DISPLAY_REFLOW in the
beginning of the Reflow().

A few Reflow() implementations have Reset() calls at the end which are left
in place by this patch (with an explanatory comment added to each). These
ending Reset()s are only needed for cases where a non-splittable frame
passes its own nsReflowStatus to a child's reflow method. Just in case the
child leaves a "not fully complete" value in the nsReflowStatus, the
non-splittable parent frame must clear out the nsReflowStatus before
returning, so that its own parent doesn't then try to split it.

MozReview-Commit-ID: 6Jj3jfMAqj4
2017-09-13 18:00:25 +08:00
Alexis Beingessner
37cca34ec0 Bug 1399564 - properly thread through selection-specific decorations to WR. r=jrmuizel
MozReview-Commit-ID: 7prde0BsOFL
2017-09-13 13:25:42 -04:00
Sebastian Hengst
1c36da9196 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: 4dRrVdftJVy
2017-09-15 11:05:11 +02:00
Sebastian Hengst
fc53f3bd53 Backed out changeset f34a52244cf9 (bug 1393031) 2017-09-14 23:17:35 +02:00
Markus Stange
4e8606103a Bug 1387594 - Set the font smoothing background color based on the -moz-font-smoothing-background-color property. r=mattwoodrow
MozReview-Commit-ID: B3PVIvMswf8
2017-09-14 23:09:47 +02:00
Alexis Beingessner
e0fc009fac Bug 1399274 - Block invisible text optimizations when using WebRender. r=jrmuizel
Mostly just threading the TextDrawTarget deeper into the code to use a boolean.
A lot of places are trying to optimize away invisible text!

MozReview-Commit-ID: 89sDAwUv0HA
2017-09-13 14:05:51 -04:00
Miko Mynttinen
1d15e14450 Bug 1359584 - Part 3: Improve nsDisplayItem const correctness and fix surrounding whitespace r=mstange
MozReview-Commit-ID: 3GkWiu6C4Zo
2017-08-24 17:09:44 +02:00
Miko Mynttinen
4401e3b079 Bug 1359584 - Part 1: Move mDisableSubpixelAA to nsDisplayItem r=mstange
MozReview-Commit-ID: 70169AFRmjq
2017-08-24 14:45:21 +02:00
Alexis Beingessner
98c96c6809 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
2017-09-12 16:50:44 -04:00
KuoE0
65d9db448f Bug 1229979 - (Part 1) Make the color of decoration line shadow be as same as the color of the text shadow. r=jfkthame
Multi-color shadow is not allowed in spec. We could use the same color
of the text as the color of the decoration line when we paint the
shadow.

MozReview-Commit-ID: AK9NoseSE0h
2017-09-06 14:31:36 +08:00
Sebastian Hengst
bcd79f94c8 Backed out changeset 274175ce0863 (bug 1229979) for failing reftest layout/reftests/text-shadow/decorations-multiple-zorder.html, at least on Windows and Android. r=backout 2017-09-08 10:56:24 +02:00
KuoE0
714c83ce84 Bug 1229979 - (Part 1) Make the color of decoration line shadow be as same as the color of the text shadow. r=jfkthame
Multi-color shadow is not allowed in spec. We could use the same color
of the text as the color of the decoration line when we paint the
shadow.

MozReview-Commit-ID: AK9NoseSE0h
2017-09-06 14:31:36 +08:00
Alexis Beingessner
47e4c924b5 Bug 1395729 - Disable frame merging for nsTextFrame. r=mattwoodrow
MozReview-Commit-ID: C0kq5IYgUMG
2017-09-06 13:49:31 -04:00
Daniel Holbert
4c392792a9 Bug 1393098 part 1: Adjust nsTextFrame::CharacterDataChanged to skip redundant requests for reflow, via a new boolean member-var. r=jfkthame
Some benchmarks & use-cases cause nsTextFrame::CharacterDataChanged to be
called multiple times for the same text between reflows.  Each call triggers a
slightly-expensive call to shell->FrameNeedsReflow(), for each affected
nsTextFrame in the continuation chain. (OK, it's not quite that bad -- we
skip the FrameNeedsReflow calls for siblings, since the ancestor
notifications/tweaks would all be the same.)

This patch makes us set a flag on the nsTextFrame to indicate that a reflow has
*already* been requested by this chunk of code, and we'll now use that to skip
the FrameNeedsReflow() call (and the dirty-bit-setting for siblings) on the
next invocation. And we clear this new flag when the pending reflow actually
happens.

This shouldn't change behavior in a web-observable way, but it should speed
things up by removing redundant work.

MozReview-Commit-ID: 5nmbZHEFFDi
2017-08-31 10:45:38 -07:00
Daniel Holbert
6aff66ff4a Bug 1393098 part 0: Refactor logic (add helper bool & reduce GetParent calls), in nsTextFrame::CharacterDataChanged. r=jfkthame
This patch doesn't affect behavior at all -- it just adjusts the logic
slightly. Specifically, this patch:

 (a) Changes some code that currently tracks a frame, to now instead track that
     frame's parent, since we only ever call GetParent() on it anyway.
 (b) Drops a null-check that becomes unnecessary as a result of that
     change. (It was only there to protect us from calling GetParent() on a
     null pointer during the first loop iteration, and now that's not a risk
     since we're tracking the parent itself, and a null value will fail the
     equality comparison and do the right thing.)
 (c) Captures the "are ancestors already aware of a reflow request for my
     subtree" if-condition in a named boolean helper-variable.
 (d) Adds/improves documentation.

MozReview-Commit-ID: 7dEflfiERYB
2017-08-31 10:45:36 -07:00
Alexis Beingessner
db0b796079 Bug 1395098 - Apply folded alpha to text when using advanced layers r=jrmuizel
MozReview-Commit-ID: 6crHThEP6Ha
2017-08-30 13:18:09 -04:00
Masayuki Nakano
d07db737a3 Bug 1393348 - part2: nsISelectionController::SELECTION_* should be sequential integer values r=smaug
nsISelectionController::SELECTION_* are declared as bit-mask.  However, no
methods of nsISelectionController treat them as bit-mask and these
values need a switch statement in nsFrameSelection to convert SelectionType to
array index of nsFrameSelection::mDOMSelections because it's too big to create
an array to do it.  Additionally, this conversion appears profile of
attachment 8848015.

So, now, we should declare these values as sequential integer values.

However, only nsTextFrame uses these values as bit-mask.  Therefore, this patch
adds new type, SelectionTypeMask and creates new inline method,
ToSelectionTypeMask(SelectionType), to retrieve mask value for a SelectionType.

MozReview-Commit-ID: 5Za8mA6iu4
2017-08-24 19:14:04 +09:00
Ethan Lin
8bb0f096c8 Bug 1391996 - Move some checks from nsDisplayText::GetLayerState to constructor to prevent ambiguous status. r=jrmuizel
MozReview-Commit-ID: QPSIqLz56p
2017-08-21 14:52:31 +08:00
Alexis Beingessner
17c2751eec 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
2017-06-19 10:58:28 -04:00
Matt Woodrow
8370362323 Bug 1388162 - Add a Destroy function to nsDisplayItem to use instead of manually invoking the destructor, this will allow us to recycle them in the future. r=mstange
* * *
[mq]: fix

MozReview-Commit-ID: LUXZAIL73BJ
2017-08-07 16:07:43 +12:00
Matt Woodrow
e62cf6dd69 Bug 1388161 - Store the dirty rect on the display list builder rather than passing it as a parameter to BuildDisplayList. r=mstange 2017-08-07 14:23:35 +12:00
Sebastian Hengst
2e92d940f4 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
Sebastian Hengst
1e52933103 Backed out changeset e9985564e081 (bug 1388162) for failing chrome's test_animation_performance_warning.html | preserve-3d transform. r=backout 2017-08-10 14:40:20 +02:00
Matt Woodrow
b0bdae09c7 Bug 1388162 - Add a Destroy function to nsDisplayItem to use instead of manually invoking the destructor, this will allow us to recycle them in the future. r=mstange 2017-08-07 16:07:43 +12:00
Matt Woodrow
61b7fddb66 Bug 1388161 - Store the dirty rect on the display list builder rather than passing it as a parameter to BuildDisplayList. r=mstange 2017-08-07 14:23:35 +12:00
Nicolas Silva
8c829d94a4 Bug 1393031 - Remove unused nsTArray<WebRenderParentCommand>& parameter all over the place. r=jrmuizel 2017-09-14 20:21:54 +02:00
Nicolas Silva
7100d343f6 Bug 1393031 - Use shared memory to pass resource update data. r=jrmuizel 2017-09-14 18:48:55 +02:00
Jonathan Kew
0e58329a6c Bug 1385395 - Use flag bits in the nsGenericDOMDataNode to record whether nsTextFrame-related properties are present, so we don't perform unnecessary hashtable lookups in CharacterDataChanged etc. r=dbaron 2017-08-07 23:13:30 +01:00
Emilio Cobos Álvarez
54f1c009a9 Bug 1384542: Move GetParent and IsLinkContext to GeckoStyleContext. r=heycam
MozReview-Commit-ID: C19yGcphixX
2017-07-31 14:32:59 +02:00
Mason Chang
178af9710d Bug 1381973 - Lazily create the reference DT in DrawTargetCapture. r=dvander 2017-07-26 15:43:00 -07:00