aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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));