Commit Graph

28039 Commits

Author SHA1 Message Date
Ryan Hunt
1966a0614d Remove BeginPaintBuffer (bug 1409871 part 18, r=nical)
Now that BeginPaintBuffer and BeginPaint are both implemented by content client,
I think it makes sense to just merge them into one method. This simplifies the
interface clients have to use.

MozReview-Commit-ID: 8bjH6WcpZS9

--HG--
extra : rebase_source : 1b22549c03299e1b1b9ba8a04f3c3e428577e062
2017-10-18 15:20:14 -04:00
Ryan Hunt
1b92ee86e6 Clean up some methods on ContentClient (bug 1409871 part 17, r=nical)
This commit does some more cleanup on the content client class hierarchy.
Some methods were virtual or instance methods when they didn't need to be.

MozReview-Commit-ID: 2y2D3zYtYvM

--HG--
extra : rebase_source : 41649182f1d99daae600568722f0b8615d27fe26
2017-10-18 14:54:26 -04:00
Ryan Hunt
d15300f70e Fix PrepareDrawTargetForPainting (bug 1409871 part 16, r=dvander)
CapturedPaintState::mTarget is actually a dual draw target to the black and
white draw targets, so this code will have the white draw target cleared black
and then white. This isn't incorrect, it's just wasteful.

MozReview-Commit-ID: ItgiSmegPK6

--HG--
extra : rebase_source : 13553bb1ec3c4b96a585ba4af4e8ff31f485e89e
2017-10-18 14:46:54 -04:00
Ryan Hunt
ab4e62caa0 Use a rect instead of a region for UpdateDestinationFrom (bug 1409871 part 15, r=nical)
UpdateDestinationFrom actually only uses a rect, so it's best to not be
misleading and force the clients of it to do the conversion.

MozReview-Commit-ID: EsUv3apqnku

--HG--
extra : rebase_source : 02fdd8f7ede0e1c4712a721e14a4ad809b6dff14
2017-10-18 14:35:18 -04:00
Ryan Hunt
9a100d70b9 Cleanup rotated buffer declarations and add some documentation. (bug 1409871 part 14, r=nical)
This organizes the rotated buffer declarations and adds some documentation.

MozReview-Commit-ID: 5r24RiUMM6o

--HG--
extra : rebase_source : 5279f7f754d41b06576f852672450d1d4bca803f
2017-10-18 14:10:56 -04:00
Ryan Hunt
d5a7ec4f84 Update comments for ContentClient (bug 1409871 part 13, r=nical)
This could be a part of the previous commit, but I omitted it to keep the size
down. Just some updates to comments and documentation.

MozReview-Commit-ID: HkCOSIQhBNv

--HG--
extra : rebase_source : bd94fa88d384123219528a6cf34c86e17f9de201
2017-10-18 13:42:19 -04:00
Ryan Hunt
1eea1ecca9 Kill RotatedContentBuffer (bug 1409871 part 12, r=nical)
This commit is the guts of the refactoring.

This commit removes rotated content buffer, and moves the necessary
functionality to content client. All content clients now do not inherit from
rotated content buffer, but contain a refptr to a rotated buffer.

For the basic content client, this is a DrawTargetRotatedBuffer.
For the remote content client, this is a RemoteRotatedBuffer.
The double buffered content client contains an additional RemoteRotatedBuffer
for the front buffer.

Each derived class of content client only needs to implement a method to
create its own rotated buffer. The rest is handled by the base content
client. The remote content clients still override some additional methods
to sync buffers and do IPC.

MozReview-Commit-ID: B9vcSi8UYhm

--HG--
extra : rebase_source : f4b1dcb3cd06f7d0da7ed85e5d3f4bf5ec445e7f
2017-10-16 19:45:11 -04:00
Ryan Hunt
4fad2db879 Move buffer related decisions into their own function. (bug 1409871 part 11, r=nical)
This commit splits off the part of BeginPaint that makes the decision about
whether to keep the buffer, its surface type, its content type, and the regions
to invalidate or paint.

MozReview-Commit-ID: JcPlv8GiRpA

--HG--
extra : rebase_source : 1867264e82fde108ff52ea295907851ce25dbff5
2017-10-12 19:52:29 -04:00
Ryan Hunt
81ae2fb680 Add RotatedBuffer::AdjustTo. (bug 1409871 part 10, r=nical)
This commit adds a method to rotated buffer to perform the adjusting to the new
destination rect, and potential unrotating that may need to happen. The goal of
this is to simplify and prepare BeginPaint to be moved to content client.

