fix: simplify SetBackgroundColor
The compositor_superview member of BridgedNativeWidgetMac has been removed so as a consequence there is only one layer on which we need to call setBackgroundColor
This commit is contained in:
parent
2420cdf027
commit
dd43e92186
1 changed files with 1 additions and 7 deletions
|
@ -999,13 +999,7 @@ bool NativeWindowMac::IsKiosk() {
|
||||||
void NativeWindowMac::SetBackgroundColor(SkColor color) {
|
void NativeWindowMac::SetBackgroundColor(SkColor color) {
|
||||||
base::ScopedCFTypeRef<CGColorRef> cgcolor(
|
base::ScopedCFTypeRef<CGColorRef> cgcolor(
|
||||||
skia::CGColorCreateFromSkColor(color));
|
skia::CGColorCreateFromSkColor(color));
|
||||||
// views::Widget adds a layer for the content view.
|
[[[window_ contentView] layer] setBackgroundColor:cgcolor];
|
||||||
auto* bridge = views::NativeWidgetMac::GetBridgeForNativeWindow(window_);
|
|
||||||
auto* compositor_superview = bridge->ns_view();
|
|
||||||
[[compositor_superview layer] setBackgroundColor:cgcolor];
|
|
||||||
// When using WebContents as content view, the contentView also has layer.
|
|
||||||
if ([[window_ contentView] wantsLayer])
|
|
||||||
[[[window_ contentView] layer] setBackgroundColor:cgcolor];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeWindowMac::SetHasShadow(bool has_shadow) {
|
void NativeWindowMac::SetHasShadow(bool has_shadow) {
|
||||||
|
|
Loading…
Reference in a new issue