Граф коммитов

3149 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 2e0d7c56fd Bug 1776556 - Restore Windows' accent-color / system-color behavior for now. r=mstange
This basically pref-gates some of the accent-color changes that landed before
the soft-freeze to match current release behavior, at least for now.

In the future we might want to reconsider turning these on, but at the very
least we should figure out a good story for the grey-ish accent colors, see the
comments in the pref definitions.

The only tricky bit is the use-theme-accent pref handling. I made it specific
to the non-native-theme again so that AccentColor and NNT kept behaving
consistently, but AccentColor in the browser chrome used the real accent color.

Differential Revision: https://phabricator.services.mozilla.com/D150339
2022-06-28 18:55:27 +00:00
Noemi Erli d6440ec5b2 Backed out changeset 56a33c1c3210 (bug 1734394) for causing build bustages in GeckoBundleUtils.cpp CLOSED TREE 2022-06-24 22:01:02 +03:00
Cathy Lu 617487c8c7 Bug 1734394 - Make Geckoview use the session store collector r=geckoview-reviewers,agi,farre
When the session storage prefs are enabled, GeckoSession updateSessionState will provide the bundle of information, including zoom, scroll, and form data, to the delegate. Currently works for Fission and on Fenix.

Differential Revision: https://phabricator.services.mozilla.com/D148215
2022-06-24 18:34:28 +00:00
Noemi Erli ff26b8a5d0 Backed out 11 changesets (bug 1773770) because shouldn't have been landed during a soft freeze CLOSED TREE
Backed out changeset ede55d570d1e (bug 1773770)
Backed out changeset d5374ef362c2 (bug 1773770)
Backed out changeset 26e47956508b (bug 1773770)
Backed out changeset c78f0c4c8f3f (bug 1773770)
Backed out changeset 9089a97bcb26 (bug 1773770)
Backed out changeset 17894f5b3b41 (bug 1773770)
Backed out changeset 986a64a9e6b4 (bug 1773770)
Backed out changeset 7a63d8676bf0 (bug 1773770)
Backed out changeset 38e7b99ffbed (bug 1773770)
Backed out changeset e9ad07c96ab2 (bug 1773770)
Backed out changeset 2a8f65417b66 (bug 1773770)
2022-06-24 20:03:43 +03:00
Kris Maglione d1688d3ec7 Bug 1773770: Part 9 - Migrate widget component content proxies to static registration. r=mccr8
Several widget contracts use different implementations in the parent and
content processes. Since the static registration system builds its hashtable
at compile time rather than runtime, it doesn't support different contract IDs
per process. It could make the decision at lookup time, but given how rarely
it's needed, I don't think it would be worth the complexity.

This patch updates the widget components that need different implementations
in the parent and content process to register separate contracts for each
implementation, and a third stub contract which forwards to the appropriate
implementation depending on which process it's used in. The implementation
entries restrict their usage to the process they are meant to be used in.

Differential Revision: https://phabricator.services.mozilla.com/D149436
2022-06-24 07:10:18 +00:00
criss 6abc242b8d Backed out 11 changesets (bug 1773770) for causing mochitest failures on test_bug466599.xhtml. CLOSED TREE
Backed out changeset d35762c3242d (bug 1773770)
Backed out changeset 0501c85d3f58 (bug 1773770)
Backed out changeset cdd28e0e3434 (bug 1773770)
Backed out changeset a48829529dd0 (bug 1773770)
Backed out changeset c3fcdd7e88e5 (bug 1773770)
Backed out changeset 8f334c5dc0cd (bug 1773770)
Backed out changeset 337e76b67647 (bug 1773770)
Backed out changeset 71f539b482ba (bug 1773770)
Backed out changeset b996cbbbc2f5 (bug 1773770)
Backed out changeset a6ddc3cdc9ba (bug 1773770)
Backed out changeset c8d7da3cf2ac (bug 1773770)
2022-06-24 08:12:40 +03:00
Kris Maglione b973622a94 Bug 1773770: Part 9 - Migrate widget component content proxies to static registration. r=mccr8
Several widget contracts use different implementations in the parent and
content processes. Since the static registration system builds its hashtable
at compile time rather than runtime, it doesn't support different contract IDs
per process. It could make the decision at lookup time, but given how rarely
it's needed, I don't think it would be worth the complexity.

