Commit Graph

2600 Commits

Author SHA1 Message Date
Brindusan Cristian
02ad28a12b Backed out changeset a8975a4aebc0 (bug 1521893) for bc leasks on (nsIconLoaderObserver, nsIconLoaderService, nsTouchBarInputIcon). CLOSED TREE 2019-09-06 22:03:15 +03:00
harry
0be00626e6 Bug 1521893 - Part 2 - Support loading SVG icons on the Touch Bar through a new nsTouchBarInputIcon service class r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D34926

--HG--
extra : moz-landing-system : lando
2019-09-06 17:23:37 +00:00
harry
8595d331fd Bug 1573157 - Load notification center icons with dual representations. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D43275

--HG--
extra : moz-landing-system : lando
2019-09-04 18:33:13 +00:00
Timothy Nikkel
e0a79ba9f2 Bug 1578164. Use async notifications when requesting decode of an image in most places. r=aosmond
Most of things will likely be no real change because they ask for the exact frame they want immediately before.

Differential Revision: https://phabricator.services.mozilla.com/D44359

--HG--
extra : moz-landing-system : lando
2019-09-03 15:36:23 +00:00
Markus Stange
df4663239c Bug 1578099 - Make CFTypeRefPtr usable as a key inside an unordered_map. r=mattwoodrow
Depends on D44323

Differential Revision: https://phabricator.services.mozilla.com/D44324

--HG--
extra : moz-landing-system : lando
2019-09-01 21:38:42 +00:00
Dorel Luca
9690cb07dc Backed out changeset 3ab29c05ea2f (bug 1521893) build bustage in /builds/worker/workspace/build/src/widget/cocoa/nsTouchBarInputIcon.h. CLOSED TREE 2019-08-29 06:18:29 +03:00
harry
ff064cc7f3 Bug 1521893 - Part 2 - Support loading SVG icons on the Touch Bar through a new nsTouchBarInputIcon service class r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D34926

--HG--
extra : moz-landing-system : lando
2019-08-29 02:38:16 +00:00
Kristen Wright
cff2295408 Bug 1573992 - Convert ui.context_menus.after_mouseup to static pref. r=njn
Converts ui.context_menus.after_mouseup varcache pref to a static pref and removes its associated function.

Differential Revision: https://phabricator.services.mozilla.com/D43519

--HG--
extra : moz-landing-system : lando
2019-08-27 00:07:49 +00:00
Emilio Cobos Álvarez
9ac9ac89fe Bug 1576666 - Try to fix Mac bustage on a CLOSED TREE.
MANUAL PUSH: tree is red.
2019-08-27 01:38:47 +02:00
Markus Stange
337e804b70 Bug 1576391 - Override _titlebarHeight so that the window's NSTitlebarContainerView includes the full height of the window buttons even after we've shifted them down, and re-enable the floating titlebar. r=mattwoodrow
I've tried hard to find a solution for the clipped window button problem which
does not involve swizzling but could not find one.
The officially ratified ways of moving the window buttons are:
 1. Use an NSToolbar in your window, or
 2. Make a custom window with your own buttons.

I don't think having an NSToolbar is an option for us. And making our own window frame
implementation would be hard to get right and can easily behave differently from the
native implementation.
I've also tried asking the window to not render any window buttons on its own; then we
could make our own buttons and place them on top of our view. But if I change the
window's styleMask to be just NSTitledWindowMask, it doesn't only make the buttons
disappear, it also makes the window non-resizable. And if I include NSResizableWindowMask,
the buttons come back (only the zoom button is enabled, the other two are grayed out).

This change also stops overriding _wantsFloatingTitlebar when CoreAnimation is
enabled, which is necessary for the window buttons to render.

Depends on D43341

Differential Revision: https://phabricator.services.mozilla.com/D43361

--HG--
extra : moz-landing-system : lando
2019-08-26 02:05:24 +00:00
Markus Stange
47f90a7414 Bug 1576391 - Use NSFullSizeContentViewWindowMask for ToolbarWindows. r=mattwoodrow
This gives us two behaviors for free which we were achieving through manual
overrides:
 - The content view is sized to cover the entire window frame.
 - The window controls are placed on top of the content view (instead of
   underneath it in z-order).

