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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 } | 494 } |
495 | 495 |
496 bool DrawingBuffer::resizeFramebuffer(const IntSize& size) | 496 bool DrawingBuffer::resizeFramebuffer(const IntSize& size) |
497 { | 497 { |
498 // resize regular FBO | 498 // resize regular FBO |
499 m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo); | 499 m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo); |
500 | 500 |
501 m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_colorBuffer); | 501 m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_colorBuffer); |
502 m_context->texImage2DResourceSafe(GraphicsContext3D::TEXTURE_2D, 0, m_intern
alColorFormat, size.width(), size.height(), 0, m_colorFormat, GraphicsContext3D:
:UNSIGNED_BYTE); | 502 m_context->texImage2DResourceSafe(GraphicsContext3D::TEXTURE_2D, 0, m_intern
alColorFormat, size.width(), size.height(), 0, m_colorFormat, GraphicsContext3D:
:UNSIGNED_BYTE); |
503 if (m_lastColorBuffer) | 503 if (m_lastColorBuffer) |
504 m_lastColorBuffer->size = m_size; | 504 m_lastColorBuffer->size = size; |
505 | 505 |
506 m_context->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsCont
ext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, m_colorBuffer, 0); | 506 m_context->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsCont
ext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, m_colorBuffer, 0); |
507 | 507 |
508 m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, 0); | 508 m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, 0); |
509 | 509 |
510 if (!multisample()) | 510 if (!multisample()) |
511 resizeDepthStencil(size, 0); | 511 resizeDepthStencil(size, 0); |
512 if (m_context->checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER) != Gra
phicsContext3D::FRAMEBUFFER_COMPLETE) | 512 if (m_context->checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER) != Gra
phicsContext3D::FRAMEBUFFER_COMPLETE) |
513 return false; | 513 return false; |
514 | 514 |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 | 752 |
753 void DrawingBuffer::bind() | 753 void DrawingBuffer::bind() |
754 { | 754 { |
755 if (!m_context) | 755 if (!m_context) |
756 return; | 756 return; |
757 | 757 |
758 m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO
? m_multisampleFBO : m_fbo); | 758 m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO
? m_multisampleFBO : m_fbo); |
759 } | 759 } |
760 | 760 |
761 } // namespace WebCore | 761 } // namespace WebCore |
OLD | NEW |