| 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 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 { | 665 { |
| 666 if (!m_depthStencilBuffer) | 666 if (!m_depthStencilBuffer) |
| 667 m_gl->GenRenderbuffers(1, &m_depthStencilBuffer); | 667 m_gl->GenRenderbuffers(1, &m_depthStencilBuffer); |
| 668 m_gl->BindRenderbuffer(GL_RENDERBUFFER, m_depthStencilBuffer); | 668 m_gl->BindRenderbuffer(GL_RENDERBUFFER, m_depthStencilBuffer); |
| 669 if (m_antiAliasingMode == MSAAImplicitResolve) | 669 if (m_antiAliasingMode == MSAAImplicitResolve) |
| 670 m_gl->RenderbufferStorageMultisampleEXT(GL_RENDERBUFFER, m_sampleCount,
GL_DEPTH24_STENCIL8_OES, size.width(), size.height()); | 670 m_gl->RenderbufferStorageMultisampleEXT(GL_RENDERBUFFER, m_sampleCount,
GL_DEPTH24_STENCIL8_OES, size.width(), size.height()); |
| 671 else if (m_antiAliasingMode == MSAAExplicitResolve) | 671 else if (m_antiAliasingMode == MSAAExplicitResolve) |
| 672 m_gl->RenderbufferStorageMultisampleCHROMIUM(GL_RENDERBUFFER, m_sampleCo
unt, GL_DEPTH24_STENCIL8_OES, size.width(), size.height()); | 672 m_gl->RenderbufferStorageMultisampleCHROMIUM(GL_RENDERBUFFER, m_sampleCo
unt, GL_DEPTH24_STENCIL8_OES, size.width(), size.height()); |
| 673 else | 673 else |
| 674 m_gl->RenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8_OES, size
.width(), size.height()); | 674 m_gl->RenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8_OES, size
.width(), size.height()); |
| 675 // For ES 2.0 contexts DEPTH_STENCIL is not available natively, so we emulat
e it |
| 676 // at the command buffer level for WebGL contexts. |
| 675 m_gl->FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, G
L_RENDERBUFFER, m_depthStencilBuffer); | 677 m_gl->FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, G
L_RENDERBUFFER, m_depthStencilBuffer); |
| 676 m_gl->BindRenderbuffer(GL_RENDERBUFFER, 0); | 678 m_gl->BindRenderbuffer(GL_RENDERBUFFER, 0); |
| 677 } | 679 } |
| 678 | 680 |
| 679 | 681 |
| 680 | 682 |
| 681 void DrawingBuffer::clearFramebuffers(GLbitfield clearMask) | 683 void DrawingBuffer::clearFramebuffers(GLbitfield clearMask) |
| 682 { | 684 { |
| 683 // We will clear the multisample FBO, but we also need to clear the non-mult
isampled buffer. | 685 // We will clear the multisample FBO, but we also need to clear the non-mult
isampled buffer. |
| 684 if (m_multisampleFBO) { | 686 if (m_multisampleFBO) { |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1001 | 1003 |
| 1002 if (m_antiAliasingMode == MSAAImplicitResolve) | 1004 if (m_antiAliasingMode == MSAAImplicitResolve) |
| 1003 m_gl->FramebufferTexture2DMultisampleEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACH
MENT0, target, m_colorBuffer.textureId, 0, m_sampleCount); | 1005 m_gl->FramebufferTexture2DMultisampleEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACH
MENT0, target, m_colorBuffer.textureId, 0, m_sampleCount); |
| 1004 else | 1006 else |
| 1005 m_gl->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, target,
m_colorBuffer.textureId, 0); | 1007 m_gl->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, target,
m_colorBuffer.textureId, 0); |
| 1006 | 1008 |
| 1007 m_gl->BindTexture(GL_TEXTURE_2D, m_texture2DBinding); | 1009 m_gl->BindTexture(GL_TEXTURE_2D, m_texture2DBinding); |
| 1008 } | 1010 } |
| 1009 | 1011 |
| 1010 } // namespace blink | 1012 } // namespace blink |
| OLD | NEW |