Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(743)

Unified Diff: ui/gfx/mojo/buffer_types_struct_traits.cc

Issue 2683593006: Use OS_LINUX instead of USE_OZONE in ui/gfx/ when possible (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/mojo/buffer_types_struct_traits.h ('k') | ui/gfx/mojo/struct_traits_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/mojo/buffer_types_struct_traits.cc
diff --git a/ui/gfx/mojo/buffer_types_struct_traits.cc b/ui/gfx/mojo/buffer_types_struct_traits.cc
index fbe8ee248b6a4889fbbf0ed1d32e30544db3748f..f3f1536a5f39d734c018ad7c5c9ff5b2891f3081 100644
--- a/ui/gfx/mojo/buffer_types_struct_traits.cc
+++ b/ui/gfx/mojo/buffer_types_struct_traits.cc
@@ -25,7 +25,7 @@ std::vector<mojo::ScopedHandle> StructTraits<
gfx::NativePixmapHandle>::fds(const gfx::NativePixmapHandle& pixmap_handle,
void* context) {
PixmapHandleFdList* handles = static_cast<PixmapHandleFdList*>(context);
-#if defined(USE_OZONE)
+#if defined(OS_LINUX)
if (handles->empty()) {
// Generate the handles here, but do not send them yet.
for (const base::FileDescriptor& fd : pixmap_handle.fds) {
@@ -34,7 +34,7 @@ std::vector<mojo::ScopedHandle> StructTraits<
}
return PixmapHandleFdList(handles->size());
}
-#endif // defined(USE_OZONE)
+#endif // defined(OS_LINUX)
return std::move(*handles);
}
@@ -42,7 +42,7 @@ bool StructTraits<
gfx::mojom::NativePixmapHandleDataView,
gfx::NativePixmapHandle>::Read(gfx::mojom::NativePixmapHandleDataView data,
gfx::NativePixmapHandle* out) {
-#if defined(USE_OZONE)
+#if defined(OS_LINUX)
mojo::ArrayDataView<mojo::ScopedHandle> handles_data_view;
data.GetFdsDataView(&handles_data_view);
for (size_t i = 0; i < handles_data_view.size(); ++i) {
@@ -89,7 +89,7 @@ const gfx::NativePixmapHandle&
StructTraits<gfx::mojom::GpuMemoryBufferHandleDataView,
gfx::GpuMemoryBufferHandle>::
native_pixmap_handle(const gfx::GpuMemoryBufferHandle& handle) {
-#if defined(USE_OZONE)
+#if defined(OS_LINUX)
return handle.native_pixmap_handle;
#else
static gfx::NativePixmapHandle pixmap_handle;
@@ -145,7 +145,7 @@ bool StructTraits<gfx::mojom::GpuMemoryBufferHandleDataView,
out->offset = data.offset();
out->stride = data.stride();
}
-#if defined(USE_OZONE)
+#if defined(OS_LINUX)
if (out->type == gfx::OZONE_NATIVE_PIXMAP &&
!data.ReadNativePixmapHandle(&out->native_pixmap_handle))
return false;
« no previous file with comments | « ui/gfx/mojo/buffer_types_struct_traits.h ('k') | ui/gfx/mojo/struct_traits_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698