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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 } | 461 } |
462 | 462 |
463 void WebGLFramebuffer::removeAttachmentInternal(GLenum target, | 463 void WebGLFramebuffer::removeAttachmentInternal(GLenum target, |
464 GLenum attachment) { | 464 GLenum attachment) { |
465 DCHECK(isBound(target)); | 465 DCHECK(isBound(target)); |
466 DCHECK(m_object); | 466 DCHECK(m_object); |
467 | 467 |
468 WebGLAttachment* attachmentObject = getAttachment(attachment); | 468 WebGLAttachment* attachmentObject = getAttachment(attachment); |
469 if (attachmentObject) { | 469 if (attachmentObject) { |
470 attachmentObject->onDetached(context()->contextGL()); | 470 attachmentObject->onDetached(context()->contextGL()); |
471 m_attachments.remove(attachment); | 471 m_attachments.erase(attachment); |
472 drawBuffersIfNecessary(false); | 472 drawBuffersIfNecessary(false); |
473 } | 473 } |
474 } | 474 } |
475 | 475 |
476 void WebGLFramebuffer::commitWebGL1DepthStencilIfConsistent(GLenum target) { | 476 void WebGLFramebuffer::commitWebGL1DepthStencilIfConsistent(GLenum target) { |
477 DCHECK(!context()->isWebGL2OrHigher()); | 477 DCHECK(!context()->isWebGL2OrHigher()); |
478 WebGLAttachment* depthAttachment = nullptr; | 478 WebGLAttachment* depthAttachment = nullptr; |
479 WebGLAttachment* stencilAttachment = nullptr; | 479 WebGLAttachment* stencilAttachment = nullptr; |
480 WebGLAttachment* depthStencilAttachment = nullptr; | 480 WebGLAttachment* depthStencilAttachment = nullptr; |
481 int count = 0; | 481 int count = 0; |
(...skipping 64 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 |