It also forces CoreAnimation layers for the window's entire NSView hierarchy, so
we only use it when the CoreAnimation pref is enabled.

NSFullSizeContentViewWindowMask is only available on 10.10 and up, but we still
support 10.9, so we cannot remove the code with the manual overrides just yet.

This change also requires a change to NonDraggableView in order to preserve
window dragging behavior in the titlebar: When NSFullSizeContentViewWindowMask
is used, the method which assembles the window's draggable region takes a
different path. It treats the titlebar specially, and traverses the NSView
hierarchy twice, once for the titlebar area and once for the rest of the window.
Outside the titlebar, it calls _opaqueRect on every visible NSView, but for the
titlebar area, it calls _opaqueRectForWindowMoveWhenInTitlebar instead.

Overriding _opaqueRectForWindowMoveWhenInTitlebar allows us to achieve the old
dragging behavior.

Differential Revision: https://phabricator.services.mozilla.com/D43341

--HG--
extra : moz-landing-system : lando
2019-08-26 02:03:56 +00:00
Markus Stange
5aaf080881 Bug 1576391 - Move some method overrides to ToolbarWindow. r=mattwoodrow
This makes them only apply in windows with titlebars, which is the only place
where they're needed. The setContentView override can even cause harm for other
windows, such as sheet windows, because it'll move the content view below a
full-window covering solid grey view provided by the system, in builds that
link against the 10.14 SDK and don't override _wantsFloatingTitlebar.

Differential Revision: https://phabricator.services.mozilla.com/D43340

--HG--
extra : moz-landing-system : lando
2019-08-26 02:04:09 +00:00
Markus Stange
e0e54098e9 Bug 1574592 - Move NativeLayer management out of nsChildView and into LayerManagerComposite and RendererOGL. r=mattwoodrow
It looks like a big patch but it's mostly just moved code, with some duplication:
 - Layer creation and destruction moves to LayerManagerComposite and RendererOGL.
 - BasicCompositor IOSurface setup code moves to BasicCompositor.cpp.
 - OpenGL IOSurface setup code moves to CompositorOGL and RenderCompositorOGL.

The duplication is a bit unfortunate but the LayerManagerComposite code will
diverge from the WebRender code soon.

BeginFrame gets a new argument aNativeLayer. This argument will go away again
over the course of this patch queue. But for now, BeginFrame is the best place
to do the layer setup because it's a very close place to PreRender which is
where that code was previously.

I wasn't able to think of a nice way to give CompositorOGL and BasicCompositor
platform-specific behavior without #ifdefs. So now LayerManagerComposite uses
the "cross-platform" NativeLayer interface, but CompositorOGL and
BasicCompositor use NativeLayerCA because they actually need the IOSurface, and
they do that in #ifdef'd code.
Luckily, NativeLayerCA.h can be included in both .cpp files and in .mm files.

Differential Revision: https://phabricator.services.mozilla.com/D42402

--HG--
extra : moz-landing-system : lando
2019-08-25 17:43:42 +00:00
Markus Stange
c3d94ae29a Bug 1574592 - Add CompositorWidget::GetOpaqueWidgetRegion. r=mattwoodrow
This lets LayerManagerComposite and RendererOGL set the correct opaque region
on the native layer.

Differential Revision: https://phabricator.services.mozilla.com/D42401

--HG--
extra : moz-landing-system : lando
2019-08-25 21:41:58 +00:00
Markus Stange
222be5a822 Bug 1574592 - Add CompositorWidget::GetNativeLayerRoot. r=mattwoodrow
This will give the layer manager direct access to the native layers.

Differential Revision: https://phabricator.services.mozilla.com/D42400

--HG--
extra : moz-landing-system : lando
2019-08-25 17:10:52 +00:00
Markus Stange
2acd3fcf86 Bug 1576113 - Add a comment.
MANUAL PUSH: Backout and comment change that don't require a review and are somewhat time-critical: the backout fixes breakage in some local build scenarios.

--HG--
extra : rebase_source : 5230000ce88395794c272f0133e09979c70d526d
extra : amend_source : df014e518d27480c5b149acb8acaa0433565d483
2019-08-24 13:45:07 -04:00
Markus Stange
cb2f3a3c58 Bug 1576113 - Back out revision 2a82b5ce10e2 because it causes trouble when building with the 10.14 SDK.
The source of the trouble is our setContents override, which makes sure the window's
content view is the bottommost view in the window, and its interaction with a change
in behavior on 10.14, where windows that return YES from _wantsFloatingTitlebar will
contain an additional NSView for the window background. Our setContents override
moves the content view behind that window background view, which covers it with a
solid gray color.

--HG--
extra : amend_source : cd11d5c805de7054c3dfa3a1d5ae0f504f07116d
2019-08-24 13:50:57 -04:00
Markus Stange
4e76f83888 Bug 1575419 - Don't allow triggering another main thread paint from within a main thread paint. r=mattwoodrow
This also moves the MaybeScheduleUnsuspendAsyncCATransactions() call to the end
of HandleMainThreadCATransaction() so that we can't get re-suspended from within
WillPaintWindow().

Differential Revision: https://phabricator.services.mozilla.com/D42763

--HG--
extra : moz-landing-system : lando
2019-08-21 02:30:32 +00:00
Markus Stange
a18d35ca15 Bug 1491448 - Set the appropriate opaque region on the native layer. r=mattwoodrow
This can be verified by starting Firefox with the environment variables
CA_LAYER_SURFACE=0 CA_COLOR_OPAQUE=1
Transparent parts of the window will be red, and opaque parts will be green.

With this patch, the main browser window will be opaque except for the vibrant
areas, i.e. the tab bar and any open sidebars, which will be transparent.
Full screen video will be opaque.

Differential Revision: https://phabricator.services.mozilla.com/D40555

--HG--
extra : moz-landing-system : lando
2019-08-19 22:55:09 +00:00
Markus Stange
e65a6a7df9 Bug 1491448 - Maintain an internal opaque region in nsChildView that can be accessed from any thread. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D40554

--HG--
extra : moz-landing-system : lando
2019-08-19 22:55:47 +00:00
Sebastian Hengst
0195ac9406 Merge mozilla-central to autoland 2019-08-16 19:05:43 +02:00
Markus Stange
87683af326 Bug 1574521 - Make sure updateLayer is only called when the CoreAnimation pref is set. r=jrmuizel a=Aryx
updateLayer expects some objects to be non-null which are only initialized when the pref is set.
But in builds that were compiled with the 10.14 SDK, all NSViews are layer-backed by default, so
wantspdateLayer gets called, and returning YES from that unconditionally will cause updateLayer
to be called.

Differential Revision: https://phabricator.services.mozilla.com/D42333

--HG--
extra : amend_source : a7a1f7ecba9418e3bf5464bca90ba655002bc637
2019-08-16 18:53:44 +02:00
Markus Stange
92ccc6d8f0 Bug 1154013 - When the vibrant region of a window changes, composite synchronously so that the window contents and the vibrancy update atomically. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D40556

--HG--
extra : moz-landing-system : lando
2019-08-16 14:01:13 +00:00
Markus Stange
5af2fd32c9 Bug 1491442 - Call SuspendAsyncCATransactions on window focus changes. r=mattwoodrow
Without this, in windows with title bars, such as the bookmark library window,
the title bar and the content would update at different times.

