Commit 6f1e42dd authored by Sean McAllister's avatar Sean McAllister Committed by Commit Bot

Refactor OS_LINUX preprocessor directive for LaCrOS effort.

Currently, ChromeOS defines the OS_LINUX directive as well as
OS_CHROMEOS.  We're working to separate these two, so we're
making the fact that OS_LINUX == OS_LINUX || OS_CHROMEOS
explicit.

This is changes for /media/video/fake_gpu_memory_buffer.cc

This CL was uploaded by git cl split.

R=dcastagna@chromium.org

Bug: 1110266
Change-Id: I96e84181f4cdb58d754759abb18a08a00fdc74a8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2370730Reviewed-by: default avatarDaniele Castagna <dcastagna@chromium.org>
Commit-Queue: Sean McAllister <smcallis@google.com>
Cr-Commit-Position: refs/heads/master@{#801397}
parent 8caa3dcd
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "media/base/format_utils.h" #include "media/base/format_utils.h"
#include "media/base/video_frame.h" #include "media/base/video_frame.h"
#if defined(OS_LINUX) #if defined(OS_LINUX) || defined(OS_CHROMEOS)
#include <fcntl.h> #include <fcntl.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
...@@ -48,7 +48,7 @@ class FakeGpuMemoryBufferImpl : public gpu::GpuMemoryBufferImpl { ...@@ -48,7 +48,7 @@ class FakeGpuMemoryBufferImpl : public gpu::GpuMemoryBufferImpl {
} // namespace } // namespace
#if defined(OS_LINUX) #if defined(OS_LINUX) || defined(OS_CHROMEOS)
base::ScopedFD GetDummyFD() { base::ScopedFD GetDummyFD() {
base::ScopedFD fd(open("/dev/zero", O_RDWR)); base::ScopedFD fd(open("/dev/zero", O_RDWR));
DCHECK(fd.is_valid()); DCHECK(fd.is_valid());
...@@ -73,7 +73,7 @@ FakeGpuMemoryBuffer::FakeGpuMemoryBuffer(const gfx::Size& size, ...@@ -73,7 +73,7 @@ FakeGpuMemoryBuffer::FakeGpuMemoryBuffer(const gfx::Size& size,
static base::NoDestructor<base::AtomicSequenceNumber> buffer_id_generator; static base::NoDestructor<base::AtomicSequenceNumber> buffer_id_generator;
handle_.id = gfx::GpuMemoryBufferId(buffer_id_generator->GetNext()); handle_.id = gfx::GpuMemoryBufferId(buffer_id_generator->GetNext());
#if defined(OS_LINUX) #if defined(OS_LINUX) || defined(OS_CHROMEOS)
for (size_t i = 0; i < VideoFrame::NumPlanes(video_pixel_format_); i++) { for (size_t i = 0; i < VideoFrame::NumPlanes(video_pixel_format_); i++) {
const gfx::Size plane_size_in_bytes = const gfx::Size plane_size_in_bytes =
VideoFrame::PlaneSize(video_pixel_format_, i, size_); VideoFrame::PlaneSize(video_pixel_format_, i, size_);
...@@ -81,7 +81,7 @@ FakeGpuMemoryBuffer::FakeGpuMemoryBuffer(const gfx::Size& size, ...@@ -81,7 +81,7 @@ FakeGpuMemoryBuffer::FakeGpuMemoryBuffer(const gfx::Size& size,
plane_size_in_bytes.width(), 0, plane_size_in_bytes.GetArea(), plane_size_in_bytes.width(), 0, plane_size_in_bytes.GetArea(),
GetDummyFD()); GetDummyFD());
} }
#endif // defined(OS_LINUX) #endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
} }
FakeGpuMemoryBuffer::~FakeGpuMemoryBuffer() = default; FakeGpuMemoryBuffer::~FakeGpuMemoryBuffer() = default;
...@@ -129,7 +129,7 @@ gfx::GpuMemoryBufferHandle FakeGpuMemoryBuffer::CloneHandle() const { ...@@ -129,7 +129,7 @@ gfx::GpuMemoryBufferHandle FakeGpuMemoryBuffer::CloneHandle() const {
gfx::GpuMemoryBufferHandle handle; gfx::GpuMemoryBufferHandle handle;
handle.type = gfx::NATIVE_PIXMAP; handle.type = gfx::NATIVE_PIXMAP;
handle.id = handle_.id; handle.id = handle_.id;
#if defined(OS_LINUX) #if defined(OS_LINUX) || defined(OS_CHROMEOS)
handle.native_pixmap_handle = handle.native_pixmap_handle =
gfx::CloneHandleForIPC(handle_.native_pixmap_handle); gfx::CloneHandleForIPC(handle_.native_pixmap_handle);
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment