2016-07-06 21:34:09 +02:00
|
|
|
diff --git content/browser/renderer_host/browser_compositor_view_mac.h content/browser/renderer_host/browser_compositor_view_mac.h
|
2016-11-23 21:54:29 +01:00
|
|
|
index 865b29f..ef44e27 100644
|
2016-07-06 21:34:09 +02:00
|
|
|
--- content/browser/renderer_host/browser_compositor_view_mac.h
|
|
|
|
+++ content/browser/renderer_host/browser_compositor_view_mac.h
|
2016-11-23 21:54:29 +01:00
|
|
|
@@ -55,9 +55,11 @@ class BrowserCompositorMac : public cc::BeginFrameObserver,
|
2016-07-21 23:21:32 +02:00
|
|
|
|
|
|
|
// These will not return nullptr until Destroy is called.
|
|
|
|
DelegatedFrameHost* GetDelegatedFrameHost();
|
|
|
|
+ ui::Layer* GetRootLayer() { return root_layer_.get(); }
|
2016-07-06 21:34:09 +02:00
|
|
|
|
|
|
|
// This may return nullptr, if this has detached itself from its
|
|
|
|
// ui::Compositor.
|
|
|
|
+ ui::Compositor* GetCompositor();
|
|
|
|
ui::AcceleratedWidgetMac* GetAcceleratedWidgetMac();
|
|
|
|
|
2016-10-21 21:52:29 +02:00
|
|
|
void SwapCompositorFrame(uint32_t compositor_frame_sink_id,
|
2016-07-06 21:34:09 +02:00
|
|
|
diff --git content/browser/renderer_host/browser_compositor_view_mac.mm content/browser/renderer_host/browser_compositor_view_mac.mm
|
2017-01-23 18:36:54 +01:00
|
|
|
index bd36336..9123781 100644
|
2016-07-06 21:34:09 +02:00
|
|
|
--- content/browser/renderer_host/browser_compositor_view_mac.mm
|
|
|
|
+++ content/browser/renderer_host/browser_compositor_view_mac.mm
|
2017-01-23 18:36:54 +01:00
|
|
|
@@ -201,6 +201,12 @@ BrowserCompositorMac::~BrowserCompositorMac() {
|
2016-08-31 13:25:56 +02:00
|
|
|
g_spare_recyclable_compositors.Get().clear();
|
2016-07-06 21:34:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
+ui::Compositor* BrowserCompositorMac::GetCompositor() {
|
|
|
|
+ if (recyclable_compositor_)
|
|
|
|
+ return recyclable_compositor_->compositor();
|
|
|
|
+ return nullptr;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
ui::AcceleratedWidgetMac* BrowserCompositorMac::GetAcceleratedWidgetMac() {
|
|
|
|
if (recyclable_compositor_)
|
|
|
|
return recyclable_compositor_->accelerated_widget_mac();
|
2017-01-23 18:36:54 +01:00
|
|
|
@@ -417,8 +423,13 @@ SkColor BrowserCompositorMac::DelegatedFrameHostGetGutterColor(
|
2016-07-21 23:21:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
gfx::Size BrowserCompositorMac::DelegatedFrameHostDesiredSizeInDIP() const {
|
|
|
|
- NSRect bounds = [client_->BrowserCompositorMacGetNSView() bounds];
|
|
|
|
- return gfx::Size(bounds.size.width, bounds.size.height);
|
|
|
|
+ // View will be nil with CEF OSR.
|
|
|
|
+ NSView* view = client_->BrowserCompositorMacGetNSView();
|
|
|
|
+ if (view) {
|
|
|
|
+ NSRect bounds = [view bounds];
|
|
|
|
+ return gfx::Size(bounds.size.width, bounds.size.height);
|
|
|
|
+ }
|
|
|
|
+ return root_layer_->bounds().size();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool BrowserCompositorMac::DelegatedFrameCanCreateResizeLock() const {
|