Drive-by: Update `ui/gfx/` components
This CL is intended to be trivial.
This CL updates the component build pattern (see
`docs/component_build.md`) under `ui/gfx/`. All `GFX_EXPORT`s are now
`COMPONENT_EXPORT()`s in some form or another, and the GN recipes are
reworked slightly to use a shared config (to express that they are the
same component).
This CL was originally whipped up to investigate a compile failure in
https://crrev.com/c/5997296 (it turns out to be unrelated). Let it stand
as a horrifying demonstration of sunk cost.
Change-Id: I0d3a8ec703dfc1f6e32d46893b39128476ffd76c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6002456
Commit-Queue: Kalvin Lee <[email protected]>
Reviewed-by: Xiyuan Xia <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1380936}
diff --git a/ui/gfx/mac/io_surface.h b/ui/gfx/mac/io_surface.h
index 1a42e810..7bf30e59 100644
--- a/ui/gfx/mac/io_surface.h
+++ b/ui/gfx/mac/io_surface.h
@@ -10,20 +10,22 @@
#include <mach/mach.h>
#include "base/apple/scoped_cftyperef.h"
+#include "base/component_export.h"
#include "ui/gfx/buffer_types.h"
#include "ui/gfx/color_space.h"
#include "ui/gfx/generic_shared_memory_id.h"
#include "ui/gfx/geometry/size.h"
-#include "ui/gfx/gfx_export.h"
namespace gfx {
namespace internal {
struct IOSurfaceMachPortTraits {
- GFX_EXPORT static mach_port_t InvalidValue() { return MACH_PORT_NULL; }
- GFX_EXPORT static mach_port_t Retain(mach_port_t);
- GFX_EXPORT static void Release(mach_port_t);
+ COMPONENT_EXPORT(GFX) static mach_port_t InvalidValue() {
+ return MACH_PORT_NULL;
+ }
+ COMPONENT_EXPORT(GFX) static mach_port_t Retain(mach_port_t);
+ COMPONENT_EXPORT(GFX) static void Release(mach_port_t);
};
struct ScopedInUseIOSurfaceTraits {
@@ -52,7 +54,8 @@
// whereas for non-GL backends (Dawn and Metal) we want the formats to match.
// TODO(sunnyps): Revisit this when we switch to ANGLE Metal completely since
// wrapping RGBA_8888 can be implemented with Metal quite easily.
-GFX_EXPORT base::apple::ScopedCFTypeRef<IOSurfaceRef> CreateIOSurface(
+COMPONENT_EXPORT(GFX)
+base::apple::ScopedCFTypeRef<IOSurfaceRef> CreateIOSurface(
const Size& size,
BufferFormat format,
bool should_clear = true,
@@ -81,22 +84,24 @@
// Return true if there exists a value for IOSurfaceColorSpace or
// IOSurfaceICCProfile that will make CoreAnimation render using |color_space|.
-GFX_EXPORT bool IOSurfaceCanSetColorSpace(const gfx::ColorSpace& color_space);
+COMPONENT_EXPORT(GFX)
+bool IOSurfaceCanSetColorSpace(const gfx::ColorSpace& color_space);
// Set color space for given IOSurface. IOSurfaceCanSetColorSpace must return
// true for |color_space| otherwise this does nothing.
-GFX_EXPORT void IOSurfaceSetColorSpace(IOSurfaceRef io_surface,
- const gfx::ColorSpace& color_space);
+COMPONENT_EXPORT(GFX)
+void IOSurfaceSetColorSpace(IOSurfaceRef io_surface,
+ const gfx::ColorSpace& color_space);
// Return the expected four character code pixel format for an IOSurface with
// the specified gfx::BufferFormat.
-GFX_EXPORT uint32_t
-BufferFormatToIOSurfacePixelFormat(gfx::BufferFormat format,
- bool override_rgba_to_bgra = true);
+COMPONENT_EXPORT(GFX)
+uint32_t BufferFormatToIOSurfacePixelFormat(gfx::BufferFormat format,
+ bool override_rgba_to_bgra = true);
// Return an IOSurface consuming |io_surface_mach_port|.
-GFX_EXPORT base::apple::ScopedCFTypeRef<IOSurfaceRef>
-IOSurfaceMachPortToIOSurface(
+COMPONENT_EXPORT(GFX)
+base::apple::ScopedCFTypeRef<IOSurfaceRef> IOSurfaceMachPortToIOSurface(
ScopedRefCountedIOSurfaceMachPort io_surface_mach_port);
} // namespace gfx