MozReview-Commit-ID: B4qeZqLjORR

--HG--
extra : rebase_source : 1878d562df2904fff8fbbf805e1d6b5d8533e337
2017-10-12 18:37:29 -04:00
Ryan Hunt
f84be40adb Remove PaintState::mDidSelfCopy. (bug 1409871 part 9, r=nical)
Miscellaneous cleanup, PaintState doesn't need to know this as no one uses
this information outside of the content client classes.

MozReview-Commit-ID: 6K8LxEPvp4V

--HG--
extra : rebase_source : 8bef61a47f423dd83ac9ea39b84f064bd7681e0c
2017-10-12 17:24:50 -04:00
Ryan Hunt
cb31baf93b Move mFrontAndBackBufferDiffer to ContentClientDoubleBuffered. (bug 1409871 part 8, r=nical)
Miscellaneous cleanup, ContentClientSingleBuffered doesn't need to track if
the front and back buffer differ.

MozReview-Commit-ID: IvAw0b92jsh

--HG--
extra : rebase_source : 8660ea8c3dfa8d34789e8f9b9ad6a58726879e49
2017-10-12 12:58:17 -04:00
Ryan Hunt
3c987579ae Refactor copying from the old buffer to the new buffer to use RotatedBuffer. (bug 1409871 part 7, r=nical)
This commit refactors part of BeginPaint to treat the new and old back buffer's
as rotated buffers. The goal of this is to simplify and prepare this function to
be moved out of rotated content buffer.

MozReview-Commit-ID: 5iHeMbCWfpo

--HG--
extra : rebase_source : a57ae63ba8b40ffa5558016f52860057bc0aecb6
2017-10-12 12:35:37 -04:00
Ryan Hunt
56b0784deb Add a DrawTargetRotatedBuffer. (bug 1409871 part 6, r=nical)
This adds a new implementation of rotated buffer, which is backed by draw
targets. This will be the rotated buffer that basic content clients use.

MozReview-Commit-ID: Knn79yEFnxN

--HG--
extra : rebase_source : 49f72c0974a6ba9715e9b0cea765ba45660475c5
2017-10-11 16:26:10 -04:00
Ryan Hunt
c654d74c54 Use a RemoteRotatedBuffer for the front buffer of ContentClientDoubleBuffered. (bug 1409871 part 5, r=nical)
The front buffer for a double buffered content client is really just another
rotated buffer, so it can simplify the code to use the class we just added.
The goal is to have the back and the front buffer using remote rotated buffers,
but this is a good first step.

Note: The front buffer is represented as a Maybe<RemoteRotatedBuffer> in this
commit, but in the future it will be a RefPtr. That can't be done yet, because
rotated buffer can't implement refcounting in addition to compositable client.

MozReview-Commit-ID: Czk3otkf1pb

--HG--
extra : rebase_source : e6b5e66f47ccdc1c75a3a2a9c73efc2b82a25890
2017-10-11 15:22:57 -04:00
Ryan Hunt
bb11dd83fa Add a RemoteRotatedBuffer. (bug 1409871 part 4, r=nical)
This adds a new implementation of rotated buffer, which is backed by texture
clients. This will be the rotated buffer that remote content clients use.

MozReview-Commit-ID: 3Y776uk5mFG

--HG--
extra : rebase_source : f193eec8af60a6e70345312cda0ce86cac70a7a2
2017-10-11 14:34:41 -04:00
Ryan Hunt
3e243339a6 Move DrawTo to RotatedBuffer. (bug 1409871 part 3, r=nical)
Similar to the previous patch, more functionality can be moved to rotated
buffer and out of rotated content client.

MozReview-Commit-ID: FNqfonyBBq9

--HG--
extra : rebase_source : cfc9c10d31baa48163107d0cf36c28a8ffda4ebb
2017-10-11 15:31:20 -04:00
Ryan Hunt
359bb9b20b Move UpdateDestinationFrom to RotatedBuffer. (bug 1409871 part 2, r=nical)
UpdateDestinationFrom is a useful method for any rotated buffer. This will be
needed when content clients are no longer rotated buffers.

Note: EnsureBuffer and EnsureBufferOnWhite were moved out of
UpdateDestinationFrom because I'd like to kill those methods, and so the calls
were moved to all users of UpdateDestinationFrom.

MozReview-Commit-ID: 2e3HhUsZ6iw

--HG--
extra : rebase_source : 73532ad481a4c0b1af63c4647e0e8f7f4c5b2dc3
2017-10-11 13:40:16 -04:00
Ryan Hunt
54735c4be0 Remove ContentClientRemote. (bug 1409871 part 1, r=nical)
This class doesn't seem to be necessary and only complicates the class
hierarchy.