The title bar paint is done as part of a main thread CoreAnimation transaction.
However, by default, we don't get notified of all main thread CA transactions;
our only notification mechanism is the updateLayer handler on the PixelHostingView,
and that handler is only invoked (the layer is only displayed) if the layer has
been marked as needing display. And by default, window focus changes do not mark
random views' backing layers as needing display. Usually, what this means is that
the window will be painted twice: Once in the main thread transaction, and then
another time on the compositor thread once Gecko has noticed a state change and
triggered its own composite in response. (Often, Gecko's compositor-side paint
will actually happen *before* the main thread paint, because the main thread is
often busy with repainting the system menu bar during window focus changes.)
Such non-atomic window repaints look glitchy.
Calling SuspendAsyncCATransactions will result in a call to updateLayer in the
upcoming CoreAnimation transaction and lets us update the entire window in one
atomic paint, and it will avoid updating the window early if the compositor
thread gets ahead of the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D38759

--HG--
extra : moz-landing-system : lando
2019-08-16 01:15:34 +00:00
Markus Stange
01138923a6 Bug 1491442 - Disable window overlay drawing in the CoreAnimation path. r=mattwoodrow
Window overlay drawing was added as a workaround for the following:
When our NSOpenGLContext covered the entire window, it would cover the titlebar
contents and hide the window buttons and the title string. It would also not
get anti-aliased rounded corner clipping.

In windows that use CoreAnimation layers for the window frame, this is no longer
a problem, because the CoreAnimation layer tree takes care of these effects:
It applies rounded corner clipping to the window content layers, it puts the
window buttons on top, and it also puts the title string on top if it is shown.

So when we're using CoreAnimation, the existing code needs to be deactivated,
otherwise we'd draw those things twice.

Differential Revision: https://phabricator.services.mozilla.com/D38760

--HG--
extra : moz-landing-system : lando
2019-08-16 01:15:10 +00:00
Markus Stange
20f0865033 Bug 1491442 - Make sure to never trigger async CA transactions when the main thread might be resizing a window. r=mattwoodrow
This avoids most window resizing glitches.

Differential Revision: https://phabricator.services.mozilla.com/D40518

--HG--
extra : moz-landing-system : lando
2019-08-16 01:14:47 +00:00
Markus Stange
8b77e79501 Bug 1491442 - Support BasicCompositor OMTC rendering in the CoreAnimation path. r=mattwoodrow
Now CoreAnimation supports all rendering paths.
The BasicCompositor OMTC path is used when hardware acceleration is disabled,
for example in safe mode or when the user manually disabled it.

Differential Revision: https://phabricator.services.mozilla.com/D38758

--HG--
extra : moz-landing-system : lando
2019-08-16 01:14:22 +00:00
Markus Stange
4172e5ea96 Bug 1491442 - Render accelerated windows into mContentLayer, using OMTC. r=mattwoodrow
This makes windows that render using CompositorOGL or WebRender show content.

Differential Revision: https://phabricator.services.mozilla.com/D40517

--HG--
extra : moz-landing-system : lando
2019-08-16 01:13:52 +00:00
Markus Stange
2921208661 Bug 1491442 - Make nsChildView create a NativeLayerRootCA and fill it with content when painting using BasicLayers (which used to go through drawRect). r=mattwoodrow
This makes context menus work. Regular windows are still blank at this point.

This introduces a visual regression on 10.9: context menus and panels now no
longer have a shadow. Only 10.10 and above support shadows on transparent windows
that use CoreAnimation; 10.9 is not able to obtain the shadow shape on those
types of windows.
I think this is an acceptable regression to take. We want to use CoreAnimation
for all window types because it simplifies the code (no need to handle two
paths) and because it avoids expensive mode switches if we realize too late
that a window we just opened is supposed to use CoreAnimation.

Differential Revision: https://phabricator.services.mozilla.com/D40516

--HG--
extra : moz-landing-system : lando
2019-08-16 01:13:35 +00:00
Markus Stange
85cbfc2652 Bug 1491442 - When gfx.core-animation.enabled is true, use CoreAnimation for all windows and create an empty layer. r=mattwoodrow
This makes mPixelHostingView layer-backed, and that layer will be empty.
This patch also causes all windows (including context menus, tooltips, arrow
panels etc.) to use CoreAnimation layers for the window frame. This is achieved
by calling setWantsLayer:YES on every window's content view.

After this changeset, all windows will still be empty.

Differential Revision: https://phabricator.services.mozilla.com/D38755

