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 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.
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
CompositorBridgeChild may be lost at any time due to a GPU process
crash. Additionally it may be already destroyed due to shutdown being
initiated. For FlushAsyncPaints, we can safely ignore the missing child
because the subsequent operations will generally fail and we will
recover when the GPU process is respawned (or switched to the UI
process).
Bump mingw version to get the newest commit and do not include the
un-needed dw-extras.h on MinGW (thanks Jacek!)
MozReview-Commit-ID: OjO93XHCxs
--HG--
extra : rebase_source : 933bbb385004988a23d1069c9cd3241b3a3b336e
This also changes the function to return a sequence (JS Array) instead of
an nsFontFaceList object, and converts nsFontFace/nsIDOMFontFace into a
Web IDL implemented object too.
MozReview-Commit-ID: 1iAW3DYe5kO
--HG--
rename : layout/inspector/nsFontFace.cpp => layout/inspector/InspectorFontFace.cpp
This commit adds a paint worker thread pool to PaintThread, and dispatches
tiled paints to it. The thread pool is only created if tiling is enabled,
and its size is set by 'layers.omtp.paint-workers' and defaults to 1. If
-1 is specified, it will be sized to 'max((cpu_cores * 3) / 4, 1)'.
The one tricky part of dispatching tiled paints to a thread pool is the
AsyncEndLayerTransaction message that must execute once all paints are
finished. Previously, this runnable would be queued after all the paints
had been queued, ensuring it would be run after they had all completed.
With a thread pool, there is no guarantee. Instead this commit, uses
a flag on CompositorBridgeChild to signify whether all of the paints
have been queued ('mOutstandingAsyncEndLayerTransaction'), and after
every tiled paint it is examined to see if that paint was the last
paint, and if it is to run AsyncEndLayerTransaction. In addition,
if the async paints complete before we even mark the end of the
layer transaction, we queue it like normal.
The profiler markers are also complicated by using a thread pool.
I don't know of a great way to keep them working as they are per
thread, so for now I've removed them. I may have been the only
one using them anyway.
MozReview-Commit-ID: 5LIJ9GWSfCn
--HG--
extra : rebase_source : 0c26806f337a1b4b1511945f9c72e787b426c5ba
Mechanism for restricting pinch zooming when gesture is a two
finger pan. If the pinch span is below a given threshold and the
scroll distance above a given threshold then the zoom level is
maintained to allow for smooth panning with two fingers.
MozReview-Commit-ID: 62Fv0WeplOo
--HG--
extra : rebase_source : 71d7da4c4b4cc3a5adde13ad1a7c1fbf49856c35
Returning a zero-sized viewport in the case there's no shell / pres context.
For now, no other change yet. After this we can start tweaking the ShadowRoot
Stylist setup, and even try to return computed styles without a document \o/.
MozReview-Commit-ID: 3cT2PKQISri
We call PDFiumParent::Close twice under certain conditions. Once in
PDFiumProcessParent::Delete, and once in PDFiumProcessParent's dtor. So we may
hit MOZ_ABORT which tell us that we are trying to close a closed channel.
This patch prevents hitting this abort by:
1. Only close the channel in PDFiumProcessParent::Delete, remove another call
in PDFiumProcessParent's dtor. (Please see the change in
PDFiumProcessParent.cpp).
2. Remove PDFiumParent::AbortConversion and relative code. We can just use
PDFiumParent::EndConversion instead. When calling PDFiumParent::Close, we
actually close the IPC channel *synchronously*, which means there is no need
to register a callback by PDFiumParent::AbortConversion to receive
actor-destroy callback.
MozReview-Commit-ID: 9i5j6t54J3h
--HG--
extra : rebase_source : 5f74ebc1ecc29e9983c30ca2dd63e0b49bd24a50
While aborting conversion, we need to make sure there is no coversion task
executing in the PDFium process before destroying it.
MozReview-Commit-ID: 3Iqhe8KmYv2
--HG--
extra : rebase_source : 70d9f0b2e2986499e3061823e0c29830aa81d232
extra : source : 753ed705666fd4c55da456fb80604e4552d6bd52
Before we introduce PrintTargetEMF, all PrintTargets finish page printing task
before the end of PrintTarget::EndPage(). Unlike others, a page printing
in PrintTargetEMF is done after receiving an async callback from the pdfium
process. So we have both async and sync page printing behavior now. This patch
is trying to make both of them work correctly while priting a content document.
MozReview-Commit-ID: 2PHJToFlvtu
--HG--
extra : rebase_source : 9d2d7cf7330a157a0e5c6a414c75de94ca3fb5a1
extra : source : f61eb00f83acf45511d8448922212dccb12b05aa
We integrate PrintTargetEMF with the PDFium process to convert PDF into EMF in
this patch.
MozReview-Commit-ID: 5F0setrL94n
--HG--
extra : rebase_source : 1e52adbbe7502ca081c7029a15e4b3f486beb284
extra : source : 28f1671230fa70125e6971c9a287cb0658b89496
A new subclass of PrintTarget.
1. It uses PrintTargetSkPDF to generate one PDF FileDescriptor for one page.
2. In a later patch, it then passes that FD to PDFium process for converting
a PDF page to EMF contents.
Implementation of integration with PDFium actor is added the subsequent patches.
MozReview-Commit-ID: EcuBJHRW8Wk
--HG--
extra : rebase_source : 838d798161e112952b5e148bbece730159cd49ca
We will create several new files in the following patches for IPC and a new
subprocess. Several already existed files will be shifted into new build units,
we will meet several compile errors because of it.
This patch fixes those compile error in advance.
MozReview-Commit-ID: 5hd0sNYfBu0
--HG--
extra : rebase_source : d4cca529623586188ffebffd858f53188d12bb50
- Add pref to enable the ovrInit_Invisible flag for Oculus sessions, enabled by default.
- Ensure that the Oculus library is unloaded every time it is uninitialized,
improving reliability of exiting and returning to WebVR.
MozReview-Commit-ID: 6VCugCJ2dUz
--HG--
extra : rebase_source : c6002bbaab650a86a31f62b63029f13ce2c8f614
While aborting conversion, we need to make sure there is no coversion task
executing in the PDFium process before destroying it.
MozReview-Commit-ID: 3Iqhe8KmYv2
--HG--
extra : rebase_source : c4597de6c13d35024090ec1e851ad1db5b790c7a
extra : source : 753ed705666fd4c55da456fb80604e4552d6bd52
Before we introduce PrintTargetEMF, all PrintTargets finish page printing task
before the end of PrintTarget::EndPage(). Unlike others, a page printing
in PrintTargetEMF is done after receiving an async callback from the pdfium
process. So we have both async and sync page printing behavior now. This patch
is trying to make both of them work correctly while priting a content document.
MozReview-Commit-ID: 2PHJToFlvtu
--HG--
extra : rebase_source : ee691497bd439c6505f1f92898a667a9e972fff3
extra : source : f61eb00f83acf45511d8448922212dccb12b05aa
We integrate PrintTargetEMF with the PDFium process to convert PDF into EMF in
this patch.
MozReview-Commit-ID: 5F0setrL94n
--HG--
extra : rebase_source : 3dfc6ce64f4cdc7d5d7e95d1f064d956af909a26
extra : source : 28f1671230fa70125e6971c9a287cb0658b89496
A new subclass of PrintTarget.
1. It uses PrintTargetSkPDF to generate one PDF FileDescriptor for one page.
2. In a later patch, it then passes that FD to PDFium process for converting
a PDF page to EMF contents.
Implementation of integration with PDFium actor is added the subsequent patches.
MozReview-Commit-ID: EcuBJHRW8Wk
--HG--
extra : rebase_source : 459089204c023282a699bfd87b4db5b1783db98d
We will create several new files in the following patches for IPC and a new
subprocess. Several already existed files will be shifted into new build units,
we will meet several compile errors because of it.
This patch fixes those compile error in advance.
MozReview-Commit-ID: 5hd0sNYfBu0
--HG--
extra : rebase_source : 0d85c823e4ead4f09175f2cc83df811b2b4081ec
While aborting conversion, we need to make sure there is no coversion task
executing in the PDFium process before destroying it.
MozReview-Commit-ID: 3Iqhe8KmYv2
--HG--
extra : rebase_source : b82fe3b7231d9c4a171d6a19cd22c0c7ff47b4bf
extra : source : 753ed705666fd4c55da456fb80604e4552d6bd52
Before we introduce PrintTargetEMF, all PrintTargets finish page printing task
before the end of PrintTarget::EndPage(). Unlike others, a page printing
in PrintTargetEMF is done after receiving an async callback from the pdfium
process. So we have both async and sync page printing behavior now. This patch
is trying to make both of them work correctly while priting a content document.
MozReview-Commit-ID: 2PHJToFlvtu
--HG--
extra : rebase_source : 3531dd6a100e9518d8cb9904326250a8318cdad2
extra : source : f61eb00f83acf45511d8448922212dccb12b05aa
We integrate PrintTargetEMF with the PDFium process to convert PDF into EMF in
this patch.
MozReview-Commit-ID: 5F0setrL94n
--HG--
extra : rebase_source : 576e077f804785da20923620d9c4e3041936e835
extra : source : 28f1671230fa70125e6971c9a287cb0658b89496
A new subclass of PrintTarget.
1. It uses PrintTargetSkPDF to generate one PDF FileDescriptor for one page.
2. In a later patch, it then passes that FD to PDFium process for converting
a PDF page to EMF contents.
Implementation of integration with PDFium actor is added the subsequent patches.
MozReview-Commit-ID: EcuBJHRW8Wk
--HG--
extra : rebase_source : f977e6863b9f2ee961648ddaf13f5e30a3659410
We will create several new files in the following patches for IPC and a new
subprocess. Several already existed files will be shifted into new build units,
we will meet several compile errors because of it.
This patch fixes those compile error in advance.
MozReview-Commit-ID: 5hd0sNYfBu0
--HG--
extra : rebase_source : b6b8b069f8f2167ef87266ba9c95e8fe53cca6f6
- Ensure ovr_GetSessionStatus is polled even when a VR presentation
is not active.
- When we fail to initialize an Oculus Session or detect VR hardware,
immediately unload the Oculus Library as we can't poll for ShouldQuit
without a valid Oculus session.
- When we poll ovr_GetSessionStatus, we are now updating the mounted state
in VRDisplayInfo::mIsMounted.
- Added prefs to control enumeration throttling and timeout to release
VR hardware when inactive.
- Some refactoring to make frame loop more understandable and less
brittle.
- When throttling enumeration, we ensure that all other VR apis
also throttle enumeration so that they don't pick up the same device
during throttling.
- Some long functions in VRManager have been broken up and
had their inner-workings documented in more detail.
MozReview-Commit-ID: CEYwwQ9mYd0
--HG--
extra : rebase_source : b2ab0dfc17b9ddc06f6afafdf69497fb9418fd47
This was previously limited to 2 per principal and 4 total on
mobile. Mobile GPU drivers have progressed a lot since the limit was
put in place, and the strict limit is causing webcompat issues on
google maps.
Increase to 8 per principal and 16 in total, bringing us
closer in line with Chrome. Make these limits contrallable via a pref
so that if there are any problems it is easy to change.
MozReview-Commit-ID: 8Tsbrjr4KCE
--HG--
extra : rebase_source : 8efd43265a665237a8bfcb689f5fc758466bcd71
- As we are creating a separate VR process in Bug 1362578,
we will need our own D3D11Device.
- Eventually, we will be allowing the VR device runtimes to
help select the appropriate adapter / device based on the
physical connection. This function will be updated at that
time.
MozReview-Commit-ID: EewUkNxU3BI
--HG--
extra : rebase_source : d89dd4dcc71f2b0dc54711f50628ee3bc494b73e
High resolution, high framerate was disabled by default on old AMD cards on the provisio that it was bad. But this assumes that the CPU decoder could do it better.
This assumption appears fragile at best, as CPU with those old adapter are likely to be old and underpower to start with.
Chrome doesn't appear to restrict use of those cards to a given resolution.
So we disable this restriction, while making it user configurable.
MozReview-Commit-ID: HhADHNR0FdJ
--HG--
extra : rebase_source : ece39cd9b84c6e372d1002ee12e72523cee3d04d
Setting the 'layout.display-list.retain.verify' gfxPrefs implies
'layout.display-list.build-twice', and then compares the retained-built tree
to the non-retained one, and outputs differences&trees to the terminal.
MozReview-Commit-ID: 3dnyIUTbtH8
--HG--
extra : rebase_source : 36a6b8f029d0bd1339557e7c630906311ecf1254
Factory::DoesBackendSupportDataDrawtarget already fulfills the same
purpose and we should use that instead, as imgFrame is the only user of
the former API. It has the added bonus of allowing us to use shared
surfaces on Linux with WebRender, and using volatile surfaces on Windows
when D2D is disabled.
moz_posix_memalign is a wrapper for posix_memalign that only exists if
posix_memalign exists.
On OSX, it has a fallback for an under-specified bug where it
purportedly returns a pointer that doesn't have the requested alignment.
That fallback was added in bug 414946, over 6 years ago, before jemalloc
was even enabled on OSX.
Considering posix_memalign is used directly in many other places in
Gecko, that we almost always use mozjemalloc, which doesn't have these
problems, and that in all likeliness, the bug was in some old version of
OSX that is not supported anymore, the fallback does not seem all that
useful.
So, just use posix_memalign directly.
--HG--
extra : rebase_source : b2151b5fb598dc20cbd70308555059f7545b18b2
This commit modifies MultiTiledContentClient to record drawing commands and
replay them to the tiled draw target on the paint thread when OMTP is enabled.
MozReview-Commit-ID: 22zL3c4NZvu
--HG--
extra : rebase_source : f8256b678da683da76edc02769dd4d0ebe234e09
- Ensure ovr_GetSessionStatus is polled even when a VR presentation
is not active.
- When we fail to initialize an Oculus Session or detect VR hardware,
immediately unload the Oculus Library as we can't poll for ShouldQuit
without a valid Oculus session.
- When we poll ovr_GetSessionStatus, we are now updating the mounted state
in VRDisplayInfo::mIsMounted.
- Added prefs to control enumeration throttling and timeout to release
VR hardware when inactive.
- Some refactoring to make frame loop more understandable and less
brittle.
- When throttling enumeration, we ensure that all other VR apis
also throttle enumeration so that they don't pick up the same device
during throttling.
- Some long functions in VRManager have been broken up and
had their inner-workings documented in more detail.
MozReview-Commit-ID: CEYwwQ9mYd0
--HG--
extra : rebase_source : b82cd9f200e6311528d4bed469d1b8044e9fc7f2
extra : amend_source : e74f56f5ec95641fd478deb71d6c7ba5d2cba7b1
This commit removes the `layers.omtp.force-sync` preference and replaces
it with a preprocessor define that is commented out. This commit also
changes the behavior of force-sync so that it also does synchronization
with CompositorBridgeChild like normal OMTP. This simplifies the code
and makes using a preprocessor define easier.
MozReview-Commit-ID: 6RfuFTFBdMh
--HG--
extra : rebase_source : 0778a3087324b9e87f44587efbb49c71edf47f23
This also adds a flag to the nsDisplayListBuilder to better control
the creation of these items.
MozReview-Commit-ID: BbeRGDjd2ie
--HG--
extra : rebase_source : ec36114d3c7eefffcf9612fc2da1aaf1353c35d8
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
We pass in `const {Blur,Gradient}CacheKey&` to these functions. There's
no need to copy the cache keys here; we can just Move() the existing
objects in instead. Doing this saves unnecessary allocations and/or
refcounting.
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
We pass in `const {Blur,Gradient}CacheKey&` to these functions. There's
no need to copy the cache keys here; we can just Move() the existing
objects in instead. Doing this saves unnecessary allocations and/or
refcounting.
This case is hit by hovering over menu items, so the optimization is somewhat worthwhile.
As a side-effect, not causing reflows also avoids a XUL <select> popup positioning bug.
MozReview-Commit-ID: AOrijytoHHL
--HG--
extra : rebase_source : c2156eb24171f6d0b0e5476c4a7dbc641a0b5301
This removes non-"gfx.*" prefs defined in gfxPrefs.h, but the generated gfxPrefs
properties are not accessed anywhere in the code base:
* apz.overscroll.spring_friction
* apz.overscroll.stop_velocity_threshold
* apz.overscroll.stretch_factor
* dom.w3c_touch_events.enabled - this pref is accessed in other places, but not through
gfxPrefs::TouchEventsEnabled().
* general.smoothScroll.lines
* general.smoothScroll.pixels
* layers.composer2d.enabled
* layers.stereo-video.enabled
MozReview-Commit-ID: 5OByjpnFthJ
The following prefs are removed because they are defined in gfxPrefs, but the
resulting gfxPrefs property is used at all.
* gfx.SurfaceTexture.detach.enabled
* gfx.touch.resample.*
* gfx.screen-mirroring.enabled
MozReview-Commit-ID: CyI3JN4TTu5
And remove unreachable code after MOZ_CRASH_UNSAFE_OOL().
MOZ_CRASH_UNSAFE_OOL causes data collection because crash strings are annotated to crash-stats and are publicly visible. Firefox data stewards must do data review on usages of this macro. However, all the crash strings this patch collects with MOZ_CRASH_UNSAFE_OOL are already collected with NS_RUNTIMEABORT.
MozReview-Commit-ID: IHmJfuxXSqw
--HG--
extra : rebase_source : 031f30934b58a7b87f960e57179641d44aefe5c5
extra : source : fe9f638a56a53c8721eecc4273dcc074c988546e