MozReview-Commit-ID: 6dRXce1vB9T

--HG--
extra : rebase_source : 10b398f952979c4b0db4b95bd3a460a0cf00a9f8
2017-10-11 12:43:39 -04:00
Attila Craciun
7bcf901c3b Merge inbound to mozilla-central r=merge a=merge 2017-10-25 12:30:28 +03:00
Jeff Muizelaar
faa4cd1783 Bug 1410550. Allow updating a dirty rect of a blob image. r=kats 2017-10-24 18:11:04 -04:00
Kartikaya Gupta
d37fe26642 Bug 1405359 - Add some logging code in ScrollingLayersHelper. r=jrmuizel
MozReview-Commit-ID: Lb4UeUxO5HL

--HG--
extra : rebase_source : e5e8c58380055693664bb1a5241bab4d803dfdab
2017-10-24 18:47:24 -04:00
Kartikaya Gupta
4891a7a56f Bug 1405359 - Avoid pushing and popping identical clip stacks for adjacent display items. r=jrmuizel
Instead of unconditionally pushing and popping clips per display item,
this patch changes things so that for each recursive display list, we
create an ItemClips struct. We push this onto the stack when we enter
the display list, and pop it off at the end. For each display item, we
check to see if the clips would actually change compared to the previous
display item, and only do the pop/repush in that case.

MozReview-Commit-ID: J0MCc2V9hWT

--HG--
extra : rebase_source : 8617cfaa7391457867f01c1b619cb871a21bf3f5
2017-10-24 18:47:17 -04:00
Kartikaya Gupta
746bb09454 Bug 1405359 - Make ScrollingLayersHelper a more stateful class. r=jrmuizel
This makes ScrollingLayersHelper a non-RAII type class, and instead adds
methods to notify it of when we start processing a new transaction or a
new display item within the transaction. This patch has no functional
changes, it's non-obvious refactoring.

MozReview-Commit-ID: GEZzCGbVqB1

--HG--
extra : rebase_source : dd4fab7f34da7c5465ba474db670cf583e8dadf4
2017-10-24 18:46:44 -04:00
Kartikaya Gupta
4aa9c4885f Bug 1405359 - Replace the mPushed* variables with a more encapsulated struct. r=jrmuizel
Storing the per-item clip state in a struct like this will allow us to
easily compare the desired clip state across items, so we can avoid
doing unnecessary work when going from one item to the next. This patch
has no functional changes, it's just refactoring.

MozReview-Commit-ID: GX2FX4YDusO

--HG--
extra : rebase_source : 06d7bae5cbae99d2987881f26f7ebd26965c1799
2017-10-24 18:45:28 -04:00
Kartikaya Gupta
ead1f0c769 Bug 1405359 - Stop passing around the clip id cache in all the functions. r=jrmuizel
Instead just keep a ref to it as a member variable. No functional
change.

MozReview-Commit-ID: 9jSBdZRIGuV

--HG--
extra : rebase_source : cd1b2f500e9a833f7d42bce53bdaec2118e0d4c3
2017-10-24 18:45:04 -04:00
Sebastian Hengst
6231274042 Backed out changeset cb49e178390c (bug 1405359) for Windows build bustage in ScrollingLayersHelper.h. r=backout on a CLOSED TREE
--HG--
extra : amend_source : 81b0a5bd94ad8e5d83e455e5a226a578b7060dc4
2017-10-25 00:17:01 +02:00
Sebastian Hengst
1d775e1d29 Backed out changeset f6ce05f8e699 (bug 1405359) 2017-10-25 00:16:55 +02:00
Sebastian Hengst
c10fc4a634 Backed out changeset 154c415885b8 (bug 1405359) 2017-10-25 00:16:49 +02:00
Sebastian Hengst
eecd8d4a11 Backed out changeset 988d6a397ea8 (bug 1405359) 2017-10-25 00:16:43 +02:00
Sebastian Hengst
5a6323a88c Backed out changeset 1593dfc4cf04 (bug 1405359) 2017-10-25 00:16:37 +02:00
Kartikaya Gupta
0950c9499b Bug 1405359 - Add some logging code in ScrollingLayersHelper. r=jrmuizel
MozReview-Commit-ID: 3OLNPHlkO9M

