OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <set> | 5 #include <set> |
6 #include <string> | 6 #include <string> |
7 #include "app/gfx/gl/gl_implementation.h" | 7 #include "app/gfx/gl/gl_implementation.h" |
8 #include "gpu/command_buffer/service/feature_info.h" | 8 #include "gpu/command_buffer/service/feature_info.h" |
9 #include "gpu/command_buffer/service/gl_utils.h" | 9 #include "gpu/command_buffer/service/gl_utils.h" |
10 #include "gpu/GLES2/gles2_command_buffer.h" | 10 #include "gpu/GLES2/gles2_command_buffer.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 AddExtensionString("GL_EXT_texture_format_BGRA8888"); | 197 AddExtensionString("GL_EXT_texture_format_BGRA8888"); |
198 validators_.texture_internal_format.AddValue(GL_BGRA_EXT); | 198 validators_.texture_internal_format.AddValue(GL_BGRA_EXT); |
199 validators_.texture_format.AddValue(GL_BGRA_EXT); | 199 validators_.texture_format.AddValue(GL_BGRA_EXT); |
200 } | 200 } |
201 | 201 |
202 if (enable_read_format_bgra) { | 202 if (enable_read_format_bgra) { |
203 AddExtensionString("GL_EXT_read_format_bgra"); | 203 AddExtensionString("GL_EXT_read_format_bgra"); |
204 validators_.read_pixel_format.AddValue(GL_BGRA_EXT); | 204 validators_.read_pixel_format.AddValue(GL_BGRA_EXT); |
205 } | 205 } |
206 | 206 |
| 207 if (ext.Desire("GL_OES_rgb8_rgba8")) { |
| 208 if (ext.Have("GL_OES_rgb8_rgba8") || |
| 209 gfx::GetGLImplementation() == gfx::kGLImplementationDesktopGL) { |
| 210 AddExtensionString("GL_OES_rgb8_rgba8"); |
| 211 validators_.render_buffer_format.AddValue(GL_RGB8_OES); |
| 212 validators_.render_buffer_format.AddValue(GL_RGBA8_OES); |
| 213 } |
| 214 } |
| 215 |
207 // Check if we should allow GL_OES_texture_npot | 216 // Check if we should allow GL_OES_texture_npot |
208 if (ext.Desire("GL_OES_texture_npot") && | 217 if (ext.Desire("GL_OES_texture_npot") && |
209 (ext.Have("GL_ARB_texture_non_power_of_two") || | 218 (ext.Have("GL_ARB_texture_non_power_of_two") || |
210 ext.Have("GL_OES_texture_npot"))) { | 219 ext.Have("GL_OES_texture_npot"))) { |
211 AddExtensionString("GL_OES_texture_npot"); | 220 AddExtensionString("GL_OES_texture_npot"); |
212 npot_ok = true; | 221 npot_ok = true; |
213 } | 222 } |
214 | 223 |
215 // Check if we should allow GL_OES_texture_float, GL_OES_texture_half_float, | 224 // Check if we should allow GL_OES_texture_float, GL_OES_texture_half_float, |
216 // GL_OES_texture_float_linear, GL_OES_texture_half_float_linear | 225 // GL_OES_texture_float_linear, GL_OES_texture_half_float_linear |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 } | 275 } |
267 | 276 |
268 // Check for multisample support | 277 // Check for multisample support |
269 if (ext.Desire("GL_CHROMIUM_framebuffer_multisample") && | 278 if (ext.Desire("GL_CHROMIUM_framebuffer_multisample") && |
270 (ext.Have("GL_EXT_framebuffer_multisample") || | 279 (ext.Have("GL_EXT_framebuffer_multisample") || |
271 ext.Have("GL_ANGLE_framebuffer_multisample"))) { | 280 ext.Have("GL_ANGLE_framebuffer_multisample"))) { |
272 feature_flags_.chromium_framebuffer_multisample = true; | 281 feature_flags_.chromium_framebuffer_multisample = true; |
273 validators_.frame_buffer_target.AddValue(GL_READ_FRAMEBUFFER_EXT); | 282 validators_.frame_buffer_target.AddValue(GL_READ_FRAMEBUFFER_EXT); |
274 validators_.frame_buffer_target.AddValue(GL_DRAW_FRAMEBUFFER_EXT); | 283 validators_.frame_buffer_target.AddValue(GL_DRAW_FRAMEBUFFER_EXT); |
275 validators_.g_l_state.AddValue(GL_READ_FRAMEBUFFER_BINDING_EXT); | 284 validators_.g_l_state.AddValue(GL_READ_FRAMEBUFFER_BINDING_EXT); |
276 validators_.render_buffer_parameter.AddValue(GL_MAX_SAMPLES_EXT); | 285 validators_.g_l_state.AddValue(GL_MAX_SAMPLES_EXT); |
| 286 validators_.render_buffer_parameter.AddValue(GL_RENDERBUFFER_SAMPLES_EXT); |
277 AddExtensionString("GL_CHROMIUM_framebuffer_multisample"); | 287 AddExtensionString("GL_CHROMIUM_framebuffer_multisample"); |
278 } | 288 } |
279 | 289 |
280 if (ext.HaveAndDesire("GL_OES_depth24") || | 290 if (ext.HaveAndDesire("GL_OES_depth24") || |
281 (gfx::GetGLImplementation() == gfx::kGLImplementationDesktopGL && | 291 (gfx::GetGLImplementation() == gfx::kGLImplementationDesktopGL && |
282 ext.Desire("GL_OES_depth24"))) { | 292 ext.Desire("GL_OES_depth24"))) { |
283 AddExtensionString("GL_OES_depth24"); | 293 AddExtensionString("GL_OES_depth24"); |
284 validators_.render_buffer_format.AddValue(GL_DEPTH_COMPONENT24); | 294 validators_.render_buffer_format.AddValue(GL_DEPTH_COMPONENT24); |
285 } | 295 } |
286 | 296 |
(...skipping 20 matching lines...) Expand all Loading... |
307 if (extensions_.find(str) == std::string::npos) { | 317 if (extensions_.find(str) == std::string::npos) { |
308 extensions_ += (extensions_.empty() ? "" : " ") + str; | 318 extensions_ += (extensions_.empty() ? "" : " ") + str; |
309 } | 319 } |
310 } | 320 } |
311 | 321 |
312 } // namespace gles2 | 322 } // namespace gles2 |
313 } // namespace gpu | 323 } // namespace gpu |
314 | 324 |
315 | 325 |
316 | 326 |
OLD | NEW |