Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: tools/viewer/sk_app/android/GLWindowContext_android.cpp

Issue 2072813002: Revert of Lots of progress switching to SkColorSpace rather than SkColorProfileType (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2016 Google Inc. 3 * Copyright 2016 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include <GLES/gl.h> 9 #include <GLES/gl.h>
10 10
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 // These values are the same as the corresponding VG colorspace attributes, 93 // These values are the same as the corresponding VG colorspace attributes,
94 // which were accepted starting in EGL 1.2. For some reason in 1.4, sRGB 94 // which were accepted starting in EGL 1.2. For some reason in 1.4, sRGB
95 // became hidden behind an extension, but it looks like devices aren't 95 // became hidden behind an extension, but it looks like devices aren't
96 // advertising that extension (including Nexus 5X). So just check version? 96 // advertising that extension (including Nexus 5X). So just check version?
97 const EGLint srgbWindowAttribs[] = { 97 const EGLint srgbWindowAttribs[] = {
98 /*EGL_GL_COLORSPACE_KHR*/ 0x309D, /*EGL_GL_COLORSPACE_SRGB_KHR*/ 0x3089, 98 /*EGL_GL_COLORSPACE_KHR*/ 0x309D, /*EGL_GL_COLORSPACE_SRGB_KHR*/ 0x3089,
99 EGL_NONE, 99 EGL_NONE,
100 }; 100 };
101 const EGLint* windowAttribs = nullptr; 101 const EGLint* windowAttribs = nullptr;
102 auto srgbColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); 102 if (kSRGB_SkColorProfileType == params.fProfileType && majorVersion == 1 && minorVersion >= 2) {
103 if (srgbColorSpace == params.fColorSpace && majorVersion == 1 && minorVersio n >= 2) {
104 windowAttribs = srgbWindowAttribs; 103 windowAttribs = srgbWindowAttribs;
105 } 104 }
106 105
107 fSurface = eglCreateWindowSurface(fDisplay, surfaceConfig, fNativeWindow, wi ndowAttribs); 106 fSurface = eglCreateWindowSurface(fDisplay, surfaceConfig, fNativeWindow, wi ndowAttribs);
108 if (EGL_NO_SURFACE == fSurface && windowAttribs) { 107 if (EGL_NO_SURFACE == fSurface && windowAttribs) {
109 // Try again without sRGB 108 // Try again without sRGB
110 fSurface = eglCreateWindowSurface(fDisplay, surfaceConfig, fNativeWindow , nullptr); 109 fSurface = eglCreateWindowSurface(fDisplay, surfaceConfig, fNativeWindow , nullptr);
111 } 110 }
112 SkASSERT(EGL_NO_SURFACE != fSurface); 111 SkASSERT(EGL_NO_SURFACE != fSurface);
113 112
(...skipping 26 matching lines...) Expand all
140 fSurface = EGL_NO_SURFACE; 139 fSurface = EGL_NO_SURFACE;
141 } 140 }
142 141
143 void GLWindowContext_android::onSwapBuffers() { 142 void GLWindowContext_android::onSwapBuffers() {
144 if (fDisplay && fEGLContext && fSurface) { 143 if (fDisplay && fEGLContext && fSurface) {
145 eglSwapBuffers(fDisplay, fSurface); 144 eglSwapBuffers(fDisplay, fSurface);
146 } 145 }
147 } 146 }
148 147
149 } 148 }
OLDNEW
« no previous file with comments | « tools/viewer/sk_app/WindowContext.cpp ('k') | tools/viewer/sk_app/android/RasterWindowContext_android.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698