--HG--
extra : rebase_source : dcfbae96dc8de0a5d726140a05b5807e2b03412d
2017-10-24 16:15:00 -04:00
Kartikaya Gupta
3bc78496af Bug 1405359 - Avoid pushing and popping identical clip stacks for adjacent display items. r=jrmuizel
Instead of unconditionally pushing and popping clips per display item,
this patch changes things so that for each recursive display list, we
create an ItemClips struct. We push this onto the stack when we enter
the display list, and pop it off at the end. For each display item, we
check to see if the clips would actually change compared to the previous
display item, and only do the pop/repush in that case.

MozReview-Commit-ID: GadIp2J8TrA

--HG--
extra : rebase_source : ba64c6b4659b8e51cab19b807088b9a50d71b85a
2017-10-24 16:15:00 -04:00
Kartikaya Gupta
1ef110fd03 Bug 1405359 - Make ScrollingLayersHelper a more stateful class. r=jrmuizel
This makes ScrollingLayersHelper a non-RAII type class, and instead adds
methods to notify it of when we start processing a new transaction or a
new display item within the transaction. This patch has no functional
changes, it's non-obvious refactoring.

MozReview-Commit-ID: 3yq9sPiHMge

--HG--
extra : rebase_source : 286423f56de59211e320f015cb1004a1e98332b8
2017-10-24 16:15:00 -04:00
Kartikaya Gupta
7feb6820bd Bug 1405359 - Replace the mPushed* variables with a more encapsulated struct. r=jrmuizel
Storing the per-item clip state in a struct like this will allow us to
easily compare the desired clip state across items, so we can avoid
doing unnecessary work when going from one item to the next. This patch
has no functional changes, it's just refactoring.

MozReview-Commit-ID: 49B6hmsWZ4V

--HG--
extra : rebase_source : 8ac4bbf039f81bc2d26e92924ed041fa3d18e5ba
2017-10-24 16:15:00 -04:00
Kartikaya Gupta
b43a3f46dc Bug 1405359 - Stop passing around the clip id cache in all the functions. r=jrmuizel
Instead just keep a ref to it as a member variable. No functional
change.

MozReview-Commit-ID: 5fccUlSifsA

--HG--
extra : rebase_source : a14672f926c383354db76e553ae23613fe4a432a
2017-10-24 16:14:59 -04:00
Kartikaya Gupta
54a6b4655a Bug 1409446 - Remove old code that is now unused. r=mstange
MozReview-Commit-ID: KEtcbIGTrn3

--HG--
extra : rebase_source : dd2a435cab15930b7d5277d1764eddefd4cca298
2017-10-24 15:46:00 -04:00
Kartikaya Gupta
1dc275308d Bug 1409446 - Switch over to the new code. r=mstange
One of the sticky-pos tests was only passing because of two wrongs that
cancelled each other out in the old code. Specifically, instead of
defining a nested clip with the sticky clip as an ancestor, the clip was being
defined with the root ASR as an ancestor. Both resulted in the nested
clip not scrolling with the actual scrolling scrollframe and so the test
was passing.

The new code changes things so that the nested clip is defined with the
actual scrolling scrollframe as the ancestor, causing the reftest to fail.
Fixing the clip ancestry is not hard but it reveals other problems so
so I'm deferring that to a follow-up bug.

MozReview-Commit-ID: DldAKi1AP4l

--HG--
extra : rebase_source : a448e06fd26fff21bbc4a6f50e04dbbdb427298c
2017-10-24 15:46:00 -04:00
Kartikaya Gupta
08961382de Bug 1409446 - Treat sticky clips as out-of-band clips. r=ethlin,mstange
MozReview-Commit-ID: C0KEuSrCPEQ

--HG--
extra : rebase_source : b4b42282f37ddbdb4b962ec72571bf280c1c47e4
2017-10-24 15:46:00 -04:00
Kartikaya Gupta
83ac5fdb91 Bug 1409446 - Handle nested display item scenarios. r=mstange
This handles some cases where a nested display item's clip chain
implicitly extends from the wrapper item's clip chain.

MozReview-Commit-ID: DmghxOWi81K

--HG--
extra : rebase_source : 8ec95df64fed247650baf8f5e0c868d1934aa6bc
2017-10-24 15:46:00 -04:00
Kartikaya Gupta
4fcc51960c Bug 1409446 - Work around the dual-ancestor case that WR doesn't handle yet. r=mstange
Bug 1409442 is tracking a change that will allow scroll layers to have
multiple ancestors. Without that, there are cases we cannot properly
handle, and so we need to ignore a clip in those scenarios. This patch
makes sure we do that instead of crashing.

MozReview-Commit-ID: 7AU4uyzT6if

