electron/patches/common/chromium/browser_compositor_mac.patch
2018-12-03 20:07:37 +05:30

44 lines
2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Thu, 20 Sep 2018 17:45:14 -0700
Subject: browser_compositor_mac.patch
diff --git a/content/browser/renderer_host/browser_compositor_view_mac.h b/content/browser/renderer_host/browser_compositor_view_mac.h
index 7dc490ea5607bc61344d763d73b008c9be43280a..df136ec5c30db5146e5d1dd34e2f5ff55377af59 100644
--- a/content/browser/renderer_host/browser_compositor_view_mac.h
+++ b/content/browser/renderer_host/browser_compositor_view_mac.h
@@ -60,6 +60,8 @@ 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();
@@ -70,6 +72,7 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient,
// no valid frame is available.
const gfx::CALayerParams* GetLastCALayerParams() const;
+ ui::Compositor* GetCompositor();
void DidCreateNewRendererCompositorFrameSink(
viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink);
void OnDidNotProduceFrame(const viz::BeginFrameAck& ack);
diff --git a/content/browser/renderer_host/browser_compositor_view_mac.mm b/content/browser/renderer_host/browser_compositor_view_mac.mm
index fb23caccdd1dc0280ba2039937222679b6b460d8..d1739539e7bf5240c70aece8bcc84bc093ebde3a 100644
--- a/content/browser/renderer_host/browser_compositor_view_mac.mm
+++ b/content/browser/renderer_host/browser_compositor_view_mac.mm
@@ -79,6 +79,12 @@
DCHECK_EQ(1u, num_erased);
}
+ui::Compositor* BrowserCompositorMac::GetCompositor() {
+ if (recyclable_compositor_)
+ return recyclable_compositor_->compositor();
+ return nullptr;
+}
+
DelegatedFrameHost* BrowserCompositorMac::GetDelegatedFrameHost() {
DCHECK(delegated_frame_host_);
return delegated_frame_host_.get();