Commit Graph

884 Commits

Author SHA1 Message Date
Kartikaya Gupta
92c112278f Bug 1416540 - Convert a bunch of scaling code to avoid unnecessary double conversion. r=mattwoodrow
The code in ComputeSuitableScaleForAnimation feeds its double-based
computation results into GetSuitableScale, which takes and returns
floats. Also the double-based computation that it's doing involves
calling UpdateMinMaxScale a bunch which explicitly uses the float
variant of std::min and std::max. And all of this is used from
ChooseScaleAndSetTransform which does other things like call a
"RoundToFloatPrecision" function, and casts the final values to
floats before setting the layer's prescale. So let's just use
floats all the way through.

MozReview-Commit-ID: BE3WC5hv89d

--HG--
extra : rebase_source : 987d9d69ec2a200ed68c59bae5fae1115713a94c
2017-11-12 18:37:33 -05:00
Kartikaya Gupta
6fe3141125 Bug 1416540 - Avoid unnecessary conversion to doubles in ActiveLayerTracker code. r=mstange
This code was written before the ScaleFactors() function was available on
the float-based gfx::Matrix, which I presume is why it was written to
convert the matrix to the double-based variant and store the scale as
doubles. We don't need to do that any more.

MozReview-Commit-ID: EoWLpny8g61

--HG--
extra : rebase_source : 4cac59121961bfb35359def042ac4b0200a85312
2017-11-12 18:37:33 -05:00
Kartikaya Gupta
2c46265720 Bug 1416540 - Avoid unnecessary use of double-based types in GenerateAndPushTextMask. r=jfkthame
The code here feeds into gfxContext::mTransform which is float-based, so
using double-based rects and matrices here is unnecessary.

MozReview-Commit-ID: CbeMM8003DA

--HG--
extra : rebase_source : 735d5c880cca36b9e9bea6cb0c94825b6a1c4597
2017-11-12 18:37:32 -05:00
Matt Woodrow
3af1439f69 Bug 1416448 - Don't update the ASR during merging for an empty container item, since we can't compute the ASR of the contents. r=miko 2017-11-13 09:02:48 +13:00
Matt Woodrow
53892cd491 Bug 1413073 - Fix rebase issue that caused us to only update the container asr for reused items. 2017-11-11 15:46:48 +13:00
Ethan Lin
beaea27dc3 Bug 1415989 - Do not use 'ShouldUseAdvancedLayer' for button type display items. r=jrmuizel
MozReview-Commit-ID: 83qOTfTRUY0

--HG--
extra : rebase_source : 560f285f3092cd75d14d27cae4adcb8e9dca0e3a
2017-11-10 11:41:15 +08:00
Kartikaya Gupta
00ef028ed3 Bug 1416267 - Update gfxContext matrix functions to avoid flip-flopping between float and double matrices. r=jrmuizel
The core of this change is in gfxContext.*:
- change gfxContext::CurrentMatrix() and gfxContext::SetMatrix() to
  return and take a Matrix respectively, instead of converting to
  and from a gfxMatrix (which uses doubles). These functions therefore
  will now match the native representation of the transform in gfxContext.
- add two new functions CurrentMatrixDouble() and SetMatrixDouble() that
  do what the old CurrentMatrix() and SetMatrix() used to do, i.e.
  convert between the float matrix and the double matrix.

The rest of the change is just updating the call sites to avoid round-
tripping between floats and doubles where possible. Call sites that are
hard to fix are migrated to the new XXXDouble functions which preserves
the existing behaviour.

MozReview-Commit-ID: 5sbBpLUus3U
2017-11-10 21:14:09 -05:00
Miko Mynttinen
c94a72556d Bug 1416065 - Ensure that override dirty rects are properly removed from frames r=mattwoodrow
MozReview-Commit-ID: 8uLgDFxl5MV