This patch updates the widget components that need different implementations
in the parent and content process to register separate contracts for each
implementation, and a third stub contract which forwards to the appropriate
implementation depending on which process it's used in. The implementation
entries restrict their usage to the process they are meant to be used in.

Differential Revision: https://phabricator.services.mozilla.com/D149436
2022-06-24 00:47:45 +00:00
Marian-Vasile Laza 7dd26a3f65 Backed out 11 changesets (bug 1773770) for causing bc failures on browser_xpcom_graph_wait.js. CLOSED TREE
Backed out changeset 72ace9ee39ae (bug 1773770)
Backed out changeset e8a3a040b4c4 (bug 1773770)
Backed out changeset 4ff5f4f0f5d1 (bug 1773770)
Backed out changeset f96e9664168d (bug 1773770)
Backed out changeset b6a696897ca8 (bug 1773770)
Backed out changeset 1b8ad6be2dce (bug 1773770)
Backed out changeset 7e3a1a32a88d (bug 1773770)
Backed out changeset 6dbe5fa1ad4f (bug 1773770)
Backed out changeset 86e09dcdadde (bug 1773770)
Backed out changeset 1ee8d852d9d5 (bug 1773770)
Backed out changeset c99e93023059 (bug 1773770)
2022-06-24 03:25:34 +03:00
Kris Maglione fe9734c5db Bug 1773770: Part 9 - Migrate widget component content proxies to static registration. r=mccr8
Several widget contracts use different implementations in the parent and
content processes. Since the static registration system builds its hashtable
at compile time rather than runtime, it doesn't support different contract IDs
per process. It could make the decision at lookup time, but given how rarely
it's needed, I don't think it would be worth the complexity.

This patch updates the widget components that need different implementations
in the parent and content process to register separate contracts for each
implementation, and a third stub contract which forwards to the appropriate
implementation depending on which process it's used in. The implementation
entries restrict their usage to the process they are meant to be used in.

Differential Revision: https://phabricator.services.mozilla.com/D149436
2022-06-23 23:05:36 +00:00
Marian-Vasile Laza 969bcd8dfe Backed out 11 changesets (bug 1773770) for causing bustages on nsComponentManager.obj.
Backed out changeset 3538e99dd668 (bug 1773770)
Backed out changeset 0862b3275742 (bug 1773770)
Backed out changeset 45dbd95d94bb (bug 1773770)
Backed out changeset 1d079a6ae89c (bug 1773770)
Backed out changeset ac4c4a143ff7 (bug 1773770)
Backed out changeset 0e3233868101 (bug 1773770)
Backed out changeset ac727812fd06 (bug 1773770)
Backed out changeset fe46df06e31a (bug 1773770)
Backed out changeset 51b89b344d7f (bug 1773770)
Backed out changeset 62e49ca3f288 (bug 1773770)
Backed out changeset 6df39588ec9a (bug 1773770)
2022-06-24 01:16:58 +03:00
Kris Maglione 38b1250f24 Bug 1773770: Part 9 - Migrate widget component content proxies to static registration. r=mccr8
Several widget contracts use different implementations in the parent and
content processes. Since the static registration system builds its hashtable
at compile time rather than runtime, it doesn't support different contract IDs
per process. It could make the decision at lookup time, but given how rarely
it's needed, I don't think it would be worth the complexity.

This patch updates the widget components that need different implementations
in the parent and content process to register separate contracts for each
implementation, and a third stub contract which forwards to the appropriate
implementation depending on which process it's used in. The implementation
entries restrict their usage to the process they are meant to be used in.

