refactor: change defined(MAS_BUILD) to IS_MAS_BUILD() (#36332)
* refactor: change defined(MAS_BUILD) to IS_MAS_BUILD() This is missing-definition safe and thus allows us to move the definition of this macro away from "all compilation targets" to "just the compilation targets that depend on this macro". In turn this makes the rebuild time changing from mas <-> darwin only 80 seconds on my machine, instead of the 12-15 minutes it used to take. This will also allow us in the future to build both MAS and darwin on the same CI machine. Costing us ~2 minutes on one machine but saving us anywhere from 30 minutes to an hour of CI time on other parts of the matrix. * build: always define IS_MAS_BUILD even on non-mac builds * build: use extra_configs
This commit is contained in:
parent
d8bb172318
commit
a9ef68f126
30 changed files with 455 additions and 167 deletions
|
@ -16,14 +16,14 @@ 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 54df9cd23be7441f9b61e9f94b191b3a6a7ab6fd..1ba6c4804cd98c6aa118fcd4ee74b1368648bde6 100644
|
||||
index 54df9cd23be7441f9b61e9f94b191b3a6a7ab6fd..861f6579d9fb93ab7c3741fd39eaaf8bda76ed9d 100644
|
||||
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.h
|
||||
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.h
|
||||
@@ -21,7 +21,9 @@
|
||||
#include "ui/gl/gl_surface_egl.h"
|
||||
#endif
|
||||
|
||||
+#ifndef MAS_BUILD
|
||||
+#if !IS_MAS_BUILD()
|
||||
@class CAContext;
|
||||
+#endif
|
||||
@class CALayer;
|
||||
|
@ -33,7 +33,7 @@ index 54df9cd23be7441f9b61e9f94b191b3a6a7ab6fd..1ba6c4804cd98c6aa118fcd4ee74b136
|
|||
base::WeakPtr<ImageTransportSurfaceDelegate> delegate_;
|
||||
|
||||
bool use_remote_layer_api_;
|
||||
+#ifndef MAS_BUILD
|
||||
+#if !IS_MAS_BUILD()
|
||||
base::scoped_nsobject<CAContext> ca_context_;
|
||||
+#endif
|
||||
std::unique_ptr<ui::CALayerTreeCoordinator> ca_layer_tree_coordinator_;
|
||||
|
@ -43,21 +43,21 @@ index 54df9cd23be7441f9b61e9f94b191b3a6a7ab6fd..1ba6c4804cd98c6aa118fcd4ee74b136
|
|||
base::WeakPtr<ImageTransportSurfaceDelegate> delegate_;
|
||||
|
||||
bool use_remote_layer_api_;
|
||||
+#ifndef MAS_BUILD
|
||||
+#if !IS_MAS_BUILD()
|
||||
base::scoped_nsobject<CAContext> 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 6944ef9d099231c04e1b13e8a434ca436637ddd2..f0e64b88d0dcaff5937424c14a41552a554c2be0 100644
|
||||
index 6944ef9d099231c04e1b13e8a434ca436637ddd2..57ec91986dad4f7f18263fdc81ec877406fbee69 100644
|
||||
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
||||
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
||||
@@ -68,6 +68,7 @@
|
||||
ca_layer_tree_coordinator_ = std::make_unique<ui::CALayerTreeCoordinator>(
|
||||
use_remote_layer_api_, allow_av_sample_buffer_display_layer);
|
||||
|
||||
+#ifndef MAS_BUILD
|
||||
+#if !IS_MAS_BUILD()
|
||||
// Create the CAContext to send this to the GPU process, and the layer for
|
||||
// the context.
|
||||
if (use_remote_layer_api_) {
|
||||
|
@ -73,7 +73,7 @@ index 6944ef9d099231c04e1b13e8a434ca436637ddd2..f0e64b88d0dcaff5937424c14a41552a
|
|||
"GLImpl", static_cast<int>(gl::GetGLImplementation()),
|
||||
"width", pixel_size_.width());
|
||||
if (use_remote_layer_api_) {
|
||||
+#ifndef MAS_BUILD
|
||||
+#if !IS_MAS_BUILD()
|
||||
params.ca_context_id = [ca_context_ contextId];
|
||||
+#endif
|
||||
} else {
|
||||
|
@ -83,7 +83,7 @@ index 6944ef9d099231c04e1b13e8a434ca436637ddd2..f0e64b88d0dcaff5937424c14a41552a
|
|||
ca_layer_tree_coordinator_ = std::make_unique<ui::CALayerTreeCoordinator>(
|
||||
use_remote_layer_api_, allow_av_sample_buffer_display_layer);
|
||||
|
||||
+#ifndef MAS_BUILD
|
||||
+#if !IS_MAS_BUILD()
|
||||
// Create the CAContext to send this to the GPU process, and the layer for
|
||||
// the context.
|
||||
if (use_remote_layer_api_) {
|
||||
|
@ -99,21 +99,21 @@ index 6944ef9d099231c04e1b13e8a434ca436637ddd2..f0e64b88d0dcaff5937424c14a41552a
|
|||
"GLImpl", static_cast<int>(gl::GetGLImplementation()),
|
||||
"width", pixel_size_.width());
|
||||
if (use_remote_layer_api_) {
|
||||
+#ifndef MAS_BUILD
|
||||
+#if !IS_MAS_BUILD()
|
||||
params.ca_context_id = [ca_context_ contextId];
|
||||
+#endif
|
||||
} else {
|
||||
IOSurfaceRef io_surface =
|
||||
ca_layer_tree_coordinator_->GetIOSurfaceForDisplay();
|
||||
diff --git a/ui/accelerated_widget_mac/display_ca_layer_tree.mm b/ui/accelerated_widget_mac/display_ca_layer_tree.mm
|
||||
index 2c4821b34f71d30ce814bd1f3cf9a7a76bbaac66..cd7e0eac449bc81d5c9f6f0bed40b0d339712427 100644
|
||||
index 2c4821b34f71d30ce814bd1f3cf9a7a76bbaac66..c7dc371c780a405f502a84c77e92251ae08f66e0 100644
|
||||
--- a/ui/accelerated_widget_mac/display_ca_layer_tree.mm
|
||||
+++ b/ui/accelerated_widget_mac/display_ca_layer_tree.mm
|
||||
@@ -99,6 +99,7 @@ - (void)setContentsChanged;
|
||||
}
|
||||
|
||||
void DisplayCALayerTree::GotCALayerFrame(uint32_t ca_context_id) {
|
||||
+#ifndef MAS_BUILD
|
||||
+#if !IS_MAS_BUILD()
|
||||
// Early-out if the remote layer has not changed.
|
||||
if ([remote_layer_ contextId] == ca_context_id)
|
||||
return;
|
||||
|
@ -128,14 +128,14 @@ index 2c4821b34f71d30ce814bd1f3cf9a7a76bbaac66..cd7e0eac449bc81d5c9f6f0bed40b0d3
|
|||
|
||||
void DisplayCALayerTree::GotIOSurfaceFrame(
|
||||
diff --git a/ui/base/cocoa/remote_layer_api.h b/ui/base/cocoa/remote_layer_api.h
|
||||
index 9b691e2f16c68235dd180a28b6eb2eefc91f8e4c..0ce8048c6a72fe1483d71b2fd5786c28d86ac2bf 100644
|
||||
index 9b691e2f16c68235dd180a28b6eb2eefc91f8e4c..9d4a7fb36e671980024b895eaafab2d970ac2818 100644
|
||||
--- a/ui/base/cocoa/remote_layer_api.h
|
||||
+++ b/ui/base/cocoa/remote_layer_api.h
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#include "base/component_export.h"
|
||||
|
||||
+#ifndef MAS_BUILD
|
||||
+#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.
|
||||
|
@ -149,14 +149,14 @@ index 9b691e2f16c68235dd180a28b6eb2eefc91f8e4c..0ce8048c6a72fe1483d71b2fd5786c28
|
|||
|
||||
// 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 e23eb7719a9798afe984c6af6a422167b93d89b5..2fcc48067c2992a2fae950a678269014b7295817 100644
|
||||
index e23eb7719a9798afe984c6af6a422167b93d89b5..d448bc09ee54fc77f1ed4d088d1369b96f83a1db 100644
|
||||
--- a/ui/base/cocoa/remote_layer_api.mm
|
||||
+++ b/ui/base/cocoa/remote_layer_api.mm
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
namespace ui {
|
||||
|
||||
+#ifndef MAS_BUILD
|
||||
+#if !IS_MAS_BUILD()
|
||||
namespace {
|
||||
// Control use of cross-process CALayers to display content directly from the
|
||||
// GPU process on Mac.
|
||||
|
@ -167,7 +167,7 @@ index e23eb7719a9798afe984c6af6a422167b93d89b5..2fcc48067c2992a2fae950a678269014
|
|||
+#endif
|
||||
|
||||
bool RemoteLayerAPISupported() {
|
||||
+#ifndef MAS_BUILD
|
||||
+#if !IS_MAS_BUILD()
|
||||
if (!base::FeatureList::IsEnabled(kRemoteCoreAnimationAPI))
|
||||
return false;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue