Commit 58070cfb authored by Miguel Casas-Sanchez's avatar Miguel Casas-Sanchez Committed by Commit Bot

fix GLImageIOSurface test failing in Mac 10.13.4 w/ Nvidia

This CL tentatively fixes GLImageIOSurface/GLImageBindTest/4
on Nvidia + 10.13.4 Mac OS X systems; the error log points
to the current workaround swizzling the R and B channels
specifically on such system and OS version combination doing
the wrong thing, so let's removes it and see if it does the
trick.

Bug: 813846
Change-Id: I013da016158860da05b1b2bf0c363d29afdbef2f
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Reviewed-on: https://chromium-review.googlesource.com/926763Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Commit-Queue: Miguel Casas <mcasas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537855}
parent 223fa7dc
......@@ -5,8 +5,6 @@
#include <stddef.h>
#include <stdint.h>
#include "base/mac/mac_util.h"
#include "base/strings/string_util.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/buffer_format_util.h"
......@@ -40,11 +38,6 @@ class GLImageIOSurfaceTestDelegate : public GLImageTestDelegateBase {
IOReturn status = IOSurfaceLock(surface_ref, 0, nullptr);
EXPECT_NE(status, kIOReturnCannotLock);
static const bool is_nvidia_and_mac_os_x_at_least_10_13 =
base::mac::IsAtLeastOS10_13() &&
base::StartsWith(reinterpret_cast<const char*>(glGetString(GL_VENDOR)),
"nvidia", base::CompareCase::INSENSITIVE_ASCII);
uint8_t corrected_color[4];
if (format == gfx::BufferFormat::RGBA_8888) {
// GL_RGBA is not supported by CGLTexImageIOSurface2D(), so we pretend it
......@@ -54,16 +47,6 @@ class GLImageIOSurfaceTestDelegate : public GLImageTestDelegateBase {
corrected_color[1] = color[1];
corrected_color[2] = color[0];
corrected_color[3] = color[3];
} else if (format == gfx::BufferFormat::BGRX_1010102 &&
is_nvidia_and_mac_os_x_at_least_10_13) {
// Framebuffers are wrongly interpreted as BGRA when using GL_RGB10_A2
// textures and/or IOSurfaces on High Sierra using nVidia GPUs; swizzle
// the channels here in advance https://crbug.com/803473,
// http://www.openradar.me/36824694, rdar://36824694.
corrected_color[0] = color[2];
corrected_color[1] = color[1];
corrected_color[2] = color[0];
corrected_color[3] = color[3];
} else {
memcpy(corrected_color, color, arraysize(corrected_color));
}
......
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