Differential Revision: https://phabricator.services.mozilla.com/D149436
2022-06-23 20:13:10 +00:00
Marian-Vasile Laza 63b59e32d4 Backed out changeset 39559c43173a (bug 1734394) for causing bustages on GeckoBundleUtils.cpp. CLOSED TREE 2022-06-23 20:05:54 +03:00
Cathy Lu 4d149860a7 Bug 1734394 - Make Geckoview use the session store collector r=geckoview-reviewers,agi,farre
When the session storage prefs are enabled, GeckoSession updateSessionState will provide the bundle of information, including zoom, scroll, and form data, to the delegate. Currently works for Fission and on Fenix.

Differential Revision: https://phabricator.services.mozilla.com/D148215
2022-06-23 16:44:32 +00:00
Emilio Cobos Álvarez fe85e4d99d Bug 1775247 - Make AccentColor/Text consistent with accent-color: auto. r=mstange
It'd be weird otherwise, as in platforms where use-theme-accent is false
(Windows), form controls would be blue (the default accent color) but
the AccentColor color would be the system accent color still.

Differential Revision: https://phabricator.services.mozilla.com/D149877
2022-06-22 09:45:07 +00:00
Emilio Cobos Álvarez 4c5f20179e Bug 1775247 - Implement AccentColor/AccentColorText and remove -moz-prefixed version of the color. r=mstange
As per https://github.com/w3c/csswg-drafts/issues/7347.

Mostly renaming, doesn't change behavior other than exposing the new
color keywords (tested in wpt).

Differential Revision: https://phabricator.services.mozilla.com/D149876
2022-06-22 09:45:06 +00:00
Makoto Kato f3dad3e3fe Bug 1596164 - Use PR_Now instead of location service's acquired time. r=geckoview-reviewers,agi
`android.location.Location.getTime()` will return the acquired location time
that depends on location service. But `maximumAge` will be calculated by
current time (`PR_Now()`). So if the acquired time is old time,
`nsGeolocationRequest::SendLocation` won't send the location due to too old
(`isTooOld=true` in `nsGeolocationRequest::SendLocation`).

Like other platforms, we should pass PR_Now as the location time instead.

Also, GVE sometimes hits debug assertion since heading and/or speed aren't
expected value, so this patch fixes this situation.

Differential Revision: https://phabricator.services.mozilla.com/D148452
2022-06-14 04:20:42 +00:00
Emilio Cobos Álvarez 9fc2aa47fc Bug 1773558 - Move fixed-point font types to Rust. r=layout-reviewers,jfkthame
Now that cbindgen and rust support const generics, it seems more simple.

This centralizes all the relevant font constants etc in rust and avoids
conversions when going from rust to C++ and vice versa.

Differential Revision: https://phabricator.services.mozilla.com/D148847
2022-06-13 00:59:23 +00:00
Noemi Erli 841e350bc4 Backed out changeset 7585591a9bad (bug 1773558) for causing failures in system-fonts.html 2022-06-12 19:02:33 +03:00
Emilio Cobos Álvarez e441089ca0 Bug 1773558 - Move fixed-point font types to Rust. r=layout-reviewers,jfkthame
Now that cbindgen and rust support const generics, it seems more simple.

This centralizes all the relevant font constants etc in rust and avoids
conversions when going from rust to C++ and vice versa.

