Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(603)

Issue 2622083007: MacViews: Make window content views layer-backed. (Closed)

Created:
3 years, 11 months ago by Sidney San Martín
Modified:
3 years, 7 months ago
Reviewers:
tapted
CC:
chromium-reviews, tfarina, mac-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

MacViews: Make window content views layer-backed. This lets the window clip content to its rounded corners (see views_examples_with_content_exe). Also, to quote erikchen@: > it's important that the content view is layer backed - it affects some > flags within appkit

Patch Set 1 #

Total comments: 1

Patch Set 2 : Experimental! #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -1 line) Patch
M ui/views/cocoa/bridged_native_widget.mm View 1 2 chunks +3 lines, -1 line 0 comments Download

Messages

Total messages: 13 (8 generated)
Sidney San Martín
The first thing I noticed in views_examples_with_content_exe was the content poking out of the window ...
3 years, 11 months ago (2017-01-12 23:56:21 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2622083007/1
3 years, 11 months ago (2017-01-12 23:58:28 UTC) #5
commit-bot: I haz the power
No L-G-T-M from a valid reviewer yet. CQ run can only be started by full ...
3 years, 11 months ago (2017-01-12 23:58:30 UTC) #7
Sidney San Martín
On 2017/01/12 23:58:30, commit-bot: I haz the power wrote: > No L-G-T-M from a valid ...
3 years, 11 months ago (2017-01-12 23:59:12 UTC) #9
tapted
3 years, 11 months ago (2017-01-13 00:22:37 UTC) #11
https://codereview.chromium.org/2622083007/diff/1/ui/views/cocoa/native_widge...
File ui/views/cocoa/native_widget_mac_nswindow.mm (right):

https://codereview.chromium.org/2622083007/diff/1/ui/views/cocoa/native_widge...
ui/views/cocoa/native_widget_mac_nswindow.mm:44:
static_cast<NSView*>(self.contentView).wantsLayer = YES;
ooh neat - I think this might fix http://crbug.com/649354 ? (wdyt - I'm not sure
if I can repro that.. but if(yes) can you cite that bug here?)  At the very
least it fixes the task manager not having rounded corners, and some resize
artifacts related to that \o/ - I can make a crbug for that if 649354 doesn't
fit.

But I think there's a downside -- this will need to allocate an additional
window-sized texture. So, I think there's no point doing this for fully
transparent windows. The best place for this might be in
bridged_native_widget.mm, with

  } else {
    [[window_ contentView] setWantsLayer:YES];
  }

towards the end of BridgedNativeWidget::CreateLayer()

This will happen after BridgedNativeWidget::SetRootView(..) which may replace
the windows' contentView.


Another approach might be to check for NSTexturedBackgroundWindowMask since
they're the ones AppKit promises to give rounded bottom corners to.

(but in either case, I think BridgedNativeWidget::CreateLayer is the right place
for it -- it seems like a quirk that this manages to work, since I'm pretty sure
SetRootView() happens after the initializer here, and it should be replacing the
contentView with a new one)

Powered by Google App Engine
This is Rietveld 408576698