Remove some linear-blending sRGB logic from sk_app

Leftover logic from when viewer tried to use an sRGB FBO0
when rendering to a surface with a color space attached.

Most of this had already been removed, found a few more bits.

Change-Id: I998a541f75ecc184d218d02e24ab57657e096f22
Reviewed-on: https://skia-review.googlesource.com/139764
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
This commit is contained in:
Brian Osman 2018-07-09 10:23:19 -04:00 committed by Skia Commit-Bot
parent 9c7f7f22d2
commit 294fe29581
3 changed files with 6 additions and 27 deletions

View File

@ -56,15 +56,12 @@ void GLWindowContext::destroyContext() {
sk_sp<SkSurface> GLWindowContext::getBackbufferSurface() {
if (nullptr == fSurface) {
if (fContext) {
GrGLFramebufferInfo fbInfo;
GrGLint buffer;
GR_GL_CALL(fBackendContext.get(), GetIntegerv(GR_GL_FRAMEBUFFER_BINDING,
&buffer));
GR_GL_CALL(fBackendContext.get(), GetIntegerv(GR_GL_FRAMEBUFFER_BINDING, &buffer));
GrGLFramebufferInfo fbInfo;
fbInfo.fFBOID = buffer;
fbInfo.fFormat =
fContext->contextPriv().caps()->srgbSupport() && fDisplayParams.fColorSpace
? GR_GL_SRGB8_ALPHA8
: GR_GL_RGBA8;
fbInfo.fFormat = GR_GL_RGBA8;
GrBackendRenderTarget backendRT(fWidth,
fHeight,

View File

@ -179,7 +179,7 @@ bool VulkanWindowContext::createSwapchain(int width, int height,
VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR :
VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
// Pick our surface format. For now, just make sure it matches our sRGB request:
// Pick our surface format.
VkFormat surfaceFormat = VK_FORMAT_UNDEFINED;
VkColorSpaceKHR colorSpace = VK_COLORSPACE_SRGB_NONLINEAR_KHR;
for (uint32_t i = 0; i < surfaceFormatCount; ++i) {

View File

@ -101,25 +101,7 @@ sk_sp<const GrGLInterface> GLWindowContext_android::onInitializeContext() {
// SkDebugf("Vendor: %s", eglQueryString(fDisplay, EGL_VENDOR));
// SkDebugf("Extensions: %s", eglQueryString(fDisplay, EGL_EXTENSIONS));
// These values are the same as the corresponding VG colorspace attributes,
// which were accepted starting in EGL 1.2. For some reason in 1.4, sRGB
// became hidden behind an extension, but it looks like devices aren't
// advertising that extension (including Nexus 5X). So just check version?
const EGLint srgbWindowAttribs[] = {
/*EGL_GL_COLORSPACE_KHR*/ 0x309D, /*EGL_GL_COLORSPACE_SRGB_KHR*/ 0x3089,
EGL_NONE,
};
const EGLint* windowAttribs = nullptr;
auto srgbColorSpace = SkColorSpace::MakeSRGB();
if (srgbColorSpace == fDisplayParams.fColorSpace && majorVersion == 1 && minorVersion >= 2) {
windowAttribs = srgbWindowAttribs;
}
fSurfaceAndroid = eglCreateWindowSurface(fDisplay, surfaceConfig, fNativeWindow, windowAttribs);
if (EGL_NO_SURFACE == fSurfaceAndroid && windowAttribs) {
// Try again without sRGB
fSurfaceAndroid = eglCreateWindowSurface(fDisplay, surfaceConfig, fNativeWindow, nullptr);
}
fSurfaceAndroid = eglCreateWindowSurface(fDisplay, surfaceConfig, fNativeWindow, nullptr);
SkASSERT(EGL_NO_SURFACE != fSurfaceAndroid);
SkAssertResult(eglMakeCurrent(fDisplay, fSurfaceAndroid, fSurfaceAndroid, fEGLContext));