aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2018-07-09 10:23:19 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-09 15:22:17 +0000
commit294fe295818df9c5adc32d4b0765ebff843f1539 (patch)
tree4531fa6446f81cb2c0dcb4f647779f2ba479d116 /tools
parent9c7f7f22d2e04bcb141ab433c3fdc5b7bfdfb378 (diff)
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>
Diffstat (limited to 'tools')
-rw-r--r--tools/sk_app/GLWindowContext.cpp11
-rw-r--r--tools/sk_app/VulkanWindowContext.cpp2
-rw-r--r--tools/sk_app/android/GLWindowContext_android.cpp20
3 files changed, 6 insertions, 27 deletions
diff --git a/tools/sk_app/GLWindowContext.cpp b/tools/sk_app/GLWindowContext.cpp
index b6a8df9105..5bcc759dab 100644
--- a/tools/sk_app/GLWindowContext.cpp
+++ b/tools/sk_app/GLWindowContext.cpp
@@ -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,
diff --git a/tools/sk_app/VulkanWindowContext.cpp b/tools/sk_app/VulkanWindowContext.cpp
index ad0e15ca7b..2f00add92c 100644
--- a/tools/sk_app/VulkanWindowContext.cpp
+++ b/tools/sk_app/VulkanWindowContext.cpp
@@ -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) {
diff --git a/tools/sk_app/android/GLWindowContext_android.cpp b/tools/sk_app/android/GLWindowContext_android.cpp
index 5111114115..bdab7dabf0 100644
--- a/tools/sk_app/android/GLWindowContext_android.cpp
+++ b/tools/sk_app/android/GLWindowContext_android.cpp
@@ -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));