--HG--
extra : rebase_source : f8b1202e068b448499ebe470c9d9151715cb1419
2017-11-10 01:32:29 +01:00
Noemi Erli
8d8df3ddfe Merge mozilla-central to mozilla-autoland. r=merge a=merge CLOSED TREE 2017-11-10 12:43:53 +02:00
Matt Woodrow
1696dda8f9 Bug 1413073 - Part 3: Recompute ASR and clip-chains on wrap lists when merging. r=mstange
--HG--
extra : rebase_source : 5c03d88f8d3467dad32fc3589803180fdad4e488
2017-11-10 13:16:55 +13:00
Matt Woodrow
7e5b5d152d Bug 1413073 - Part 2: Only force frames to have display items built if they intersect the dirty rectangle. r=mstange
--HG--
extra : rebase_source : d26f57488cb298cb3d1ea0b3ca600925279a5976
2017-11-10 13:16:45 +13:00
Matt Woodrow
367e79bd4d Bug 1413073 - Part 1: Add new crashtests for complex ASR cases. r=mstange
--HG--
extra : rebase_source : b2a075e9c703d7cd470546cf2bbd6516bea8192f
2017-11-10 13:16:36 +13:00
Matt Woodrow
e1ee7ce3d0 Bug 1415672 - Don't invalidate the entire frame tree when we're marking a specific frame as being modified. r=miko
--HG--
extra : rebase_source : 7ec5936718e52803bcdf6f1edf435b8247c5107d
2017-11-10 13:16:26 +13:00
Kartikaya Gupta
33e88b3fce Bug 1416067 - Avoid doing a bunch of useless event-regions work for frames with empty border boxes. r=mstange
MozReview-Commit-ID: 8gsIJojhQ6t

--HG--
extra : rebase_source : 74689a0a32e1406e02de8b46e0e12d6ffdc2aeb0
2017-11-09 19:40:44 -05:00
Kartikaya Gupta
463cce7a87 Bug 1415225 - Small early-exit optimization. r=botond
MozReview-Commit-ID: A3UuqKKOsjA

--HG--
extra : rebase_source : 78042095524bda3371f347817b2ff201c9863729
2017-11-09 09:03:52 -05:00
Kartikaya Gupta
93ca1a3bc5 Bug 1415225 - Stop setting the EventRegionsOverride flag on root layers. r=botond,mattwoodrow
As with the previous patch, instead of setting the override on the root
layer, we set the flag on the nsDisplayListBuilder before building the
display list, and the flag automatically forces all event regions
display items to use their dispatch-to-content region instead of any
other regions.

Both the WebRender and non-WebRender codepaths were setting the override
flag on their root layers and don't need to any more.

MozReview-Commit-ID: 1cz0ahqwkOm

--HG--
extra : rebase_source : 3292951aca97fd1a355c2fae5b0ab42d2064c548
2017-11-09 09:03:52 -05:00
Kartikaya Gupta
028fa48259 Bug 1415225 - Stop setting the EventRegionsOverride flag on in-process subdocument layers. r=botond
The mechanics of this change is fairly straightforward - instead of setting the
override on the layer corresponding to the in-process subdocument, we just set
the flag on the display list builder; that flag is already checked when building
the layer event regions for descendant nsIFrames.

As a side-effect, we also don't need to force a layer for in-process subdocuments
just because they have document-level APZ-aware listeners. One of reasons we were
doing so before was so that we would have a layer to stash the override flags on
but now we don't need that any more.

Note that out-of-process subdocuments are not affected; for those cases
the nsSubDocumentFrame delegates BuildDisplayList to
RenderFrameParent/nsDisplayRemote, which will still set the overrides on
the RefLayer that is created.

MozReview-Commit-ID: DZWglE4e62p

