Hash :
ba87b195
Author :
Date :
2022-09-01T13:38:17
OpenGL: Pass EGL_GL_COLORSPACE_KHR to OGL backend When we create NativeBufferImageSiblingAndroid, the attributes is lost, which caused a few AHB tests failed. This CL ensures we pass the EGL_GL_COLORSPACE_KHR attribute to NativeBufferImageSiblingAndroid and OpenGLES backend now passes. Bug: b/205995945 Change-Id: I5a0a9dc1d34dbc0167890791b397c3c83b0adef4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3869368 Auto-Submit: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
//
// Copyright 2016 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// DisplayAndroid.cpp: Android implementation of egl::Display
#include "libANGLE/renderer/gl/egl/android/DisplayAndroid.h"
#include <android/log.h>
#include <android/native_window.h>
#include "libANGLE/Display.h"
#include "libANGLE/renderer/gl/egl/android/NativeBufferImageSiblingAndroid.h"
namespace rx
{
DisplayAndroid::DisplayAndroid(const egl::DisplayState &state) : DisplayEGL(state) {}
DisplayAndroid::~DisplayAndroid() {}
bool DisplayAndroid::isValidNativeWindow(EGLNativeWindowType window) const
{
return ANativeWindow_getFormat(window) >= 0;
}
egl::Error DisplayAndroid::validateImageClientBuffer(const gl::Context *context,
EGLenum target,
EGLClientBuffer clientBuffer,
const egl::AttributeMap &attribs) const
{
switch (target)
{
case EGL_NATIVE_BUFFER_ANDROID:
return egl::NoError();
default:
return DisplayEGL::validateImageClientBuffer(context, target, clientBuffer, attribs);
}
}
ExternalImageSiblingImpl *DisplayAndroid::createExternalImageSibling(
const gl::Context *context,
EGLenum target,
EGLClientBuffer buffer,
const egl::AttributeMap &attribs)
{
switch (target)
{
case EGL_NATIVE_BUFFER_ANDROID:
return new NativeBufferImageSiblingAndroid(buffer, attribs);
default:
return DisplayEGL::createExternalImageSibling(context, target, buffer, attribs);
}
}
} // namespace rx