--HG--
extra : moz-landing-system : lando
2019-08-16 01:13:19 +00:00
Markus Stange
ca605e7b30 Bug 1491442 - Disable all non-CoreAnimation rendering paths when gfx.core-animation.enabled is set. r=mattwoodrow
This patch leaves you with empty windows everywhere. We will build the new
rendering paths from the ground up in the upcoming patches.

Differential Revision: https://phabricator.services.mozilla.com/D38754

--HG--
extra : moz-landing-system : lando
2019-08-16 01:12:18 +00:00
Markus Stange
31bde5f08e Bug 1491442 - If CoreAnimation is enabled, don't clip the TitlebarGradientView to rounded corners, and don't draw the title string on top of it. r=mattwoodrow
Unlike what the old comment in its drawRect method says, this isn't actually
dependent on the NSFullSizeContentViewWindowMask. Any window that uses
CoreAnimation layers for its window frame will apply these effects automatically.

Differential Revision: https://phabricator.services.mozilla.com/D38753

--HG--
extra : moz-landing-system : lando
2019-08-16 01:11:51 +00:00
Markus Stange
5b5486dc0c Bug 1491442 - Remove -[ChildView isUsingOpenGL] and use mUsingOMTCompositor instead. r=mattwoodrow
We always use OMTC when using OpenGL. We also currently always use OpenGL when using OMTC, but that's about to change.

Differential Revision: https://phabricator.services.mozilla.com/D38752

--HG--
extra : moz-landing-system : lando
2019-08-16 01:11:27 +00:00
Markus Stange
2e790720bb Bug 1491442 - Add some documentation to mPixelHostingView. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D38750

--HG--
extra : moz-landing-system : lando
2019-08-16 01:11:03 +00:00
Markus Stange
1800bceb3c Bug 1491442 - Fix comments that talk about BasicLayers but intend to say BasicCompositor. r=mattwoodrow
BasicLayers is main thread drawing. BasicCompositor is compositor-thread drawing.

Differential Revision: https://phabricator.services.mozilla.com/D38749

--HG--
extra : moz-landing-system : lando
2019-08-16 01:10:40 +00:00
Markus Stange
2935e2eca6 Bug 1491442 - Fix up and document mNeedsGLUpdate locking semantics, and remove a stray semicolon. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D38748

--HG--
extra : moz-landing-system : lando
2019-08-16 01:10:11 +00:00
Sylvestre Ledru
645f2d5773 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D41559

--HG--
extra : moz-landing-system : lando
2019-08-13 07:15:25 +00:00
harry
2413c70932 Bug 1465403 - Support loading icons @2x in macOS menu bars. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D41391

--HG--
extra : moz-landing-system : lando
2019-08-12 13:53:38 +00:00
Dzmitry Malyshau
005edf80aa Bug 1570736 - Force disable WR swizzling on Intel 4000 on Mac r=aosmond
Investigation showed that on this platform the texture unit state becomes
corrupted whenever we set the non-identity swizzling (getting garbage from textureSize()).
Given no easy workaround, we disable swizzling for this GPU family on Mac, for now.

Differential Revision: https://phabricator.services.mozilla.com/D41274

--HG--
extra : moz-landing-system : lando
2019-08-09 18:57:35 +00:00
harry
878ff4c77b Bug 1568862 - Resolve dangling pointer and faulty error logic in macOS icon loaders. r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D39782

--HG--
extra : moz-landing-system : lando
2019-07-31 16:49:45 +00:00
Haik Aftandilian
14a6956635 Bug 1563994 - [10.15] Right Click When Not Focused Presents "Keystroke Receiving" Access Grant Request Dialog r=mstange
Use addGlobalMonitorForEventsMatchingMask instead of CGEventTapCreate to monitor for mouse clicks outside of the application while context menus are displayed.

Using addGlobalMonitorForEventsMatchingMask prevents the display of the privacy "Keystroke Receiving" dialog when listening for mouse clicks.

Differential Revision: https://phabricator.services.mozilla.com/D39973

