Perf: remove unnecessary shadows and mask views

This commit is contained in:
James Magahern
2020-09-30 18:26:45 -07:00
parent 3769f5bbbf
commit fab8ccecbd
5 changed files with 19 additions and 9 deletions

View File

@@ -149,6 +149,10 @@ class BrowserView: UIView
autocompleteView.layer.cornerRadius = 8.0
autocompleteView.layer.masksToBounds = true
let shadowPath = UIBezierPath(roundedRect: autocompleteView.bounds,
cornerRadius: autocompleteView.layer.cornerRadius)
autocompleteView.layer.shadowPath = shadowPath.cgPath
if let toolbarView = toolbarView, let urlBar = toolbarView.urlBar {
let urlFrame = self.convert(urlBar.frame, from: urlBar.superview)
autocompleteView.frame = CGRect(
@@ -158,6 +162,9 @@ class BrowserView: UIView
height: bounds.height / 2.5
)
}
} else {
autocompleteView.layer.cornerRadius = 0.0
autocompleteView.layer.shadowOpacity = 0.0
}
}