Differential Revision: https://phabricator.services.mozilla.com/D148847
2022-06-12 10:48:58 +00:00
criss c6b2c5db61 Backed out 9 changesets (bug 1772006) causing build bustages on nsTString.cpp. CLOSED TREE
Backed out changeset f17c7565707b (bug 1772006)
Backed out changeset c725fe1f5882 (bug 1772006)
Backed out changeset d19663161261 (bug 1772006)
Backed out changeset b6611ab002d9 (bug 1772006)
Backed out changeset 790f42b64af9 (bug 1772006)
Backed out changeset 79a734b4e4d9 (bug 1772006)
Backed out changeset 42730aae16ea (bug 1772006)
Backed out changeset b2542aef3054 (bug 1772006)
Backed out changeset 962bfea4a309 (bug 1772006)
2022-06-11 01:13:42 +03:00
Nika Layzell b3c13bf114 Bug 1772006 - Part 6: Simplify and move the string searching APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,eeejay,dragana,barret
The biggest set of APIs from ns[T]StringObsolete which are still heavily used
are the string searching APIs. It appears the intention was for these to be
replaced by the `FindInReadable` APIs, however that doesn't appear to have
happened.

In addition, the APIs have some quirks around their handling of mixed character
widths. These APIs generally supported both narrow strings and the native
string type, probably because char16_t string literals weren't available until
c++11. Finally they also used easy-to-confuse unlabeled boolean and integer
optional arguments to control behaviour.

These patches do the following major changes to the searching APIs:

1. The ASCII case-insensitive search method was split out as
   LowerCaseFindASCII, rather than using a boolean. This should be less
   error-prone and more explicit, and allows the method to continue to use
   narrow string literals for all string types (as only ASCII is supported).
2. The other [R]Find methods were restricted to only support arguments with
   matching character types. I considered adding a FindASCII method which would
   use narrow string literals for both wide and narrow strings but it would've
   been the same amount of work as changing all of the literals to unicode
   literals.
   This ends up being the bulk of the changes in the patch.
3. All find methods were re-implemented using std::basic_string_view's find
   algorithm or stl algorithms to reduce code complexity, and avoid the need to
   carry around the logic from nsStringObsolete.cpp.
4. The implementations were moved to nsTStringRepr.cpp.
5. An overload of Find was added to try to catch callers which previously
   called `Find(..., false)` or `Find(..., true)` to set case-sensitivity, due
   to booleans normally implicitly coercing to `index_type`. This should
   probably be removed at some point, but may be useful during the transition.

Differential Revision: https://phabricator.services.mozilla.com/D148300
2022-06-10 21:12:08 +00:00
Jamie Nicol 30384c7460 Bug 1773128 - Block webrender on several PowerVR GPUs due to crash. r=gfx-reviewers,nical
There is a crash in glFenceSync (used to recycle PBOs when uploading
textures) affecting several PowerVR GPUs. Block webrender on the known
bad combinations of GPU and driver versions.

Differential Revision: https://phabricator.services.mozilla.com/D148638
2022-06-08 13:57:51 +00:00
Emilio Cobos Álvarez 9349aeea85 Bug 1771796 - Remove -moz-scrollbar-thumb-proportional. r=dholbert
It unconditionally matches on all platforms, so it's not returning any useful information.

Depends on D147689

Differential Revision: https://phabricator.services.mozilla.com/D147690
2022-06-02 11:58:18 +00:00
Jamie Nicol 2cf59fe695 Bug 1767128 - Rework and re-enable SurfaceControl rendering path on Android. r=agi,gfx-reviewers,aosmond
In bug 1762424 we introduced a rendering path on Android using the
SurfaceControl API, in order to work around a bug preventing recovery
from a GPU process crash. However, the initial implementation caused
this bug: repeatedly sending the same SurfaceControl objects over AIDL
to the GPU process resulted in them being leaked, eventually causing
severe display issues. Not only were we duplicating the SurfaceControl
for each widget, but each time a widget was resized too.

This patch reworks our usage of the SurfaceControl API to avoid ever
having to send them cross-process. Instead, we create a single child
SurfaceControl object for each SurfaceControl that is attached to a
widget. (Typically there will be a single one shared between all
widgets, changing only when the app is paused and resumed, which is
much fewer than one per widget per resize.)

In the parent process we obtain the Surfaces that will be rendered in
to from the child SurfaceControls, and only send those Surfaces to the
GPU process. Thankfully unlike SurfaceControls, sending Surfaces
cross-process does not cause leaks. When the GPU process dies we
simply destroy all of the child SurfaceControls, and recreate them
again on-demand.

Differential Revision: https://phabricator.services.mozilla.com/D147437
2022-05-31 18:41:07 +00:00
Olivia Hall f950793fec Bug 1659819 - GeckoView Save to PDF API r=nika,agi,geckoview-reviewers,jonalmeida,emilio
Adds a GeckoView save to PDF API that can be used to save the current session’s page content to a PDF. The API returns a Java InputStream that can be used by the consumer to process the PDF.

Differential Revision: https://phabricator.services.mozilla.com/D146245
2022-05-31 17:34:56 +00:00
Dmitrij Feller ba3866a5fc Bug 370035 - Remove the aWidget parameter from nsIDeviceContextSpec::Init.r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D145841
2022-05-23 19:34:40 +00:00
Jonathan Watt 906a3c1ae6 Bug 1770211 p2 - Move mPrintSettings up from nsIDeviceContextSpec's subclasses. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D146858
2022-05-20 17:33:21 +00:00
Andrew McCreight fa8bfd1245 Bug 1514936, part 2 - Drop the outer arguments from static components. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D146457
2022-05-17 20:24:19 +00:00
Jonathan Watt 247babb515 Bug 1432651 p2 - Remove nsIPrintSession and all the code that uses it. r=emilio,geckoview-reviewers,m_kato
Lately nsIPrintSession was only used to pass around RemotePrintJobChild objects.
Now that we pass those objects explicitly where needed (part 1), this class
serves no purpose.

Another reason to want to get rid of this class is that having it as a member
of nsIPrintSettings made no sense and was confusing.

Differential Revision: https://phabricator.services.mozilla.com/D146381
2022-05-16 08:38:02 +00:00
Makoto Kato aab3cc4f12 Bug 1767556 - Don't remove composing state when composition is started from first character. r=geckoview-reviewers,agi
This occurs since newer GBoard's behaviour seems to be changed.

When `GeckoEditable` receives text change from Gecko, it is possible to remove
composing state if composition is started from first character.

If Gecko's text change by IME, we shouldn't reset text state in `onTextChange`.
`mCausedOnlyByComposition` means that this change is by IME.

Differential Revision: https://phabricator.services.mozilla.com/D146159
2022-05-15 07:27:48 +00:00
Jamie Nicol c54bfe3ed5 Bug 1768925 - Disable SurfaceControl compositing path on Android. r=agi
In bug 1762424 we introduced a compositing path using SurfaceControl
to work around an issue on Android 12 where the app would freeze when
attempting to recover from a GPU process crash. However, this caused
bug 1767128. Until we have a proper solution to that, we should
disable the SurfaceControl functionality.

This means on Android 12 the browser will be once again be unable to
recover from a GPU process crash. However, as part of bug 1762424 we
made it so the parent process crashes in this situation rather than
freezing, meaning Android 12 users will be no worse off than having
the GPU process disabled.

Differential Revision: https://phabricator.services.mozilla.com/D146114
2022-05-11 20:12:50 +00:00
Emilio Cobos Álvarez 31d3fcdb9b Bug 1767172 - Remove custom screen info handling from GfxInfo, use ScreenManager for that. r=jrmuizel,handyman,stransky
This removes a bunch of custom code from GfxInfo to obtain screen
information, and instead collects that screen information in
ScreenManager.

This, apart of removing duplicated code, has the extra benefit of
reporting multi-monitor information on GTK (and potentially in the
future reporting scale and refresh rate properly as well, I've kept the
telemetry as it was on that regard).