--HG--
extra : rebase_source : 78494a5cbfd0dfecb5f2262e5c1b3dc5367c5d55
2017-11-09 09:03:51 -05:00
Sebastian Hengst
1b0413a887 merge mozilla-inbound to mozilla-central. r=merge a=merge 2017-11-09 11:53:05 +02:00
Miko Mynttinen
845735af56 Bug 1395476 - Do not call mStoredList.RecomputeVisibility for 3d transforms r=mattwoodrow
MozReview-Commit-ID: 1pnYL2RtFi6

--HG--
extra : rebase_source : 85699125c4b547b99ce2bf8580e0cd40720a285b
2017-11-08 02:54:10 +01:00
Mats Palmgren
770a2228d1 Bug 1414666 part 2 - A few formatting improvements after mass conversion of PresContext()->PresShell() to PresShell(). r=emilio
MozReview-Commit-ID: FoEnINS0Jbk
2017-11-09 03:00:48 +01:00
Mats Palmgren
1c2b8c222e Bug 1414666 part 1 - Add nsIFrame::PresShell() for convenient access to the shell. r=emilio
MozReview-Commit-ID: 8FPTPKWyVtY
2017-11-09 03:00:48 +01:00
Narcis Beleuzu
218e1676cb Merge inbound to mozilla-central r=merge a=merge 2017-11-08 12:51:09 +02:00
Matt Woodrow
cd1604ef74 Bug 1414397 - Make sure we properly invalidate the entire frame subtree when detecting a caret frame change. r=miko
--HG--
extra : rebase_source : add63296c95ea090ca79ab120bede8038ce4f59e
2017-11-08 15:33:34 +13:00
Matt Woodrow
fca4960b0f Bug 1412110 - Make sure we build a wrap list for the caret frame, since it will have multiple display items. r=miko
--HG--
extra : rebase_source : b59ff089835023c96daa1e1bf1c7f5bde6c75f15
2017-11-08 15:32:27 +13:00
Matt Woodrow
0cd1c74fe2 Bug 1413833 - Don't use WeakFrame for the modified frame list since get slow with large numbers of frames. r=miko
--HG--
extra : rebase_source : c2c2f2c6435ad1b2f246d1339ee548dc60cec4b4
2017-11-08 15:25:44 +13:00
Coroiu Cristina
dc06fb21ec Merge mozilla-central to mozilla-autoland. r=merge a=merge on a CLOSED TREE 2017-11-07 01:13:57 +02:00
Manish Goregaokar
b5061541d9 Bug 1405881 - Add crashtest; r=hiro
MozReview-Commit-ID: BzM8KRn2MWv

--HG--
extra : rebase_source : 288825a0262a051ba379cdd74838c358f70901de
2017-11-06 11:30:49 -08:00
Manish Goregaokar
b8a28fb4e0 Bug 1405881 - Fix animation of -moz-transform matrices with percents ; r=hiro
MozReview-Commit-ID: 4XhKc0K0xmQ

--HG--
extra : rebase_source : 883fd587716a97d38827e576a8d1af808fa22f7e
2017-11-03 16:42:30 -07:00
Ethan Lin
0d2b959f9f Bug 1410583 - Make sure we paint the whole item for blob image. r=jrmuizel
MozReview-Commit-ID: 84LiyRA2WFC

--HG--
extra : rebase_source : 769128dff81e4610decf2fbe53196a94e7857773
2017-11-06 16:51:16 +08:00
Ethan Lin
f18aa8ed14 Bug 1413397 - Avoid empty border's fallback. r=kats
MozReview-Commit-ID: 1KXYjcObJdi

--HG--
extra : rebase_source : ea36d0f77dff76175dbc6d2a27cb0017e703e0bf
2017-11-01 17:30:04 +08:00
Kevin Chen
24e2b68f15 Bug 1409243 - Enable dotted and dashed border support for webrender; r=ethlin
MozReview-Commit-ID: 4TGeavMJY2Q

