Commit a159aab7 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 /gpu/command_buffer

This CL was uploaded by git cl split.

R=zmo@chromium.org

Bug: 1110266
Change-Id: I360f6a48e084e8e670f80ac6407fac1457eb184b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2371296
Auto-Submit: Sean McAllister <smcallis@google.com>
Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800884}
parent 04e9c2e2
...@@ -39,7 +39,7 @@ GLuint ImportSemaphoreHandleToGLSemaphore(SemaphoreHandle handle) { ...@@ -39,7 +39,7 @@ GLuint ImportSemaphoreHandleToGLSemaphore(SemaphoreHandle handle) {
}, },
base::Time::Now())); base::Time::Now()));
#if defined(OS_LINUX) || defined(OS_ANDROID) #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
if (handle.vk_handle_type() != if (handle.vk_handle_type() !=
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT) { VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT) {
DLOG(ERROR) << "Importing semaphore handle of unexpected type:" DLOG(ERROR) << "Importing semaphore handle of unexpected type:"
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include "ui/gl/gl_version_info.h" #include "ui/gl/gl_version_info.h"
#include "ui/gl/scoped_binders.h" #include "ui/gl/scoped_binders.h"
#if defined(OS_LINUX) && BUILDFLAG(USE_DAWN) #if (defined(OS_LINUX) || defined(OS_CHROMEOS)) && BUILDFLAG(USE_DAWN)
#include "gpu/command_buffer/service/external_vk_image_dawn_representation.h" #include "gpu/command_buffer/service/external_vk_image_dawn_representation.h"
#endif #endif
...@@ -582,7 +582,7 @@ std::unique_ptr<SharedImageRepresentationDawn> ...@@ -582,7 +582,7 @@ std::unique_ptr<SharedImageRepresentationDawn>
ExternalVkImageBacking::ProduceDawn(SharedImageManager* manager, ExternalVkImageBacking::ProduceDawn(SharedImageManager* manager,
MemoryTypeTracker* tracker, MemoryTypeTracker* tracker,
WGPUDevice wgpuDevice) { WGPUDevice wgpuDevice) {
#if defined(OS_LINUX) && BUILDFLAG(USE_DAWN) #if (defined(OS_LINUX) || defined(OS_CHROMEOS)) && BUILDFLAG(USE_DAWN)
auto wgpu_format = viz::ToWGPUFormat(format()); auto wgpu_format = viz::ToWGPUFormat(format());
if (wgpu_format == WGPUTextureFormat_Undefined) { if (wgpu_format == WGPUTextureFormat_Undefined) {
...@@ -601,7 +601,7 @@ ExternalVkImageBacking::ProduceDawn(SharedImageManager* manager, ...@@ -601,7 +601,7 @@ ExternalVkImageBacking::ProduceDawn(SharedImageManager* manager,
return std::make_unique<ExternalVkImageDawnRepresentation>( return std::make_unique<ExternalVkImageDawnRepresentation>(
manager, this, tracker, wgpuDevice, wgpu_format, std::move(memory_fd)); manager, this, tracker, wgpuDevice, wgpu_format, std::move(memory_fd));
#else // !defined(OS_LINUX) || !BUILDFLAG(USE_DAWN) #else // (!defined(OS_LINUX) && !defined(OS_CHROMEOS)) || !BUILDFLAG(USE_DAWN)
NOTIMPLEMENTED_LOG_ONCE(); NOTIMPLEMENTED_LOG_ONCE();
return nullptr; return nullptr;
#endif #endif
...@@ -614,7 +614,7 @@ GLuint ExternalVkImageBacking::ProduceGLTextureInternal() { ...@@ -614,7 +614,7 @@ GLuint ExternalVkImageBacking::ProduceGLTextureInternal() {
gl::GLApi* api = gl::g_current_gl_context; gl::GLApi* api = gl::g_current_gl_context;
base::Optional<ScopedDedicatedMemoryObject> memory_object; base::Optional<ScopedDedicatedMemoryObject> memory_object;
if (!use_separate_gl_texture()) { if (!use_separate_gl_texture()) {
#if defined(OS_LINUX) || defined(OS_ANDROID) #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
auto memory_fd = image_->GetMemoryFd(); auto memory_fd = image_->GetMemoryFd();
if (!memory_fd.is_valid()) if (!memory_fd.is_valid())
return 0; return 0;
......
...@@ -258,7 +258,7 @@ void getExpectedColorAndMask(GLenum src_internal_format, ...@@ -258,7 +258,7 @@ void getExpectedColorAndMask(GLenum src_internal_format,
setColor(adjusted_color[0], adjusted_color[1], adjusted_color[2], setColor(adjusted_color[0], adjusted_color[1], adjusted_color[2],
alpha_value, expected_color); alpha_value, expected_color);
#if defined(OS_MAC) || defined(OS_LINUX) #if defined(OS_MAC) || defined(OS_LINUX) || defined(OS_CHROMEOS)
// The alpha channel values for LUMINANCE_ALPHA source don't work OK // The alpha channel values for LUMINANCE_ALPHA source don't work OK
// on Mac or Linux, so skip comparison of those, see crbug.com/926579 // on Mac or Linux, so skip comparison of those, see crbug.com/926579
setColor(1, 1, 1, src_internal_format != GL_LUMINANCE_ALPHA, setColor(1, 1, 1, src_internal_format != GL_LUMINANCE_ALPHA,
...@@ -643,7 +643,8 @@ class GLCopyTextureCHROMIUMES3Test : public GLCopyTextureCHROMIUMTest { ...@@ -643,7 +643,8 @@ class GLCopyTextureCHROMIUMES3Test : public GLCopyTextureCHROMIUMTest {
bool ShouldSkipNorm16() const { bool ShouldSkipNorm16() const {
DCHECK(!ShouldSkipTest()); DCHECK(!ShouldSkipTest());
#if (defined(OS_MAC) || defined(OS_WIN) || defined(OS_LINUX)) && \ #if (defined(OS_MAC) || defined(OS_WIN) || defined(OS_LINUX) || \
defined(OS_CHROMEOS)) && \
(defined(ARCH_CPU_X86) || defined(ARCH_CPU_X86_64)) (defined(ARCH_CPU_X86) || defined(ARCH_CPU_X86_64))
// Make sure it's tested; it is safe to assume that the flag is always true // Make sure it's tested; it is safe to assume that the flag is always true
// on desktop. // on desktop.
...@@ -655,7 +656,7 @@ class GLCopyTextureCHROMIUMES3Test : public GLCopyTextureCHROMIUMTest { ...@@ -655,7 +656,7 @@ class GLCopyTextureCHROMIUMES3Test : public GLCopyTextureCHROMIUMTest {
bool ShouldSkipRGBA16ToRGB10A2() const { bool ShouldSkipRGBA16ToRGB10A2() const {
DCHECK(!ShouldSkipTest()); DCHECK(!ShouldSkipTest());
#if (defined(OS_MAC) || defined(OS_LINUX)) && \ #if (defined(OS_MAC) || defined(OS_LINUX) || defined(OS_CHROMEOS)) && \
(defined(ARCH_CPU_X86) || defined(ARCH_CPU_X86_64)) (defined(ARCH_CPU_X86) || defined(ARCH_CPU_X86_64))
// // TODO(crbug.com/1046873): Fails on mac and linux intel. // // TODO(crbug.com/1046873): Fails on mac and linux intel.
return true; return true;
......
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