Differential Revision: https://phabricator.services.mozilla.com/D145178
2022-05-06 23:37:25 +00:00
Cosmin Sabou 4ddcb34203 Backed out changeset b2bea8e0b400 (bug 1767172) for causing startup crashes (Bug 1768260). a=backout 2022-05-07 01:28:53 +03:00
Emilio Cobos Álvarez 9d430bf4ed Bug 1767172 - Remove custom screen info handling from GfxInfo, use ScreenManager for that. r=jrmuizel,handyman,stransky
This removes a bunch of custom code from GfxInfo to obtain screen
information, and instead collects that screen information in
ScreenManager.

This, apart of removing duplicated code, has the extra benefit of
reporting multi-monitor information on GTK (and potentially in the
future reporting scale and refresh rate properly as well, I've kept the
telemetry as it was on that regard).

Differential Revision: https://phabricator.services.mozilla.com/D145178
2022-05-05 15:07:03 +00:00
Markus Stange 06766c211b Bug 1765399 - Rename Get/CreateHardwareVsync to GetGlobalVsync, CreateGlobalHardwareVsync and CreateSoftwareVsync. r=smaug
This draws a clearer line between hardware vsync and software vsync.

Differential Revision: https://phabricator.services.mozilla.com/D144373
2022-05-05 02:15:17 +00:00
Marian-Vasile Laza 1cd0ac703f Backed out 16 changesets (bug 1765399) for causing build bustages on RefPtr.h.
Backed out changeset 8ff5e213e351 (bug 1765399)
Backed out changeset bd164f5cc8b3 (bug 1765399)
Backed out changeset 939b577eee05 (bug 1765399)
Backed out changeset ee00e3583f42 (bug 1765399)
Backed out changeset e5001537e536 (bug 1765399)
Backed out changeset d5a4004a2955 (bug 1765399)
Backed out changeset d3c1f6c420e3 (bug 1765399)
Backed out changeset d21fca656853 (bug 1765399)
Backed out changeset 5e5a29a99c9e (bug 1765399)
Backed out changeset ce326de1e107 (bug 1765399)
Backed out changeset 3890e83660b0 (bug 1765399)
Backed out changeset 2f3ceca7aefe (bug 1765399)
Backed out changeset 40c47c498858 (bug 1765399)
Backed out changeset 3a3a2aa6de9b (bug 1765399)
Backed out changeset 4a30a4b3d30d (bug 1765399)
Backed out changeset a9115d9d648e (bug 1765399)
2022-05-05 00:30:06 +03:00
Markus Stange abdaca76a5 Bug 1765399 - Rename Get/CreateHardwareVsync to GetGlobalVsync, CreateGlobalHardwareVsync and CreateSoftwareVsync. r=smaug
This draws a clearer line between hardware vsync and software vsync.

Differential Revision: https://phabricator.services.mozilla.com/D144373
2022-05-04 16:13:38 +00:00
Chris Martin 80881746de Bug 1763023 - Push nsBaseWidget::mSizeMode into child classes r=handyman
This member is no longer used on Windows, and having it in the
base class doesn't provide a real abstraction anyway since
the child classes will break if anything about it is changed.

Differential Revision: https://phabricator.services.mozilla.com/D145132
2022-05-02 14:06:17 +00:00
Jamie Nicol 0691a2b63f Bug 1766127 - Allow AndroidCompositorWidget::mClientSize to be updated from main thread. r=agi,gfx-reviewers,lsalzman
On Android we have long since calculated the compositor widget size
from the Surface rather than using the main thread widget size. This
is to avoid a trip via the main thread in response to a
ResumeAndResize event on the UI thread.
AndroidCompositorWidget::mClientSize therefore gets calculated when
the compositor is resumed.

However, it is possible in some circumstances for the compositor to
receive a display list prior to it being resumed. In this bug's case,
SyncResumeAndResize is getting called before the UI thread has been
notified that the compositor has been initialized. It therefore cannot
resume the compositor, and we instead resume the compositor on the
subsequent NotifyCompositorCreated call. This starts a race between
the main thread paint and NotifyCompositorCreated being scheduled on
the UI thread then resuming the compositor via
PUiCompositorController. If we receive
WebRenderBridgeParent::RecvSetDisplayList prior to
UiCompositorControllerParent::RecvResumeAndResize, then
AndroidCompositorWidget::mClientSize will be zero. This results in us
setting zero-sized webrender scene rect, leading to webrender exiting
early during rendering, resulting in a black screen.

