REVIEW: Update common/chromium/browser_compositor_mac.patch
The change in `DelegatedFrameHostDesiredSizeInDIP` probably should be moved somewhere, not deleted. See related Chromium changes: 1. viz/mac: Prepare RenderWidgetHostViewMac for viz https://chromium-review.googlesource.com/794840 2. mac: Ensure surface invariants are not violated https://chromium-review.googlesource.com/918284
This commit is contained in:
Родитель
3257a5b437
Коммит
bd36c25aaf
|
@ -1,28 +1,26 @@
|
|||
diff --git a/content/browser/renderer_host/browser_compositor_view_mac.h b/content/browser/renderer_host/browser_compositor_view_mac.h
|
||||
index 4355a8cdacb4..57961ef39f8d 100644
|
||||
index 7426062f7381..bd5cd2fcd230 100644
|
||||
--- a/content/browser/renderer_host/browser_compositor_view_mac.h
|
||||
+++ b/content/browser/renderer_host/browser_compositor_view_mac.h
|
||||
@@ -50,6 +50,7 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient {
|
||||
|
||||
@@ -54,10 +54,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(); }
|
||||
|
||||
+ ui::Layer* GetRootLayer() { return root_layer_.get(); }
|
||||
+
|
||||
// Ensure that the currect compositor frame be cleared (even if it is
|
||||
// potentially visible).
|
||||
@@ -57,6 +58,7 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient {
|
||||
void ClearCompositorFrame();
|
||||
|
||||
// This may return nullptr, if this has detached itself from its
|
||||
// ui::Compositor.
|
||||
+ ui::Compositor* GetCompositor();
|
||||
ui::AcceleratedWidgetMac* GetAcceleratedWidgetMac();
|
||||
|
||||
gfx::AcceleratedWidget GetAcceleratedWidget();
|
||||
void DidCreateNewRendererCompositorFrameSink(
|
||||
viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink);
|
||||
diff --git a/content/browser/renderer_host/browser_compositor_view_mac.mm b/content/browser/renderer_host/browser_compositor_view_mac.mm
|
||||
index fba983b37..8cf962916 100644
|
||||
index 7fcc24c15c37..7c31977b20f9 100644
|
||||
--- a/content/browser/renderer_host/browser_compositor_view_mac.mm
|
||||
+++ b/content/browser/renderer_host/browser_compositor_view_mac.mm
|
||||
@@ -202,6 +202,12 @@ void OnCompositingShuttingDown(ui::Compositor* compositor) override {}
|
||||
@@ -208,6 +208,12 @@ BrowserCompositorMac::~BrowserCompositorMac() {
|
||||
g_spare_recyclable_compositors.Get().clear();
|
||||
}
|
||||
|
||||
|
@ -32,22 +30,6 @@ index fba983b37..8cf962916 100644
|
|||
+ return nullptr;
|
||||
+}
|
||||
+
|
||||
ui::AcceleratedWidgetMac* BrowserCompositorMac::GetAcceleratedWidgetMac() {
|
||||
if (recyclable_compositor_)
|
||||
return recyclable_compositor_->accelerated_widget_mac();
|
||||
@@ -421,8 +427,13 @@ void OnCompositingShuttingDown(ui::Compositor* compositor) override {}
|
||||
}
|
||||
|
||||
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 {
|
||||
gfx::AcceleratedWidget BrowserCompositorMac::GetAcceleratedWidget() {
|
||||
if (recyclable_compositor_) {
|
||||
return recyclable_compositor_->accelerated_widget_mac()
|
||||
|
|
Загрузка…
Ссылка в новой задаче