d9ba26273a
* chore: bump chromium in DEPS to 118.0.5982.0 * chore: bump chromium in DEPS to 118.0.5983.0 * chore: bump chromium in DEPS to 118.0.5985.0 * chore: bump chromium in DEPS to 118.0.5987.0 * chore: update v8 patches * chore: update chromium patches * chore: update patches * [PEPC] Add new structs to contain permission request data Refs https://chromium-review.googlesource.com/c/chromium/src/+/4756727 * Add ThumbnailCapturer interface Refs https://chromium-review.googlesource.com/c/chromium/src/+/4812256 * Reland "[ChromeRefresh2023] Update document pip windows for Chrome Refresh" Refs https://chromium-review.googlesource.com/c/chromium/src/+/4814275 * chore: bump chromium in DEPS to 118.0.5989.0 * chore: bump chromium in DEPS to 118.0.5991.0 * chore: update patches --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: deepak1556 <hop2deep@gmail.com> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
165 lines
5.8 KiB
Diff
165 lines
5.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Cheng Zhao <zcbenz@gmail.com>
|
|
Date: Thu, 20 Sep 2018 17:48:49 -0700
|
|
Subject: mas: disable remote layer APIs (CAContext and CALayerHost) for MAS
|
|
build
|
|
|
|
Accordin to ccameron:
|
|
|
|
For apps that spend a lot of time watching video (especially fullscreen video),
|
|
the power/battery usage will likely increase 1.5x to 2x. For something that is,
|
|
e.g, scrolling, it'll be smaller, more like 1.15x or 1.25x.
|
|
|
|
In terms of performance, the impact will likely be fairly small -- any app that
|
|
could hit 60fps before will likely still be able to hit 60fps. There may even be
|
|
cases where performance improves when disabling remote CoreAnimation (remote
|
|
CoreAnimation is really only about battery usage).
|
|
|
|
diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.h b/gpu/ipc/service/image_transport_surface_overlay_mac.h
|
|
index 655dca3b5628eae2d13bce22e24a517113701480..30b97c47b6804d5677f87a59d7d5c6028f6d4bf4 100644
|
|
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.h
|
|
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.h
|
|
@@ -23,7 +23,9 @@
|
|
#include "ui/display/types/display_constants.h"
|
|
#endif
|
|
|
|
+#if !IS_MAS_BUILD()
|
|
@class CAContext;
|
|
+#endif
|
|
@class CALayer;
|
|
|
|
namespace ui {
|
|
@@ -79,8 +81,10 @@ class ImageTransportSurfaceOverlayMacEGL : public gl::Presenter {
|
|
|
|
base::WeakPtr<ImageTransportSurfaceDelegate> delegate_;
|
|
|
|
+#if !IS_MAS_BUILD()
|
|
const bool use_remote_layer_api_;
|
|
CAContext* __strong ca_context_;
|
|
+#endif
|
|
std::unique_ptr<ui::CALayerTreeCoordinator> ca_layer_tree_coordinator_;
|
|
|
|
gfx::Size pixel_size_;
|
|
diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.mm b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
|
index 40212e81a3c0303a9166426dd7349a95ffec39c4..b323a1f81f0e813b84ef98db9334d0c1992fbaa6 100644
|
|
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
|
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
|
@@ -54,7 +54,9 @@
|
|
ImageTransportSurfaceOverlayMacEGL::ImageTransportSurfaceOverlayMacEGL(
|
|
base::WeakPtr<ImageTransportSurfaceDelegate> delegate)
|
|
: delegate_(delegate),
|
|
+#if !IS_MAS_BUILD()
|
|
use_remote_layer_api_(ui::RemoteLayerAPISupported()),
|
|
+#endif
|
|
scale_factor_(1),
|
|
weak_ptr_factory_(this) {
|
|
static bool av_disabled_at_command_line =
|
|
@@ -66,6 +68,7 @@
|
|
->workarounds()
|
|
.disable_av_sample_buffer_display_layer;
|
|
|
|
+#if !IS_MAS_BUILD()
|
|
ca_layer_tree_coordinator_ = std::make_unique<ui::CALayerTreeCoordinator>(
|
|
use_remote_layer_api_, allow_av_sample_buffer_display_layer);
|
|
|
|
@@ -86,6 +89,10 @@
|
|
#endif
|
|
ca_context_.layer = ca_layer_tree_coordinator_->GetCALayerForDisplay();
|
|
}
|
|
+#else
|
|
+ ca_layer_tree_coordinator_ = std::make_unique<ui::CALayerTreeCoordinator>(
|
|
+ /*allow_remote_layers=*/false, allow_av_sample_buffer_display_layer);
|
|
+#endif
|
|
}
|
|
|
|
ImageTransportSurfaceOverlayMacEGL::~ImageTransportSurfaceOverlayMacEGL() {
|
|
@@ -203,9 +210,13 @@
|
|
TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffers", TRACE_EVENT_SCOPE_THREAD,
|
|
"GLImpl", static_cast<int>(gl::GetGLImplementation()),
|
|
"width", pixel_size_.width());
|
|
+#if !IS_MAS_BUILD()
|
|
if (use_remote_layer_api_) {
|
|
params.ca_context_id = [ca_context_ contextId];
|
|
} else {
|
|
+#else
|
|
+ if (true) {
|
|
+#endif
|
|
IOSurfaceRef io_surface =
|
|
ca_layer_tree_coordinator_->GetIOSurfaceForDisplay();
|
|
if (io_surface) {
|
|
diff --git a/ui/accelerated_widget_mac/display_ca_layer_tree.mm b/ui/accelerated_widget_mac/display_ca_layer_tree.mm
|
|
index 3ff04691217a6b3c9d7605c2e6b8f8a88959b271..0296ca57a4c51cb3e97c65d5aba46f33617cb799 100644
|
|
--- a/ui/accelerated_widget_mac/display_ca_layer_tree.mm
|
|
+++ b/ui/accelerated_widget_mac/display_ca_layer_tree.mm
|
|
@@ -120,6 +120,7 @@ - (void)setContentsChanged;
|
|
}
|
|
|
|
void DisplayCALayerTree::GotCALayerFrame(uint32_t ca_context_id) {
|
|
+#if !IS_MAS_BUILD()
|
|
// Early-out if the remote layer has not changed.
|
|
if (remote_layer_.contextId == ca_context_id) {
|
|
return;
|
|
@@ -149,6 +150,9 @@ - (void)setContentsChanged;
|
|
[io_surface_layer_ removeFromSuperlayer];
|
|
io_surface_layer_ = nil;
|
|
}
|
|
+#else
|
|
+ NOTREACHED() << "Remote layer is being used in MAS build";
|
|
+#endif
|
|
}
|
|
|
|
void DisplayCALayerTree::GotIOSurfaceFrame(
|
|
diff --git a/ui/base/cocoa/remote_layer_api.h b/ui/base/cocoa/remote_layer_api.h
|
|
index 59dc2f82214cfd883b6ebef3b0fb25af6387a9cd..d585ba14b34021a93c878d0d9f9d9ef70eed32ca 100644
|
|
--- a/ui/base/cocoa/remote_layer_api.h
|
|
+++ b/ui/base/cocoa/remote_layer_api.h
|
|
@@ -17,6 +17,7 @@
|
|
|
|
#if BUILDFLAG(IS_MAC)
|
|
|
|
+#if !IS_MAS_BUILD()
|
|
// The CGSConnectionID is used to create the CAContext in the process that is
|
|
// going to share the CALayers that it is rendering to another process to
|
|
// display.
|
|
@@ -68,6 +69,8 @@ extern NSString* const kCAContextIgnoresHitTest;
|
|
|
|
#endif // __OBJC__
|
|
|
|
+#endif // MAS_BUILD
|
|
+
|
|
namespace ui {
|
|
|
|
// This function will check if all of the interfaces listed above are supported
|
|
diff --git a/ui/base/cocoa/remote_layer_api.mm b/ui/base/cocoa/remote_layer_api.mm
|
|
index fc25ba79d2b0e1acdb7ba54b89e7d6e16f94771b..962df2d65d61ec0836cf465d847eb666033846f2 100644
|
|
--- a/ui/base/cocoa/remote_layer_api.mm
|
|
+++ b/ui/base/cocoa/remote_layer_api.mm
|
|
@@ -10,6 +10,7 @@
|
|
|
|
namespace ui {
|
|
|
|
+#if !IS_MAS_BUILD()
|
|
namespace {
|
|
// Control use of cross-process CALayers to display content directly from the
|
|
// GPU process on Mac.
|
|
@@ -17,8 +18,10 @@
|
|
"RemoteCoreAnimationAPI",
|
|
base::FEATURE_ENABLED_BY_DEFAULT);
|
|
} // namespace
|
|
+#endif
|
|
|
|
bool RemoteLayerAPISupported() {
|
|
+#if !IS_MAS_BUILD()
|
|
if (!base::FeatureList::IsEnabled(kRemoteCoreAnimationAPI))
|
|
return false;
|
|
|
|
@@ -55,6 +58,9 @@ bool RemoteLayerAPISupported() {
|
|
|
|
// If everything is there, we should be able to use the API.
|
|
return true;
|
|
+#else
|
|
+ return false;
|
|
+#endif // MAS_BUILD
|
|
}
|
|
|
|
} // namespace
|