| 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 2501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2512 GLenum renderbuffertarget, | 2512 GLenum renderbuffertarget, |
| 2513 WebGLRenderbuffer* buffer) { | 2513 WebGLRenderbuffer* buffer) { |
| 2514 if (isContextLost() || !ValidateFramebufferFuncParameters( | 2514 if (isContextLost() || !ValidateFramebufferFuncParameters( |
| 2515 "framebufferRenderbuffer", target, attachment)) | 2515 "framebufferRenderbuffer", target, attachment)) |
| 2516 return; | 2516 return; |
| 2517 if (renderbuffertarget != GL_RENDERBUFFER) { | 2517 if (renderbuffertarget != GL_RENDERBUFFER) { |
| 2518 SynthesizeGLError(GL_INVALID_ENUM, "framebufferRenderbuffer", | 2518 SynthesizeGLError(GL_INVALID_ENUM, "framebufferRenderbuffer", |
| 2519 "invalid target"); | 2519 "invalid target"); |
| 2520 return; | 2520 return; |
| 2521 } | 2521 } |
| 2522 if (buffer && !buffer->Validate(ContextGroup(), this)) { | 2522 if (buffer && (!buffer->HasEverBeenBound() || |
| 2523 !buffer->Validate(ContextGroup(), this))) { |
| 2523 SynthesizeGLError(GL_INVALID_OPERATION, "framebufferRenderbuffer", | 2524 SynthesizeGLError(GL_INVALID_OPERATION, "framebufferRenderbuffer", |
| 2524 "no buffer or buffer not from this context"); | 2525 "buffer never bound or buffer not from this context"); |
| 2525 return; | 2526 return; |
| 2526 } | 2527 } |
| 2527 // Don't allow the default framebuffer to be mutated; all current | 2528 // Don't allow the default framebuffer to be mutated; all current |
| 2528 // implementations use an FBO internally in place of the default | 2529 // implementations use an FBO internally in place of the default |
| 2529 // FBO. | 2530 // FBO. |
| 2530 WebGLFramebuffer* framebuffer_binding = GetFramebufferBinding(target); | 2531 WebGLFramebuffer* framebuffer_binding = GetFramebufferBinding(target); |
| 2531 if (!framebuffer_binding || !framebuffer_binding->Object()) { | 2532 if (!framebuffer_binding || !framebuffer_binding->Object()) { |
| 2532 SynthesizeGLError(GL_INVALID_OPERATION, "framebufferRenderbuffer", | 2533 SynthesizeGLError(GL_INVALID_OPERATION, "framebufferRenderbuffer", |
| 2533 "no framebuffer bound"); | 2534 "no framebuffer bound"); |
| 2534 return; | 2535 return; |
| (...skipping 5248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7783 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( | 7784 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( |
| 7784 HTMLCanvasElementOrOffscreenCanvas& result) const { | 7785 HTMLCanvasElementOrOffscreenCanvas& result) const { |
| 7785 if (canvas()) { | 7786 if (canvas()) { |
| 7786 result.setHTMLCanvasElement(static_cast<HTMLCanvasElement*>(host())); | 7787 result.setHTMLCanvasElement(static_cast<HTMLCanvasElement*>(host())); |
| 7787 } else { | 7788 } else { |
| 7788 result.setOffscreenCanvas(static_cast<OffscreenCanvas*>(host())); | 7789 result.setOffscreenCanvas(static_cast<OffscreenCanvas*>(host())); |
| 7789 } | 7790 } |
| 7790 } | 7791 } |
| 7791 | 7792 |
| 7792 } // namespace blink | 7793 } // namespace blink |
| OLD | NEW |