--HG--
extra : moz-landing-system : lando
2019-07-31 01:03:49 +00:00
Sebastian Hengst
14f4125565 Backed out changeset 4aead1eca8c6 (bug 1521893) to fix crashes (bug 1568862)
--HG--
extra : rebase_source : 55caf819b464734c29515f81eca41a6cbba4d5b4
2019-07-29 17:11:19 +02:00
Nicholas Nethercote
18fae65f38 Bug 1563139 - Remove StaticPrefs.h. r=glandium
This requires replacing inclusions of it with inclusions of more specific prefs
files.

The exception is that StaticPrefsAll.h, which is equivalent to StaticPrefs.h,
and is used in `Codegen.py` because doing something smarter is tricky and
suitable for a follow-up. As a result, any change to StaticPrefList.yaml will
still trigger recompilation of all the generated DOM bindings files, but that's
still a big improvement over trigger recompilation of every file that uses
static prefs.

Most of the changes in this commit are very boring. The only changes that are
not boring are modules/libpref/*, Codegen.py, and ServoBindings.toml.

Differential Revision: https://phabricator.services.mozilla.com/D39138

--HG--
extra : moz-landing-system : lando
2019-07-26 01:10:23 +00:00
Thomas Nguyen
db9e147a01 Bug 1566411 Use ReferrerInfo class in imgLoader.idl r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D38177

--HG--
extra : moz-landing-system : lando
2019-07-25 08:23:32 +00:00
harry
aa07dd7b93 Bug 1521893 - Part 2 - Support loading SVG icons on the Touch Bar through a new nsTouchBarInputIcon service class r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D34926

--HG--
extra : moz-landing-system : lando
2019-07-24 13:03:49 +00:00
Ciure Andrei
c2592a1c3b Backed out changeset 6bad91b2f198 (bug 1521893) for causing browser_touchbar_tests.js to permafail CLOSED TREE 2019-07-23 05:11:00 +03:00
Mike Hommey
ef8e3d8dd2 Bug 1564216 - Fix warnings in nsCocoaUtils.mm with 10.14 SDK. r=mstange
While there, transform the MOZ_ASSERTs into static_asserts, so that
discrepancies are caught at build time rather than runtime.

Differential Revision: https://phabricator.services.mozilla.com/D38165

--HG--
extra : moz-landing-system : lando
2019-07-18 22:42:59 +00:00
harry
e5cfc44574 Bug 1521893 - Part 2 - Support loading SVG icons on the Touch Bar through a new nsTouchBarInputIcon service class r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D34926

--HG--
extra : moz-landing-system : lando
2019-07-22 18:23:34 +00:00
Nicholas Nethercote
7974362afd Bug 1567329 - Append _AtStartup to once static pref getters. r=erahm
Currently it's completely unclear at use sites that the getters for `once`
static prefs return the pref value from startup, rather than the current pref
value. (Bugs have been caused by this.) This commit improves things by changing
the getter name to make it clear that the pref value obtained is from startup.

This required changing things within libpref so it distinguishes between the
"base id" (`foo_bar`) and the "full id" (`foo_bar` or
`foo_bar_DoNotUseDirectly` or `foo_bar_AtStartup` or
`foo_bar_AtStartup_DoNotUseDirectly`; the name used depends on the `mirror` and
`do_not_use_directly` values in the YAML definition.) The "full id" is used in
most places, while the "base id" is used for the `GetPrefName_*` and
`GetPrefDefault_*` functions.

(This is a nice demonstration of the benefits of the YAML file, BTW. Making
this change with the old code would have involved adding an entry to every
single pref in StaticPrefList.h.)

The patch also rejigs the comment at the top of StaticPrefList.yaml, to clarify
some things.

Differential Revision: https://phabricator.services.mozilla.com/D38604

--HG--
extra : moz-landing-system : lando
2019-07-22 02:10:14 +00:00
harry
6b990275d7 Bug 1567517 - Restore camera and mic indicators in the macOS menubar. r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D38745

--HG--
extra : moz-landing-system : lando
2019-07-19 22:08:41 +00:00