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

Side by Side Diff: ui/gl/gl_gl_api_implementation.cc

Issue 1959323002: sRGB transition is invalid when context is ES. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gl/gl_gl_api_implementation.h" 5 #include "ui/gl/gl_gl_api_implementation.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 gl_internal_format = GL_RGBA; 99 gl_internal_format = GL_RGBA;
100 break; 100 break;
101 case GL_RGB: 101 case GL_RGB:
102 gl_internal_format = GL_RGB; 102 gl_internal_format = GL_RGB;
103 break; 103 break;
104 default: 104 default:
105 break; 105 break;
106 } 106 }
107 } 107 }
108 108
109 if (gfx::g_version_info->IsAtLeastGL(2, 1) ||
110 gfx::g_version_info->IsAtLeastGLES(3, 0)) {
111 switch (internal_format) {
112 case GL_SRGB_EXT:
113 gl_internal_format = GL_SRGB8;
114 break;
115 case GL_SRGB_ALPHA_EXT:
116 gl_internal_format = GL_SRGB8_ALPHA8;
117 break;
118 default:
119 break;
120 }
121 }
122
109 if (gfx::g_version_info->is_es) 123 if (gfx::g_version_info->is_es)
xinghua.cao 2016/05/10 11:02:30 If driver context is es, it will return directly.
110 return gl_internal_format; 124 return gl_internal_format;
111 125
112 if (type == GL_FLOAT) { 126 if (type == GL_FLOAT) {
113 switch (internal_format) { 127 switch (internal_format) {
114 // We need to map all the unsized internal formats from ES2 clients. 128 // We need to map all the unsized internal formats from ES2 clients.
115 case GL_RGBA: 129 case GL_RGBA:
116 gl_internal_format = GL_RGBA32F_ARB; 130 gl_internal_format = GL_RGBA32F_ARB;
117 break; 131 break;
118 case GL_RGB: 132 case GL_RGB:
119 gl_internal_format = GL_RGB32F_ARB; 133 gl_internal_format = GL_RGB32F_ARB;
(...skipping 28 matching lines...) Expand all
148 break; 162 break;
149 case GL_ALPHA: 163 case GL_ALPHA:
150 gl_internal_format = GL_ALPHA16F_ARB; 164 gl_internal_format = GL_ALPHA16F_ARB;
151 break; 165 break;
152 default: 166 default:
153 NOTREACHED(); 167 NOTREACHED();
154 break; 168 break;
155 } 169 }
156 } 170 }
157 171
158 if (gfx::g_version_info->IsAtLeastGL(2, 1) ||
159 gfx::g_version_info->IsAtLeastGLES(3, 0)) {
160 switch (internal_format) {
161 case GL_SRGB_EXT:
162 gl_internal_format = GL_SRGB8;
163 break;
164 case GL_SRGB_ALPHA_EXT:
165 gl_internal_format = GL_SRGB8_ALPHA8;
166 break;
167 default:
168 break;
169 }
170 }
171
172 return gl_internal_format; 172 return gl_internal_format;
173 } 173 }
174 174
175 static inline GLenum GetTexFormat(GLenum format) { 175 static inline GLenum GetTexFormat(GLenum format) {
176 GLenum gl_format = format; 176 GLenum gl_format = format;
177 177
178 DCHECK(gfx::g_version_info); 178 DCHECK(gfx::g_version_info);
179 if (gfx::g_version_info->IsAtLeastGL(2, 1) || 179 if (gfx::g_version_info->IsAtLeastGL(2, 1) ||
180 gfx::g_version_info->IsAtLeastGLES(3, 0)) { 180 gfx::g_version_info->IsAtLeastGLES(3, 0)) {
181 switch (format) { 181 switch (format) {
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 666
667 void VirtualGLApi::glFlushFn() { 667 void VirtualGLApi::glFlushFn() {
668 GLApiBase::glFlushFn(); 668 GLApiBase::glFlushFn();
669 } 669 }
670 670
671 void VirtualGLApi::glFinishFn() { 671 void VirtualGLApi::glFinishFn() {
672 GLApiBase::glFinishFn(); 672 GLApiBase::glFinishFn();
673 } 673 }
674 674
675 } // namespace gfx 675 } // namespace gfx
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698