--HG--
extra : rebase_source : d483c2a7ecff5cd488a53fa5e6b6da55cc3a1e29
2017-10-24 15:45:59 -04:00
Kartikaya Gupta
9b3a9d0d62 Bug 1409446 - Deal with scenario of two interchangeable DisplayItemClipChain objects causing a cache miss. r=mstange
MozReview-Commit-ID: 4FQvOmMUUKH

--HG--
extra : rebase_source : 9b497dc5f97345aee55f8dbf25d1db926c93c68f
2017-10-24 15:45:59 -04:00
Kartikaya Gupta
fdefb982b7 Bug 1409446 - Properly handle out-of-band clips in the new ScrollingLayersHelper code. r=mstange
When display items (such as mask items) push an out-of-band clip, we
can't use clip ids from, or update clip ids into, the cache. We also
need to ensure we take these out-of-band clips into account when
determining the parent for a new clip we are going to define.

MozReview-Commit-ID: GcUI2Hf6SLB

--HG--
extra : rebase_source : 512be5a6998b9c1d6db9d8c550231f0883d721c9
2017-10-24 15:45:59 -04:00
Kartikaya Gupta
eae58bd759 Bug 1409446 - Modify the extra-clip flag to instead track more useful information. r=ethlin,mstange
Instead of just keeping a count of how many "extra clips" (aka
out-of-band clips) we have pushed, track more complex information for
each clip. In particular, track the display item's normal clip chain, as
well as the clip id of the extra clip that was pushed. This will be
needed to override clip cache information in the next patch.

MozReview-Commit-ID: AWKDTkelhyL

--HG--
extra : rebase_source : 379e38550cf45d54862850f6c4aad0ac488f6ca9
2017-10-24 15:45:59 -04:00
Kartikaya Gupta
54e570d116 Bug 1409446 - Write the new recursive method to define clip chains. r=mstange
This code is more straightforward in its recursion than the old code,
and provides a relatively clean way to explicitly pass the desired
parent when defining a new clip or scroll layer.

Refer to the documentation in the patch for more details.

Note that this patch provides the basic recursive algorithm to define
the clips and scroll layers, although it omits some of the complicating
edge cases which will be added in later patches. The new code is not
invoked from anywhere until all the edge case handling has been done.

MozReview-Commit-ID: 7z51Kd7LlPU

--HG--
extra : rebase_source : 491efac9282a7379f7977a1bc0205ac70e356c3c
2017-10-24 15:45:58 -04:00
Kartikaya Gupta
26c5991efb Bug 1409446 - Unify the clip stack in WebRenderAPI. r=jrmuizel
By using a variant we can keep a single stack of both clips and
scrollframes, rather than two separate stacks. This is important because
we will want to know how the things are interleaved (e.g. if the last
thing that was pushed was a clip or a scrollframe).

MozReview-Commit-ID: DbhDj2tTq64

--HG--
extra : rebase_source : c591787f31e6ba864178e27197cf6dff42e39a8d
2017-10-24 15:45:58 -04:00
Kartikaya Gupta
d3658ef3fb Bug 1409446 - Remove unused function. r=jrmuizel
We don't use the code to track the parents of each scroll id, so we can
dump it and just keep a set of scroll ids that we've defined to avoid
redefining them.

MozReview-Commit-ID: HY8y7xt9AJ6

--HG--
extra : rebase_source : 681154ae6494330f74c022243237b50d4921813b
2017-10-24 15:45:58 -04:00
Kartikaya Gupta
2878061467 Bug 1409446 - Wire up the DefineClip and DefineScrollLayer APIs to allow specifying ancestry. r=jrmuizel
The APIs now allow providing the parent clip or scroll info explicitly
instead of having to push it on the stack. For now we just pass
Nothing() to preserve the existing behaviour, so this change is a
functinoal no-op.

MozReview-Commit-ID: dtNamN595

--HG--
extra : rebase_source : 3b6bd03b919bd31cd89e3f82283cb962f8f6abc5
2017-10-24 15:45:57 -04:00
Miko Mynttinen
d14980c3ad Bug 1411132 - Change layout.display-list.retain UpdatePolicy to Once r=mattwoodrow
MozReview-Commit-ID: VJPTFEfKkn

--HG--
extra : rebase_source : 3eb9c16c80b4e2b888273349589c089e49cee26e
2017-10-24 17:42:18 +02:00
Sebastian Hengst
dbf343872c merge mozilla-central to autoland. r=merge a=merge 2017-10-24 11:54:19 +02:00
Sebastian Hengst
31bf3a1a42 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: 4Lk5P5UYmTe
2017-10-24 11:52:35 +02:00