OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 m_antiAliasingMode = None; | 478 m_antiAliasingMode = None; |
479 if (useMultisampling) { | 479 if (useMultisampling) { |
480 m_gl->GetIntegerv(GL_MAX_SAMPLES_ANGLE, &maxSampleCount); | 480 m_gl->GetIntegerv(GL_MAX_SAMPLES_ANGLE, &maxSampleCount); |
481 m_antiAliasingMode = MSAAExplicitResolve; | 481 m_antiAliasingMode = MSAAExplicitResolve; |
482 if (m_extensionsUtil->supportsExtension("GL_EXT_multisampled_render_to_t
exture")) { | 482 if (m_extensionsUtil->supportsExtension("GL_EXT_multisampled_render_to_t
exture")) { |
483 m_antiAliasingMode = MSAAImplicitResolve; | 483 m_antiAliasingMode = MSAAImplicitResolve; |
484 } else if (m_extensionsUtil->supportsExtension("GL_CHROMIUM_screen_space
_antialiasing")) { | 484 } else if (m_extensionsUtil->supportsExtension("GL_CHROMIUM_screen_space
_antialiasing")) { |
485 m_antiAliasingMode = ScreenSpaceAntialiasing; | 485 m_antiAliasingMode = ScreenSpaceAntialiasing; |
486 } | 486 } |
487 } | 487 } |
488 m_storageTextureSupported = m_webGLVersion > WebGL1 || m_extensionsUtil->sup
portsExtension("GL_EXT_texture_storage"); | 488 // TODO(dshwang): enable storage texture on all platform. crbug.com/557848 |
| 489 // Linux ATI bot fails WebglConformance.conformance_textures_misc_tex_image_
webgl |
| 490 // So use storage texture only if ScreenSpaceAntialiasing is enabled, |
| 491 // because ScreenSpaceAntialiasing is much faster with storage texture. |
| 492 m_storageTextureSupported = (m_webGLVersion > WebGL1 |
| 493 || m_extensionsUtil->supportsExtension("GL_EXT_texture_storage")) |
| 494 && m_antiAliasingMode == ScreenSpaceAntialiasing; |
489 m_sampleCount = std::min(4, maxSampleCount); | 495 m_sampleCount = std::min(4, maxSampleCount); |
490 | 496 |
491 m_gl->GenFramebuffers(1, &m_fbo); | 497 m_gl->GenFramebuffers(1, &m_fbo); |
492 m_gl->BindFramebuffer(GL_FRAMEBUFFER, m_fbo); | 498 m_gl->BindFramebuffer(GL_FRAMEBUFFER, m_fbo); |
493 if (wantExplicitResolve()) { | 499 if (wantExplicitResolve()) { |
494 m_gl->GenFramebuffers(1, &m_multisampleFBO); | 500 m_gl->GenFramebuffers(1, &m_multisampleFBO); |
495 m_gl->BindFramebuffer(GL_FRAMEBUFFER, m_multisampleFBO); | 501 m_gl->BindFramebuffer(GL_FRAMEBUFFER, m_multisampleFBO); |
496 m_gl->GenRenderbuffers(1, &m_multisampleRenderbuffer); | 502 m_gl->GenRenderbuffers(1, &m_multisampleRenderbuffer); |
497 } | 503 } |
498 if (!reset(size)) | 504 if (!reset(size)) |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1116 | 1122 |
1117 void DrawingBuffer::restoreTextureBindings() | 1123 void DrawingBuffer::restoreTextureBindings() |
1118 { | 1124 { |
1119 // This class potentially modifies the bindings for GL_TEXTURE_2D and | 1125 // This class potentially modifies the bindings for GL_TEXTURE_2D and |
1120 // GL_TEXTURE_RECTANGLE. Only GL_TEXTURE_2D needs to be restored since | 1126 // GL_TEXTURE_RECTANGLE. Only GL_TEXTURE_2D needs to be restored since |
1121 // the public interface for WebGL does not support GL_TEXTURE_RECTANGLE. | 1127 // the public interface for WebGL does not support GL_TEXTURE_RECTANGLE. |
1122 m_gl->BindTexture(GL_TEXTURE_2D, m_texture2DBinding); | 1128 m_gl->BindTexture(GL_TEXTURE_2D, m_texture2DBinding); |
1123 } | 1129 } |
1124 | 1130 |
1125 } // namespace blink | 1131 } // namespace blink |
OLD | NEW |