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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 | 269 |
270 PassRefPtr<WebGLFramebuffer> WebGLFramebuffer::create(WebGLRenderingContext* ctx
) | 270 PassRefPtr<WebGLFramebuffer> WebGLFramebuffer::create(WebGLRenderingContext* ctx
) |
271 { | 271 { |
272 return adoptRef(new WebGLFramebuffer(ctx)); | 272 return adoptRef(new WebGLFramebuffer(ctx)); |
273 } | 273 } |
274 | 274 |
275 WebGLFramebuffer::WebGLFramebuffer(WebGLRenderingContext* ctx) | 275 WebGLFramebuffer::WebGLFramebuffer(WebGLRenderingContext* ctx) |
276 : WebGLContextObject(ctx) | 276 : WebGLContextObject(ctx) |
277 , m_hasEverBeenBound(false) | 277 , m_hasEverBeenBound(false) |
278 { | 278 { |
| 279 ScriptWrappable::init(this); |
279 setObject(ctx->graphicsContext3D()->createFramebuffer()); | 280 setObject(ctx->graphicsContext3D()->createFramebuffer()); |
280 } | 281 } |
281 | 282 |
282 WebGLFramebuffer::~WebGLFramebuffer() | 283 WebGLFramebuffer::~WebGLFramebuffer() |
283 { | 284 { |
284 deleteObject(0); | 285 deleteObject(0); |
285 } | 286 } |
286 | 287 |
287 void WebGLFramebuffer::setAttachmentForBoundFramebuffer(GC3Denum attachment, GC3
Denum texTarget, WebGLTexture* texture, GC3Dint level) | 288 void WebGLFramebuffer::setAttachmentForBoundFramebuffer(GC3Denum attachment, GC3
Denum texTarget, WebGLTexture* texture, GC3Dint level) |
288 { | 289 { |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 int index = static_cast<int>(drawBuffer - Extensions3D::DRAW_BUFFER0_EXT); | 539 int index = static_cast<int>(drawBuffer - Extensions3D::DRAW_BUFFER0_EXT); |
539 ASSERT(index >= 0); | 540 ASSERT(index >= 0); |
540 if (index < static_cast<int>(m_drawBuffers.size())) | 541 if (index < static_cast<int>(m_drawBuffers.size())) |
541 return m_drawBuffers[index]; | 542 return m_drawBuffers[index]; |
542 if (drawBuffer == Extensions3D::DRAW_BUFFER0_EXT) | 543 if (drawBuffer == Extensions3D::DRAW_BUFFER0_EXT) |
543 return GraphicsContext3D::COLOR_ATTACHMENT0; | 544 return GraphicsContext3D::COLOR_ATTACHMENT0; |
544 return GraphicsContext3D::NONE; | 545 return GraphicsContext3D::NONE; |
545 } | 546 } |
546 | 547 |
547 } | 548 } |
OLD | NEW |