| 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 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 GL_RENDERBUFFER, 0); | 526 GL_RENDERBUFFER, 0); |
| 527 gl->FramebufferRenderbuffer(target, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, | 527 gl->FramebufferRenderbuffer(target, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, |
| 528 0); | 528 0); |
| 529 gl->FramebufferRenderbuffer(target, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, | 529 gl->FramebufferRenderbuffer(target, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, |
| 530 0); | 530 0); |
| 531 } | 531 } |
| 532 } | 532 } |
| 533 | 533 |
| 534 GLenum WebGLFramebuffer::GetDrawBuffer(GLenum draw_buffer) { | 534 GLenum WebGLFramebuffer::GetDrawBuffer(GLenum draw_buffer) { |
| 535 int index = static_cast<int>(draw_buffer - GL_DRAW_BUFFER0_EXT); | 535 int index = static_cast<int>(draw_buffer - GL_DRAW_BUFFER0_EXT); |
| 536 ASSERT(index >= 0); | 536 DCHECK_GE(index, 0); |
| 537 if (index < static_cast<int>(draw_buffers_.size())) | 537 if (index < static_cast<int>(draw_buffers_.size())) |
| 538 return draw_buffers_[index]; | 538 return draw_buffers_[index]; |
| 539 if (draw_buffer == GL_DRAW_BUFFER0_EXT) | 539 if (draw_buffer == GL_DRAW_BUFFER0_EXT) |
| 540 return GL_COLOR_ATTACHMENT0; | 540 return GL_COLOR_ATTACHMENT0; |
| 541 return GL_NONE; | 541 return GL_NONE; |
| 542 } | 542 } |
| 543 | 543 |
| 544 DEFINE_TRACE(WebGLFramebuffer) { | 544 DEFINE_TRACE(WebGLFramebuffer) { |
| 545 visitor->Trace(attachments_); | 545 visitor->Trace(attachments_); |
| 546 WebGLContextObject::Trace(visitor); | 546 WebGLContextObject::Trace(visitor); |
| 547 } | 547 } |
| 548 | 548 |
| 549 DEFINE_TRACE_WRAPPERS(WebGLFramebuffer) { | 549 DEFINE_TRACE_WRAPPERS(WebGLFramebuffer) { |
| 550 for (const auto& attachment : attachments_) { | 550 for (const auto& attachment : attachments_) { |
| 551 visitor->TraceWrappers(attachment.value); | 551 visitor->TraceWrappers(attachment.value); |
| 552 } | 552 } |
| 553 WebGLContextObject::TraceWrappers(visitor); | 553 WebGLContextObject::TraceWrappers(visitor); |
| 554 } | 554 } |
| 555 | 555 |
| 556 } // namespace blink | 556 } // namespace blink |
| OLD | NEW |