To fix this, allow the main thread to set the AndroidCompositorWidget
size, in addition to the UI thread being able to set it. We do so by
adding a NotifyClientSizeChanged method to
PlatformCompositorWidgetDelegate, called from
nsWindow::OnSizeChanged. The cross-process implementation of this uses
an IPDL call on PCompositorWidget, which shares a top-level protocol
with PWebRenderBridge, meaning calls are guaranteed to occur in
order. This means a resize event on the main thread is guaranteed to
set the CompositorWidget size before the display list from the
subsequent paint is received.

Differential Revision: https://phabricator.services.mozilla.com/D144594
2022-04-25 18:20:55 +00:00
Jamie Nicol dee7767b62 Bug 1762424 - Unblock GPU process on Android 12. r=gfx-reviewers,nical
With the previous patches in this series we can properly recover from
a GPU process restart, so unblock it.

Differential Revision: https://phabricator.services.mozilla.com/D143487
2022-04-18 18:11:08 +00:00
Jamie Nicol 9849a83f64 Bug 1762424 - Provide SurfaceControl to compositor and render in to child Surface. r=agi,gfx-reviewers,geckoview-reviewers,jrmuizel,owlish
This adds new version of the GeckoView API
GeckoDisplay.surfaceChanged(), which takes a single argument of a new
type GeckoDisplay.SurfaceInfo. As well as containing fields for each
the the existing surfaceChanged() arguments, this has an additional
SurfaceControl field. This must be provided when rendering in to a
SurfaceView on SDK level 29 or greater. On earlier SDK levels, or when
rendering in to a TextureView or SurfaceTexture, this can be
null. SurfaceViewWrapper and GeckoView classes are updated to handle
this correctly. The old surfaceChanged() methods have been deprecated,
and tests have been updated to use the new version.

When provided, the SurfaceControl is passed along with the Surface
through to the widget and, when enabled, over to the GPU process. The
compositor widget then creates a child Surface from that
SurfaceControl, and renders in to that child Surface rather than the
parent one.

This works around a bug on Android 12 where following the GPU process
dying the Surface was left in an unusable state, meaning subsequent
attempts to initialize a compositor would fail. Because the Surface is
now created by the GPU process it gets destroyed when the process
dies, therefore a new Surface can successfully be created when we
reinitialize the compositor.

Differential Revision: https://phabricator.services.mozilla.com/D143485
2022-04-18 18:11:07 +00:00
Jamie Nicol 366dbce5af Bug 1762424 - Generate SDK bindings for android.view.SurfaceControl. r=agi
And android.view.SurfaceControl$Transaction.

In order to generate these bindings we must increase the maximum SDK
version argument we pass to SDKProcessor to 29. However, doing so
means that we now attempt to generate bindings for both Surface's
Surface(SurfaceTexture) and Surface(SurfaceControl)
constructors. These both translate in to C++ functions with identical
signatures - Surface::New(jni::Object::Param) - causing a compilation
failure.

This patch therefore also allows the stubName property to override
constructor names, and overrides the latter to
Surface::FromSurfaceControl(), thereby avoiding the conflict.

Differential Revision: https://phabricator.services.mozilla.com/D143484
2022-04-18 18:11:07 +00:00
Jamie Nicol cee8f98714 Bug 1763392 - Generate SDK bindings for nested Java classes as nested C++ classes. r=agi,media-playback-reviewers,bryce
For example, the SDK class android.media.MediaDrm$KeyStatus will now
be defined as MediaDrm::KeyStatus rather than just KeyStatus.

Not only does this avoid polluting the top-level namespace, but it
also avoids a bug where invalid type names were generated if the
nested class contains a method with a parameter or return of the outer
class' type.