--HG--
extra : rebase_source : 1638dcf7abf66736e17b632fa2ae1f19bbe5e920
2017-10-25 10:17:41 +08:00
ANDREEA PAVEL
24a187da02 Merge mozilla-inbound to mozilla-central r=merge a=merge 2017-11-02 11:40:57 +02:00
Botond Ballo
864f4f712b Bug 1382534 - Use GetBounds() in nsDisplayMask::ComputeVisibility(). r=mstange
The code previously used GetClippedBoundsWithRespectToASR() (changed
in bug 1298218), but this violated the requirements of nsDisplayList::
ComputeVisibilityForSublist().

MozReview-Commit-ID: F9UVMvVKLAp

--HG--
extra : rebase_source : ec188650070d4e8de1b19395c3ed6f31e7d0e04f
2017-10-16 17:18:03 -04:00
Botond Ballo
6a7049b903 Bug 1382534 - Relax the requirement of having a clip with respect to an ASR for nsDisplayMask items. r=mstange
We allow an nsDisplayMask item to satisfy the requirement even it does not
itself have a clip, as long as its children have finite bounds with respect
to the ASR.

MozReview-Commit-ID: 8zKE0bguY38

--HG--
extra : rebase_source : 74baaea2647708d1cd024f9e6afd82508e95c74a
2017-09-25 19:15:23 -04:00
Botond Ballo
ce03fa59d0 Bug 1382534 - Move ComputeOffsetToUserSpace() from nsDisplayList.cpp to nsLayoutUtils. r=mstange
MozReview-Commit-ID: 8w9lDViJuAj

--HG--
extra : rebase_source : 4d9c47dd4f217471e743973d2f641a67dae509fe
2017-08-23 17:26:25 -04:00
Botond Ballo
4a2d5338c5 Bug 1382534 - Layerize active masks even with HWA disabled. r=mstange
MozReview-Commit-ID: 6lvOE3fGFAy

--HG--
extra : rebase_source : 86e4c07873890e14d57708f202d7c611635bf070
2017-08-09 16:25:19 -04:00
Sebastian Hengst
ca88e3c4c5 Merge mozilla-central to autoland. r=merge a=merge 2017-11-01 22:58:44 +01:00
Kartikaya Gupta
3c38110bd3 Bug 1406217 - Fix computation of scrollframe's offset to the reference frame. r=mstange
We need to get the offset across documents boundaries, since the scrollframe
might be inside a subdocument. In such cases we were previously computing
a (incorrect) zero offset for the scrollframe, which was throwing off the
margin for the sticky items inside the scrollframe.

MozReview-Commit-ID: AWeQ9ay2cmp

--HG--
extra : rebase_source : 7dd8eda26c482cc359042d79073740524efa792a
2017-10-31 09:04:04 -04:00
Jeff Muizelaar
4250e26d21 Bug 1413629. Don't require a PresContext to apply a clip. r=mstange
The only thing we use the PresContext for is the app units. I'd rather not
worry about keeping around a PresContext for the webrender display item
grouping.
2017-11-01 14:37:59 -04:00
Kartikaya Gupta
c832839650 Bug 1411627 - Send the applied offset for sticky frames to WR. r=mstange
There are cases where we do a main-thread paint at a scroll position
where sticky offsets have been applied in order to keep sticky items
visually unmoving. From that paint, it's possible to do an async-scroll
in the direction that reduces the sticky offset. In order for WR to
handle this case properly we need to tell WR how much of a sticky offset
was already applied on the main thread.

MozReview-Commit-ID: 79DsfPpsIfA

--HG--
extra : rebase_source : e39316702cff3bd4ee6721c7503a1a9267734cd8
2017-11-07 10:16:48 -05:00
Kartikaya Gupta
e7ff584b3a Bug 1411627 - Stop sending sticky clips to WR for scrollframes with no ASR. r=mstange
If the scrollframe has no ASR and is not async scrollable, WR will never
need to adjust the position of the sticky item. So we don't actually
need to send this data to WR. In theory this would be harmless but the
later patches in this bug actually expose another coordinate space
mismatch between the gecko and WR sticky-position code, so this patch is
needed to avoid the latent problem from manifesting to the user.

