2016-07-06 15:34:09 -04:00
|
|
|
diff --git content/browser/renderer_host/browser_compositor_view_mac.h content/browser/renderer_host/browser_compositor_view_mac.h
|
2018-04-19 11:44:42 -04:00
|
|
|
index 091f34477c01..44002b362be7 100644
|
2016-07-06 15:34:09 -04:00
|
|
|
--- content/browser/renderer_host/browser_compositor_view_mac.h
|
|
|
|
+++ content/browser/renderer_host/browser_compositor_view_mac.h
|
2018-04-19 11:44:42 -04:00
|
|
|
@@ -55,11 +55,13 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient {
|
2016-07-21 17:21:32 -04:00
|
|
|
|
|
|
|
// These will not return nullptr until Destroy is called.
|
|
|
|
DelegatedFrameHost* GetDelegatedFrameHost();
|
|
|
|
+ ui::Layer* GetRootLayer() { return root_layer_.get(); }
|
2016-07-06 15:34:09 -04:00
|
|
|
|
2017-09-06 17:40:58 -04:00
|
|
|
// Ensure that the currect compositor frame be cleared (even if it is
|
|
|
|
// potentially visible).
|
2018-02-14 19:12:09 -05:00
|
|
|
void ClearCompositorFrame();
|
2017-09-06 17:40:58 -04:00
|
|
|
|
2016-07-06 15:34:09 -04:00
|
|
|
+ ui::Compositor* GetCompositor();
|
2018-02-14 19:12:09 -05:00
|
|
|
gfx::AcceleratedWidget GetAcceleratedWidget();
|
2017-04-20 15:28:17 -04:00
|
|
|
void DidCreateNewRendererCompositorFrameSink(
|
2018-02-14 19:12:09 -05:00
|
|
|
viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink);
|
2016-07-06 15:34:09 -04:00
|
|
|
diff --git content/browser/renderer_host/browser_compositor_view_mac.mm content/browser/renderer_host/browser_compositor_view_mac.mm
|
2018-05-14 14:24:05 +03:00
|
|
|
index f459dc4ff03b..142e66948c3b 100644
|
2016-07-06 15:34:09 -04:00
|
|
|
--- content/browser/renderer_host/browser_compositor_view_mac.mm
|
|
|
|
+++ content/browser/renderer_host/browser_compositor_view_mac.mm
|
2018-04-19 11:44:42 -04:00
|
|
|
@@ -208,6 +208,12 @@ BrowserCompositorMac::~BrowserCompositorMac() {
|
2016-08-31 14:25:56 +03:00
|
|
|
g_spare_recyclable_compositors.Get().clear();
|
2016-07-06 15:34:09 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
+ui::Compositor* BrowserCompositorMac::GetCompositor() {
|
|
|
|
+ if (recyclable_compositor_)
|
|
|
|
+ return recyclable_compositor_->compositor();
|
|
|
|
+ return nullptr;
|
|
|
|
+}
|
|
|
|
+
|
2018-02-14 19:12:09 -05:00
|
|
|
gfx::AcceleratedWidget BrowserCompositorMac::GetAcceleratedWidget() {
|
|
|
|
if (recyclable_compositor_) {
|
|
|
|
return recyclable_compositor_->accelerated_widget_mac()
|
|
|
|
diff --git ui/accelerated_widget_mac/accelerated_widget_mac.mm ui/accelerated_widget_mac/accelerated_widget_mac.mm
|
2018-03-20 16:15:08 -04:00
|
|
|
index 8306398431d9..5ab4fef9ac0f 100644
|
2018-02-14 19:12:09 -05:00
|
|
|
--- ui/accelerated_widget_mac/accelerated_widget_mac.mm
|
|
|
|
+++ ui/accelerated_widget_mac/accelerated_widget_mac.mm
|
2018-04-19 11:44:42 -04:00
|
|
|
@@ -71,6 +71,10 @@ void AcceleratedWidgetMac::SetNSView(AcceleratedWidgetMacNSView* view) {
|
2018-02-14 19:12:09 -05:00
|
|
|
DCHECK(view && !view_);
|
|
|
|
view_ = view;
|
2016-07-21 17:21:32 -04:00
|
|
|
|
2018-02-14 19:12:09 -05:00
|
|
|
+ // Will be nullptr for CEF.
|
|
|
|
+ if (!view_->AcceleratedWidgetGetNSView())
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
CALayer* background_layer = [view_->AcceleratedWidgetGetNSView() layer];
|
|
|
|
DCHECK(background_layer);
|
|
|
|
[flipped_layer_ setBounds:[background_layer bounds]];
|