cef/patch/patches/browser_compositor_mac.patch

51 lines
2.3 KiB
Diff

diff --git content/browser/renderer_host/browser_compositor_view_mac.h content/browser/renderer_host/browser_compositor_view_mac.h
index 6ad9f5fb334d..d7bf762314a4 100644
--- content/browser/renderer_host/browser_compositor_view_mac.h
+++ content/browser/renderer_host/browser_compositor_view_mac.h
@@ -56,11 +56,13 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient {
// These will not return nullptr until Destroy is called.
DelegatedFrameHost* GetDelegatedFrameHost();
+ ui::Layer* GetRootLayer() { return root_layer_.get(); }
// Ensure that the currect compositor frame be cleared (even if it is
// potentially visible).
void ClearCompositorFrame();
+ ui::Compositor* GetCompositor();
gfx::AcceleratedWidget GetAcceleratedWidget();
void DidCreateNewRendererCompositorFrameSink(
viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink);
diff --git content/browser/renderer_host/browser_compositor_view_mac.mm content/browser/renderer_host/browser_compositor_view_mac.mm
index 13a7da672959..28b0ab2d0e1a 100644
--- content/browser/renderer_host/browser_compositor_view_mac.mm
+++ content/browser/renderer_host/browser_compositor_view_mac.mm
@@ -208,6 +208,12 @@ BrowserCompositorMac::~BrowserCompositorMac() {
g_spare_recyclable_compositors.Get().clear();
}
+ui::Compositor* BrowserCompositorMac::GetCompositor() {
+ if (recyclable_compositor_)
+ return recyclable_compositor_->compositor();
+ return nullptr;
+}
+
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
index 97e7b502f15d..44811edbda4c 100644
--- ui/accelerated_widget_mac/accelerated_widget_mac.mm
+++ ui/accelerated_widget_mac/accelerated_widget_mac.mm
@@ -71,6 +71,10 @@ void AcceleratedWidgetMac::SetNSView(AcceleratedWidgetMacNSView* view) {
DCHECK(view && !view_);
view_ = view;
+ // Will be nullptr for CEF.
+ if (!view_->AcceleratedWidgetGetNSView())
+ return;
+
CALayer* background_layer = [view_->AcceleratedWidgetGetNSView() layer];
DCHECK(background_layer);
[flipped_layer_ setBounds:[background_layer bounds]];