Differential Revision: https://phabricator.services.mozilla.com/D143043
2022-04-07 11:12:20 +00:00
Emilio Cobos Álvarez 7e23a4287f Bug 1760836 - Support printing to an nsIOutputStream. r=jfkthame,jrmuizel,webdriver-reviewers,geckoview-reviewers,agi
The trickiest bits are the PrintTargetCG ones, the rest is just plumbing
and cleanups and tests, but let me know if you want those to be split
out, can do.

The GTK change to nsPrintSettingsGTK::GetResolution is a no-op (we only
read resolution on windows), but I did that because we assume that it
doesn't fail and GTK returns a sane default anyways.

Differential Revision: https://phabricator.services.mozilla.com/D142199
2022-03-30 18:51:58 +00:00
Jamie Nicol dbde42a288 Bug 1762025 - Block GPU process on Android versions 12 and above. r=gfx-reviewers,aosmond
On Android version 12, it appears as if the EGL context does not
correctly get detached from a Surface when its process dies. This
means that subsequent attempts to create an EGL context fail, meaning
we cannot render anything.

This results in a completely unusable browser following a GPU process
crash, which is worse than the alternative of a parent process crash.

Block the GPU process on Android 12 and above until we have found a
workaround.

Differential Revision: https://phabricator.services.mozilla.com/D142452
2022-03-30 13:37:19 +00:00
Iulian Moraru 7a3ed2ce2a Backed out changeset d42d7505c9cf (bug 1760836) for causing mochitest failures on browser_print_stream.js. CLOSED TREE 2022-03-29 23:32:39 +03:00
Emilio Cobos Álvarez b0fb172236 Bug 1760836 - Support printing to an nsIOutputStream. r=jfkthame,jrmuizel,webdriver-reviewers,geckoview-reviewers,agi
The trickiest bits are the PrintTargetCG ones, the rest is just plumbing
and cleanups and tests, but let me know if you want those to be split
out, can do.

The GTK change to nsPrintSettingsGTK::GetResolution is a no-op (we only
read resolution on windows), but I did that because we assume that it
doesn't fail and GTK returns a sane default anyways.

Differential Revision: https://phabricator.services.mozilla.com/D142199
2022-03-29 17:50:58 +00:00
Makoto Kato 9f9179d4e9 Bug 1761176 - Set insertion marker location for IME. r=geckoview-reviewers,agi
When using Android with physical keyboard, IME's candidate window is sometimes
misplaced. Some IME/keyboards require insertion marker location to set IME's
candidate window position.

So we should set it from caret rectangle.

Differential Revision: https://phabricator.services.mozilla.com/D141931
2022-03-28 05:29:21 +00:00
Jamie Nicol d7be12a509 Bug 1760794 - Ensure default clear color gets set after compositor is (re)initialized. r=agi
In bug 1756700 we delayed initializing the compositor on android. A
consequence of this is that when
LayerViewSupport::SetDefaultClearColor() gets called
mUiCompositorControllerChild is still null, meaning we skip setting
the compositor's clear color. As a result, dark-mode fenix users have
once again started seeing white flashes while waiting for the page to
load.

Additionally, when the compositor is re-initialized (following a
fallback to software rendering, or a GPU process restart) we do not
set the clear color for the new compositor, which again can lead to
white flashes.

To fix both of these issues, this patch makes us cache the color value
passed to LayerViewSupport::SetDefaultClearColor(). Then whenever
LayerViewSupport::NotifyCompositorCreated() is called, we call
UiCompositorControllerChild::SetDefaultClearColor() to ensure the new
compositor uses the correct clear color.

Differential Revision: https://phabricator.services.mozilla.com/D141730
2022-03-22 21:05:30 +00:00
Iulian Moraru 6c42eedf49 Backed out changeset e560c3644632 (bug 1760794) for causing geckoview crashes. 2022-03-22 19:37:16 +02:00