| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 void WebGLFramebuffer::setAttachmentInternal(GLenum target, | 428 void WebGLFramebuffer::setAttachmentInternal(GLenum target, |
| 429 GLenum attachment, | 429 GLenum attachment, |
| 430 GLenum texTarget, | 430 GLenum texTarget, |
| 431 WebGLTexture* texture, | 431 WebGLTexture* texture, |
| 432 GLint level, | 432 GLint level, |
| 433 GLint layer) { | 433 GLint layer) { |
| 434 DCHECK(isBound(target)); | 434 DCHECK(isBound(target)); |
| 435 DCHECK(m_object); | 435 DCHECK(m_object); |
| 436 removeAttachmentInternal(target, attachment); | 436 removeAttachmentInternal(target, attachment); |
| 437 if (texture && texture->object()) { | 437 if (texture && texture->object()) { |
| 438 m_attachments.add( | 438 m_attachments.insert( |
| 439 attachment, TraceWrapperMember<WebGLAttachment>( | 439 attachment, TraceWrapperMember<WebGLAttachment>( |
| 440 this, WebGLTextureAttachment::create(texture, texTarget, | 440 this, WebGLTextureAttachment::create(texture, texTarget, |
| 441 level, layer))); | 441 level, layer))); |
| 442 drawBuffersIfNecessary(false); | 442 drawBuffersIfNecessary(false); |
| 443 texture->onAttached(); | 443 texture->onAttached(); |
| 444 } | 444 } |
| 445 } | 445 } |
| 446 | 446 |
| 447 void WebGLFramebuffer::setAttachmentInternal(GLenum target, | 447 void WebGLFramebuffer::setAttachmentInternal(GLenum target, |
| 448 GLenum attachment, | 448 GLenum attachment, |
| 449 WebGLRenderbuffer* renderbuffer) { | 449 WebGLRenderbuffer* renderbuffer) { |
| 450 DCHECK(isBound(target)); | 450 DCHECK(isBound(target)); |
| 451 DCHECK(m_object); | 451 DCHECK(m_object); |
| 452 removeAttachmentInternal(target, attachment); | 452 removeAttachmentInternal(target, attachment); |
| 453 if (renderbuffer && renderbuffer->object()) { | 453 if (renderbuffer && renderbuffer->object()) { |
| 454 m_attachments.add( | 454 m_attachments.insert( |
| 455 attachment, | 455 attachment, |
| 456 TraceWrapperMember<WebGLAttachment>( | 456 TraceWrapperMember<WebGLAttachment>( |
| 457 this, WebGLRenderbufferAttachment::create(renderbuffer))); | 457 this, WebGLRenderbufferAttachment::create(renderbuffer))); |
| 458 drawBuffersIfNecessary(false); | 458 drawBuffersIfNecessary(false); |
| 459 renderbuffer->onAttached(); | 459 renderbuffer->onAttached(); |
| 460 } | 460 } |
| 461 } | 461 } |
| 462 | 462 |
| 463 void WebGLFramebuffer::removeAttachmentInternal(GLenum target, | 463 void WebGLFramebuffer::removeAttachmentInternal(GLenum target, |
| 464 GLenum attachment) { | 464 GLenum attachment) { |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 } | 546 } |
| 547 | 547 |
| 548 DEFINE_TRACE_WRAPPERS(WebGLFramebuffer) { | 548 DEFINE_TRACE_WRAPPERS(WebGLFramebuffer) { |
| 549 for (const auto& attachment : m_attachments) { | 549 for (const auto& attachment : m_attachments) { |
| 550 visitor->traceWrappers(attachment.value); | 550 visitor->traceWrappers(attachment.value); |
| 551 } | 551 } |
| 552 WebGLContextObject::traceWrappers(visitor); | 552 WebGLContextObject::traceWrappers(visitor); |
| 553 } | 553 } |
| 554 | 554 |
| 555 } // namespace blink | 555 } // namespace blink |
| OLD | NEW |