| 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 256 |
| 257 PassRefPtr<WebGLFramebuffer> WebGLFramebuffer::create(WebGLRenderingContextBase*
ctx) | 257 PassRefPtr<WebGLFramebuffer> WebGLFramebuffer::create(WebGLRenderingContextBase*
ctx) |
| 258 { | 258 { |
| 259 return adoptRef(new WebGLFramebuffer(ctx)); | 259 return adoptRef(new WebGLFramebuffer(ctx)); |
| 260 } | 260 } |
| 261 | 261 |
| 262 WebGLFramebuffer::WebGLFramebuffer(WebGLRenderingContextBase* ctx) | 262 WebGLFramebuffer::WebGLFramebuffer(WebGLRenderingContextBase* ctx) |
| 263 : WebGLContextObject(ctx) | 263 : WebGLContextObject(ctx) |
| 264 , m_hasEverBeenBound(false) | 264 , m_hasEverBeenBound(false) |
| 265 { | 265 { |
| 266 ScriptWrappable::init(this); | |
| 267 setObject(ctx->webContext()->createFramebuffer()); | 266 setObject(ctx->webContext()->createFramebuffer()); |
| 268 } | 267 } |
| 269 | 268 |
| 270 WebGLFramebuffer::~WebGLFramebuffer() | 269 WebGLFramebuffer::~WebGLFramebuffer() |
| 271 { | 270 { |
| 272 // Delete the platform framebuffer resource. Explicit detachment | 271 // Delete the platform framebuffer resource. Explicit detachment |
| 273 // is for the benefit of Oilpan, where the framebuffer object | 272 // is for the benefit of Oilpan, where the framebuffer object |
| 274 // isn't detached when it and the WebGLRenderingContextBase object | 273 // isn't detached when it and the WebGLRenderingContextBase object |
| 275 // it is registered with are both finalized. Without Oilpan, the | 274 // it is registered with are both finalized. Without Oilpan, the |
| 276 // object will have been detached. | 275 // object will have been detached. |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 int index = static_cast<int>(drawBuffer - GL_DRAW_BUFFER0_EXT); | 606 int index = static_cast<int>(drawBuffer - GL_DRAW_BUFFER0_EXT); |
| 608 ASSERT(index >= 0); | 607 ASSERT(index >= 0); |
| 609 if (index < static_cast<int>(m_drawBuffers.size())) | 608 if (index < static_cast<int>(m_drawBuffers.size())) |
| 610 return m_drawBuffers[index]; | 609 return m_drawBuffers[index]; |
| 611 if (drawBuffer == GL_DRAW_BUFFER0_EXT) | 610 if (drawBuffer == GL_DRAW_BUFFER0_EXT) |
| 612 return GL_COLOR_ATTACHMENT0; | 611 return GL_COLOR_ATTACHMENT0; |
| 613 return GL_NONE; | 612 return GL_NONE; |
| 614 } | 613 } |
| 615 | 614 |
| 616 } | 615 } |
| OLD | NEW |