This code was originally added to debug the frame visibility code.
However it wasn't architected correctly and makes the compositor use an
untrusted layers id from content. Instead of fixing this I'd rather just
delete it, since it's a big pile of code that is basically a debugging
tool that nobody owns anymore.
MozReview-Commit-ID: nPZqVeYsFp
This works around a rendering failure on Windows where the browser window opens
and remains white. Details of why this happens can be found in bug 1442748; this
workaround just forces a scene build if we get a GenerateFrame request after
having the root pipeline id set on the pending scene, but if it hasn't yet
been propagated to the current scene. This ensures the render isn't skipped
and prevents the C++-side frame throttler from preventing future composites.
This interface should be used for accessing any sampler-thread functions
on APZCTreeManager. Eventually the interface will handle thread
delegation so that if it is called from a thread that is not the sampler
thread it will redirect the calls appropriately. For now it just allows
to logically group the public APZCTreeManager methods that are to be run
on the sampler thread.
MozReview-Commit-ID: GArPvjfuYYr
--HG--
extra : rebase_source : 884cf6c3ce00f3df8ffe7dfa5fc12ef971f3cefc
This static function has only two call sites. One (in GPUProcessManager)
is unused, so it can be removed. The other (in
InProcessCompositorSession) takes the returned APZCTreeManager and
exposes it as an IAPZCTreeManager. Instead of doing this, we can simply
expose it as an IAPZCTreeManager from CompositorBridgeParent itself, to
reduce the number of places that can potentially grab a handle to the
APZCTreeManager.
MozReview-Commit-ID: BjLf6GSsnKz
--HG--
extra : rebase_source : ab24190a12053db06192fab4d1b7a932fe2d1724
The sampler thread is similar to the controller thread in that it doesn't
correspond to a particular actual thread, but instead introduces an
abstraction that allows us to reason about code flow and data ownership
that is logically grouped on a single thread. For now the sampler thread
remains mapped to the compositor thread, but eventually we will allow
it to be render backend thread when webrender is enabled.
MozReview-Commit-ID: D6i2t5lDvkv
--HG--
extra : rebase_source : 06211ad878973c76ca3fd618386bbbd0cfdd4821
Calling GetIndirectShadowTree and holding on to the result - or holding
on to pointers from the LayerTreeState - is fine on the compositor
thread, but if we want to allow APZ to accept layer updates and scroll
offset sampling on some other thread, then we should avoid doing this.
This patch replaces calls to GetIndirectShadowTree with the
CallWithIndirectShadowTree function and ensures anything that outlives
the function is held on to with a RefPtr. Of course, this only takes
care of the more superficial concerns - we will also need to robustify
those classes' implementations to handle being called from multiple
threads; that will be tackled later.
MozReview-Commit-ID: E40JGFjooPo
--HG--
extra : rebase_source : e2f88c621433bb99919abf2d3a78ce1c53463d2d
This encapsulates the APZTestData better inside APZCTreeManager, which
we will want once we allow the hit-test tree update to happen on a
thread other than the compositor thread.
MozReview-Commit-ID: 66uSsagVfEu
--HG--
extra : rebase_source : 8e6ae809bfa0dde4e0e5fb2e321dd315174eafd6
Instead of keeping track of all the layers ids that we've seen during
the tree walk, we can now just get notified when a layer subtree is
removed, and clear out the state for that layers id at that point.
MozReview-Commit-ID: DVlWX3upWJ6
--HG--
extra : rebase_source : 8510418115a86a3c898f055db2cfa92cda2a0642
These two structs store very similar state (including duplicating the mask layer common clip count), and the former uses an expensive hashtable for lookups.
This patch combines the two, and uses a vector of entries instead of the hashtable so we can do the cleanup pass.
* * *
[mq]: fix
MozReview-Commit-ID: KamhbGAIqpD
--HG--
extra : rebase_source : 2d4c1522b04018dfab5cd4eabde828349548548c
image.animated.decode-on-demand.threshold-kb is the maximum size in kB
that the aggregate frames of an animation can use before it starts to
discard already displayed frames, and redecode them as necessary. The
lower it is set to, the less overall memory we will consume at the
expense of execution time for as long as the tab with the animation(s)
above the threshold are kept open.
image.animated.decode-on-demand.batch-size is the minimum number of
frames we want to have buffered ahead of an animation's currently
displayed frame. The decoding will request this number of frames at a
time to maximize use of memory caching. Note that this is related to the
above preference as well; increasing the batch size will in effect raise
what the minimum threshold. This simplifies the logic in patches later
in the series.
Now that what we use to decide whether a document is styled by Servo are only
prefs and the doc principal, we don't need to inherit the style backend type,
since unless the pref has changed, the result will be the same.
MozReview-Commit-ID: KBmeBn1cRne
In some cases we can end up with a PaintedLayerComposite still present
in the layer tree but with its mBuffer cleaned up. Whether this should
be occurring or not is still under discussion, but nevertheless a
PaintedLayerComposite without its mBuffer should not be considered
opaque, and treating it as opaque results in a black flash on OSX when
following links from the activity stream.
MozReview-Commit-ID: KklHEivfBWZ
--HG--
extra : rebase_source : aaad21550d520501b788505389ad7006dc41377c
As for now, the scrollable direction with a mouse wheel for a single-line text
control is hard-coded; that is, only horizontal wheel scrolls are able to take
effect while vertical ones aren't. However, this isn't the desired case for
vertical writing mode, where the opposite case definitely suits better.
This commit refines the hard-coded scrollable direction for a single-line text
control to be writing-mode-adaptive.
MozReview-Commit-ID: 4Zkoe2ExPCZ
--HG--
extra : rebase_source : 113b2ea80b6bbbcd2d8379b438de97eedd616551
This is only hooked up for the codepath where the event regions are built
from nsDisplayCompositorHitTestInfo display items, not for when they're
build from nsDisplayLayerEventRegions display items.
--HG--
extra : rebase_source : 4f6fedcd9522362e2e62678428987180399bb796
Not calling SimpleTest.finish() causes the test to hang, which isn't helpful.
MozReview-Commit-ID: 2RBpjnG5B9l
--HG--
extra : rebase_source : b528b83f431c89ff5b21fdd725b2c371edd9b29a
Seems like a footgun to leave mCursor pointing to some random value when
the shmems have been swapped out. Currently nobody seems to be reusing
one of these things after a Flush() call but this should make things work
better if anybody tries.
MozReview-Commit-ID: AKfN0TlIMjU
--HG--
extra : rebase_source : 4eabe72eeaf7a33a3ac70d4ddae8fa65c66b8d15
The "continue" statement makes it look like the loop can run multiple
allocations in a row when that never actually happens. (And if it did,
the latter half of the loop would do the wrong thing). This patch
removes the spurious continue statement and replaces it with a more
useful assertion that documents the state at that point.
MozReview-Commit-ID: 3rpVZ1imX2y
--HG--
extra : rebase_source : 7a9ecf1654b744f6c9fe617b06c3bc973c179821
The shared memory handle reporting has been generalized to be an
external handle reporting. This is used for both shared memory, and for
volatile memory (on Android.) This will allow us to have a better sense
of just how many handles are being used by images on Android.
Additionally we were not properly reporting forced heap allocated
memory, if we were putting animated frames on the heap. This is because
we used SourceSurfaceAlignedRawData without implementing
AddSizeOfExcludingThis.
image.mem.volatile.min_threshold_kb is the minimum buffer allocation for
an image frame in KB before it will use volatile memory. If it is less
than it will use the heap. This only is set to > 0 on Android.
image.mem.animated.use_heap forces image frames to use the heap if it is
for an animated image. This is only enabled for Android, and was
previously a compile time option also for Android.
Note that this patch also replaces legacy VK_* with KEY_*, and replaces
synthesizeKey() for inputting some characters with sendString() because
it's better and clearer what it does and it sets shiftKey state properly.
MozReview-Commit-ID: De4enbjux3T
--HG--
extra : rebase_source : 2296b84bff8e22f01eeb48cd8614fac5db11136a
This makes it possible to implement nsDisplayBlend blob image invalidation.
It currently only includes an implementation for Skia and DrawTargetRecording.
All other backends will crash when used.
MozReview-Commit-ID: 2GhdDxi4jHG
Move the initialization of SharedSurfacesParent from the compositor
thread creation to mirror the other WebRender-specific components, such
as the render thread creation. Now it will only be created if WebRender
is in use. Also prevent shared surfaces from being used by the image
frame allocator, even if image.mem.shared is set -- there is no purpose
in allowing this at present. It was causing startup crashes for users
who requested image.mem.shared and/or WebRender via gfx.webrender.all
but did not actually get WebRender at all. Surfaces would get allocated
in the shared memory, try to register themselves with the WR render
thread, and then crash since that thread was never created.
The image decoding thread pool can grow to be quite large, up to 32
threads, depending on the number of processors on the system. If the
user is not actively browsing, these threads are occupying resources
which could be reused elsewhere. After the timeout period, it will
release up to half of the threads in the pool.
Move the initialization of SharedSurfacesParent from the compositor
thread creation to mirror the other WebRender-specific components, such
as the render thread creation. Now it will only be created if WebRender
is in use. Also prevent shared surfaces from being used by the image
frame allocator, even if image.mem.shared is set -- there is no purpose
in allowing this at present. It was causing startup crashes for users
who requested image.mem.shared and/or WebRender via gfx.webrender.all
but did not actually get WebRender at all. Surfaces would get allocated
in the shared memory, try to register themselves with the WR render
thread, and then crash since that thread was never created.
The recovery is only enabled for release builds, to avoid papering over
such hit testing bugs. On nightly builds, a diagnostic assert is issued.
MozReview-Commit-ID: Aos0j0jv6Lb
--HG--
extra : rebase_source : 1cb7fa24ed1f3cba7344f52670626bdeb41b51cc
When ContentChild::RecvInitRendering is received, it tries to setup the
IPDL actors related to rendering. If the GPU process crashes before or
during this process, it will fail, and cause the content process to
crash as well. This is unnecessary because the UI process will either
restart the GPU process, or subsume its job into itself, and trigger
ContentChild::RecvReinitRendering. It is a similar case for failures in
ContentChild::RecvReinitRendering.
Since the GPU process crashing should be a recoverable scenario, we now
check if the remote IPDL actor is in the UI or the GPU process. If it is
in the UI process, it will fail/crash as it does today. If it is in the
GPU process, it will wait for the next
ContentChild::RecvReinitRendering.
For failures that are not IPDL related (e.g. failed to get some resource
like spawning a thread), we release assert specifically for those
failures. They are not recoverable.
This commit introduces a lock on each FilterNodeSoftware around the cached surface.
This lock must be acquired whenever the cached surface is accessed. Currently this
is when the Filter is invalidated or painted.
When painting we only hold the cache lock when determining if we need to compute
a new surface, and after we have computed that new surface. This allows another
thread that may be painting that filter node at a different rect to not contend
on the cache. This is just theoretical though as DrawTargetTiled doesn't clamp
the source rect of the Filter command to the tile rect.
MozReview-Commit-ID: KFVZ35e1czB
--HG--
extra : rebase_source : a22918df80a24fad216a834a5737249cab570f08
This is a just a back out of changeset 6882857e1bb5.
MozReview-Commit-ID: 9Z6iEHl3eAy
--HG--
extra : rebase_source : 3d091c72a6e589e702d90ffe6800e131b009604b
The image decoding thread pool can grow to be quite large, up to 32
threads, depending on the number of processors on the system. If the
user is not actively browsing, these threads are occupying resources
which could be reused elsewhere. After the timeout period, it will
release up to half of the threads in the pool.
We will re-use these methods to perform various calculations once we introduce
the pending playback rate.
MozReview-Commit-ID: 2HV44TTNxHg
--HG--
extra : rebase_source : 19e32b13c6fee9cfe9993918557f2433aa687e11
The change to RootAccessible.cpp fixes an obvious bug introduced in bug 741707.
The visibility changes in gfx/thebes are because NS_DECL_ISUPPORTS has a
trailing "public:" that those classes were relying on to have public
constructors.
MozReview-Commit-ID: IeB8KIJCGhU
There's only one caller so let's just eliminate inline FillAzure into
Fill.
MozReview-Commit-ID: JYpAQMkhEcS
--HG--
extra : rebase_source : 962b046405949d435537a77baea50f631a8aee72
Add a command CreateClippedDrawTarget to DrawTarget, which takes the
max required size and a transform between this draw target and the one
to be created. The created draw target may have its size clipped to
the size of this draw target, transformed to the new target's
space. This means that the new surface will be large enough so
that it is rendered to this draw target correctly, but not necessarily
any larger.
Usually this will just create a draw target of the requested size, for
simplicity. However, when replaying a recorded draw target we do clip
the size to the base draw target's size. This is done using a
DrawTargetTiled, so when applying the mask in PopLayer, we must take
the SourceSurface's offset in to account.
MozReview-Commit-ID: 89ONElphzLu
--HG--
extra : rebase_source : 7eebeb66a2686a7b6f4ade36f3004ebb06abc2fe
Fix the DrawTargetTiled::mRect initialization, and expose through the
virtual function GetRect(). Make SnapshotTiled::GetDataSurface()
allocate a surface the size of this rect, rather the XMost and
YMost. Callers of SourceSurface::GetDataSurface() can query
SourceSurface::GetRect() and apply the necessary offset themselves.
MozReview-Commit-ID: C31FGirQ0oK
--HG--
extra : rebase_source : ac31ae3ca0a0b188f9293c4e6898b4e4a65cad0e
Changing the transaction id allocator is now handled better in
ClientLayerManager than before in that it resets the transaction id on
the new allocator to match the old allocator and avoid discontinuities
in the transaction ids. We should apply this behaviour to
WebRenderLayerManager as well, because WebRenderLayerManager was
assuming that any time the allocator changed it would automatically
start the transaction id at 1, which is not the case. In particular,
when navigating to something in the bfcache, we can reuse a pre-existing
refresh driver which might have a transaction id already greater than 1.
MozReview-Commit-ID: 8IUn1Dhnh7c
--HG--
extra : rebase_source : 0e98c96d9636c3a3ee0489ff6b6161bce7677dd7
bug 1379920 changed the way of dirty flag handling. And the dirty flag was not set when CopyableCanvasRenderer::ClearCachedResources() is called. Then ShareableCanvasRenderer::UpdateCompositableClient() did not update canvas.
The important part here is that the test parent page
(test_bug1151663.html) waits for paints to complete before spawning the
helper window. Otherwise, the helper window might think it's done
painting (because it is) and start running the test even though its
layer tree has not been attached to the chrome layer tree. In such a
scenario reading the APZ test data produces an empty tree for the
content layers id and causes the test to fail.
This test was written before we had waitUntilApzStable so sprinkling some
of that into the test makes it more robust in general as well.
MozReview-Commit-ID: J8rqW6dcy23
--HG--
extra : rebase_source : f9e28bd15f355c88649ff1797b1f1205824bf815
A Box is like a Rect but represented as (x1, y1, x2, y2) instead of
(x, y, w, h).
The API is bare-bones at the moment; it can be extended as needed
by future users.
MozReview-Commit-ID: FWv69Y5hP6t
--HG--
extra : rebase_source : 1f717727bc724842a2f6adcba9e6cbbe50059436
The struct initially stores just one flag, mTargetConfirmed, but is
introduced with the intention of expanding it to store additional ones.
MozReview-Commit-ID: 88255UvoYYQ
--HG--
extra : rebase_source : 6826899367d19decbb6da0b3d25f32758c46dcec
We will re-use these methods to perform various calculations once we introduce
the pending playback rate.
MozReview-Commit-ID: 2HV44TTNxHg
--HG--
extra : rebase_source : dcc883fb6db897a799900d709ca9c182dc149764
The only call to IsBackfaceVisible() was removed when we added proper backface
visible support.
MozReview-Commit-ID: ALAF4a0ScQJ
--HG--
extra : rebase_source : 9a138f9ca4244105b4692b340c95e1dbc03f0356