electron/patches/common/chromium/browser_compositor_mac.patch
Milan Burda d56617e5d0 chore: avoid appending git version to the exported patches (#15389)
* chore: avoid appending git version to the exported patches

* fix no-eol at end of v8 patch
2018-10-26 12:52:59 +05:30

44 lines
2.1 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 46be85eea4b52b191d9e717fd34408a6c2445199..4c816b7021f87873a524e0dc2384146193b86e3c 100644
--- a/content/browser/renderer_host/browser_compositor_view_mac.h
+++ b/content/browser/renderer_host/browser_compositor_view_mac.h
@@ -59,6 +59,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();
@@ -69,6 +71,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 92afcc77910610e53378f55adc003cc1bdf3109a..42bd6fd7c169de36c775471c68b456f1386ff666 100644
--- a/content/browser/renderer_host/browser_compositor_view_mac.mm
+++ b/content/browser/renderer_host/browser_compositor_view_mac.mm
@@ -81,6 +81,12 @@ BrowserCompositorMac::~BrowserCompositorMac() {
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();