MacViews: Add Layers to NativeWidgetMac
commitf148545d79b5a43adf05b183d5ba554719abf617
authortapted <tapted@chromium.org>
Wed, 10 Dec 2014 23:59:41 +0000 (10 15:59 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 11 Dec 2014 00:00:13 +0000 (11 00:00 +0000)
tree81f3be0c62fa44367c0e2c60e93179af10e91d59
parent0e9a469231f2755ce84851082d1f2182a906a560
MacViews: Add Layers to NativeWidgetMac

Continuing its role as an aura::Window workalike, BridgedNativeWidget
becomes a ui::LayerOwner and a ui::LayerDelegate.

During Widget::Init(), calling BridgedNativeWidget::CreateLayer(..) will
install a compositor, and the ui::AcceleratedWidgetMac instance that
coordinates frames coming in from the GPU process will start
acknowledging them.

Note that most tests default to WINDOW_LAYER_TEXTURED. "NONE" is what
all the MacViews tests have been running against todate. It isn't used
much any more on Aura platforms, but we might want to keep it for Mac.

In this change, NativeWidgetMacTest, MiniaturizeExternally explicitly
sets WINDOW_LAYER_NONE since it relies on a synchronous paint. Other
tests now run with a layer. None regress. However, if we get better
results on Mac with WINDOW_LAYER_NONE in Release code for windows that
don't need a UI compositor, we will need to parameterize layer_type in
tests to keep coverage of both draw paths.

After this all (12 crashing, 1 failing) ViewLayerTest.* tests pass.
WidgetTest.CloseWidgetWhileAnimating moves from crashing to failing.

BUG=424058, 378134
TEST=views_unittests Before: 469 tests run. 20 fail, 16 crash. After:
468 tests run, 20 fail, 3 crash.

Review URL: https://codereview.chromium.org/710253002

Cr-Commit-Position: refs/heads/master@{#307797}
12 files changed:
ui/views/BUILD.gn
ui/views/cocoa/DEPS [new file with mode: 0644]
ui/views/cocoa/bridged_content_view.mm
ui/views/cocoa/bridged_native_widget.h
ui/views/cocoa/bridged_native_widget.mm
ui/views/cocoa/bridged_native_widget_unittest.mm
ui/views/cocoa/views_nswindow_delegate.mm
ui/views/controls/native/native_view_host_mac_unittest.mm
ui/views/views.gyp
ui/views/widget/native_widget_mac.mm
ui/views/widget/native_widget_mac_unittest.mm
ui/views/widget/widget_unittest.cc