MozReview-Commit-ID: J0LMcU1FudA

--HG--
extra : rebase_source : 434ece364e6c793707e5a4a18008e4697096b0fd
2017-11-07 10:16:05 -05:00
Csoregi Natalia
423b2522c4 Merge inbound to mozilla-central r=merge a=merge 2017-11-01 12:14:00 +02:00
Matt Woodrow
95d77539ea Bug 1413073 - Don't check the dirty rect when deciding if we need to store OutOfFlowDisplayData for a frame. r=mstange 2017-11-01 16:58:53 +13:00
Kartikaya Gupta
3a399cf5e5 Bug 1412280 - Update sticky code for API change in WR PR 1940. r=jrmuizel
MozReview-Commit-ID: 2I8wpe3Bt1y

--HG--
extra : rebase_source : 5056aee8978c9bd5c51724ec909125de318f04ad
2017-10-31 09:17:22 -04:00
Ethan Lin
1da48a5cc4 Bug 1407938 - Part1. Add nsDisplaySVGWrapper for webrender as a fallback display item. r=jrmuizel
MozReview-Commit-ID: LBjrqvPziCJ

--HG--
extra : rebase_source : 4f48e0c57a7170bd1d6e97cc6b426aa0cf81be4b
2017-10-16 15:47:46 +08:00
Hiroyuki Ikezoe
dba3425d42 Bug 1190721 - Throttle animations that produce any transform change hint if the target element is out-of-view. r=birtles
And unthrottle them on every 200ms just like we do for transform animations on
the compositor.  To unthrottle the transform animations properly, we need to
update UpdateLastTransformSyncTime each time we compose the style for the
animations instead of updating it when we send the transform animation to the
compositor.  That's because display item for transform is built even while we
are throttling the transform animations for some reasons, so if we updated the
last transform sync time there, the time will not match what it should be.

MozReview-Commit-ID: GwMzJqUlzd2

--HG--
extra : rebase_source : 09e379191970687a9f35aead871acf450c63813e
2017-10-31 09:45:41 +09:00
Kartikaya Gupta
05fdcd08b7 Bug 1407749 - Stop doing fallback on box-shadow display items with varying radii. r=jrmuizel
Bug 1393383 already added support for these kinds of display items (where the
border radii are not all the same) to the BuildWebRenderCommands function, but
for some reason CanBuildWebRenderCommands was left untouched and so we do
a fallback for these items when we can support them just fine.

MozReview-Commit-ID: GOAaQMfF2YQ

--HG--
extra : rebase_source : f5f7a87483347e97b5b95dd535c5497d355aebf3
2017-10-31 15:53:26 -04:00
Kartikaya Gupta
f392c7eba8 Bug 1407752 - Avoid taking the webrender fallback path for empty borders. r=jrmuizel
MozReview-Commit-ID: BTSljrUuKcH

--HG--
extra : rebase_source : f5370968de71c9b46dee32b743908f971c1ed3df
2017-10-31 13:18:14 -04:00
Markus Stange
e691e26bec Bug 1386162 - Implement nsDisplayClearBackground using push_clear_rect. r=kats
MozReview-Commit-ID: DlGA7KuZzm0

--HG--
extra : rebase_source : 2c2b402c7f9f2df8cc7cc5e80aa591f3aae946ef
extra : source : 4003a8f5c3c8bf0146183eca287c7ee162bd3d57
2017-10-31 11:31:00 -04:00
Matt Woodrow
c53662b395 Bug 1411132 - Always recurse into merging for sub-lists, even when there isn't a matching new item, so that we find all items that need invalidating. r=ethanlin
--HG--
extra : rebase_source : 2f6066ca53b4ee456e2f33b13dd54ba79e63f8b6
2017-10-30 15:29:08 +13:00