OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 | 8 |
9 #include "gl/GrGLInterface.h" | 9 #include "gl/GrGLInterface.h" |
10 #include "gl/GrGLExtensions.h" | 10 #include "gl/GrGLExtensions.h" |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 if (extensions.has("GL_EXT_framebuffer_blit") && | 329 if (extensions.has("GL_EXT_framebuffer_blit") && |
330 NULL == fBlitFramebuffer) { | 330 NULL == fBlitFramebuffer) { |
331 return false; | 331 return false; |
332 } | 332 } |
333 if (extensions.has("GL_EXT_framebuffer_multisample") && | 333 if (extensions.has("GL_EXT_framebuffer_multisample") && |
334 NULL == fRenderbufferStorageMultisample) { | 334 NULL == fRenderbufferStorageMultisample) { |
335 return false; | 335 return false; |
336 } | 336 } |
337 } | 337 } |
338 } else { | 338 } else { |
| 339 #if GR_GL_IGNORE_ES3_MSAA |
339 if (extensions.has("GL_CHROMIUM_framebuffer_multisample")) { | 340 if (extensions.has("GL_CHROMIUM_framebuffer_multisample")) { |
340 if (NULL == fRenderbufferStorageMultisample || | 341 if (NULL == fRenderbufferStorageMultisample || |
341 NULL == fBlitFramebuffer) { | 342 NULL == fBlitFramebuffer) { |
342 return false; | 343 return false; |
343 } | 344 } |
| 345 } else if (extensions.has("GL_APPLE_framebuffer_multisample")) { |
| 346 if (NULL == fRenderbufferStorageMultisample || |
| 347 NULL == fResolveMultisampleFramebuffer) { |
| 348 return false; |
| 349 } |
| 350 } else if (extensions.has("GL_IMG_multisampled_render_to_texture") || |
| 351 extensions.has("GL_EXT_multisampled_render_to_texture")) { |
| 352 if (NULL == fRenderbufferStorageMultisample || |
| 353 NULL == fFramebufferTexture2DMultisample) { |
| 354 return false; |
| 355 } |
| 356 } |
| 357 #else |
| 358 if (glVer >= GR_GL_VER(3,0) || extensions.has("GL_CHROMIUM_framebuffer_m
ultisample")) { |
| 359 if (NULL == fRenderbufferStorageMultisample || |
| 360 NULL == fBlitFramebuffer) { |
| 361 return false; |
| 362 } |
344 } | 363 } |
345 if (extensions.has("GL_APPLE_framebuffer_multisample")) { | 364 if (extensions.has("GL_APPLE_framebuffer_multisample")) { |
346 if (NULL == fRenderbufferStorageMultisample || | 365 if (NULL == fRenderbufferStorageMultisampleES2APPLE || |
347 NULL == fResolveMultisampleFramebuffer) { | 366 NULL == fResolveMultisampleFramebuffer) { |
348 return false; | 367 return false; |
349 } | 368 } |
350 } | 369 } |
351 if (extensions.has("GL_IMG_multisampled_render_to_texture") || | 370 if (extensions.has("GL_IMG_multisampled_render_to_texture") || |
352 extensions.has("GL_EXT_multisampled_render_to_texture")) { | 371 extensions.has("GL_EXT_multisampled_render_to_texture")) { |
353 if (NULL == fRenderbufferStorageMultisample || | 372 if (NULL == fRenderbufferStorageMultisampleES2EXT || |
354 NULL == fFramebufferTexture2DMultisample) { | 373 NULL == fFramebufferTexture2DMultisample) { |
355 return false; | 374 return false; |
356 } | 375 } |
357 } | 376 } |
| 377 #endif |
358 } | 378 } |
359 | 379 |
360 // On ES buffer mapping is an extension. On Desktop | 380 // On ES buffer mapping is an extension. On Desktop |
361 // buffer mapping was part of original VBO extension | 381 // buffer mapping was part of original VBO extension |
362 // which we require. | 382 // which we require. |
363 if (kDesktop_GrGLBinding == binding || extensions.has("GL_OES_mapbuffer")) { | 383 if (kDesktop_GrGLBinding == binding || extensions.has("GL_OES_mapbuffer")) { |
364 if (NULL == fMapBuffer || | 384 if (NULL == fMapBuffer || |
365 NULL == fUnmapBuffer) { | 385 NULL == fUnmapBuffer) { |
366 return false; | 386 return false; |
367 } | 387 } |
(...skipping 27 matching lines...) Expand all Loading... |
395 if (NULL == fBindVertexArray || | 415 if (NULL == fBindVertexArray || |
396 NULL == fDeleteVertexArrays || | 416 NULL == fDeleteVertexArrays || |
397 NULL == fGenVertexArrays) { | 417 NULL == fGenVertexArrays) { |
398 return false; | 418 return false; |
399 } | 419 } |
400 } | 420 } |
401 } | 421 } |
402 | 422 |
403 return true; | 423 return true; |
404 } | 424 } |
OLD | NEW |