| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 WebGLRenderbuffer::WebGLRenderbuffer(WebGLRenderingContextBase* ctx) | 55 WebGLRenderbuffer::WebGLRenderbuffer(WebGLRenderingContextBase* ctx) |
| 56 : WebGLSharedPlatform3DObject(ctx) | 56 : WebGLSharedPlatform3DObject(ctx) |
| 57 , m_internalFormat(GL_RGBA4) | 57 , m_internalFormat(GL_RGBA4) |
| 58 , m_width(0) | 58 , m_width(0) |
| 59 , m_height(0) | 59 , m_height(0) |
| 60 , m_hasEverBeenBound(false) | 60 , m_hasEverBeenBound(false) |
| 61 { | 61 { |
| 62 setObject(ctx->webContext()->createRenderbuffer()); | 62 setObject(ctx->webContext()->createRenderbuffer()); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void WebGLRenderbuffer::deleteObjectImpl(blink::WebGraphicsContext3D* context3d) | 65 void WebGLRenderbuffer::deleteObjectImpl(WebGraphicsContext3D* context3d) |
| 66 { | 66 { |
| 67 context3d->deleteRenderbuffer(m_object); | 67 context3d->deleteRenderbuffer(m_object); |
| 68 m_object = 0; | 68 m_object = 0; |
| 69 deleteEmulatedStencilBuffer(context3d); | 69 deleteEmulatedStencilBuffer(context3d); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void WebGLRenderbuffer::deleteEmulatedStencilBuffer(blink::WebGraphicsContext3D*
context3d) | 72 void WebGLRenderbuffer::deleteEmulatedStencilBuffer(WebGraphicsContext3D* contex
t3d) |
| 73 { | 73 { |
| 74 if (!m_emulatedStencilBuffer) | 74 if (!m_emulatedStencilBuffer) |
| 75 return; | 75 return; |
| 76 m_emulatedStencilBuffer->deleteObject(context3d); | 76 m_emulatedStencilBuffer->deleteObject(context3d); |
| 77 m_emulatedStencilBuffer.clear(); | 77 m_emulatedStencilBuffer.clear(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 DEFINE_TRACE(WebGLRenderbuffer) | 80 DEFINE_TRACE(WebGLRenderbuffer) |
| 81 { | 81 { |
| 82 visitor->trace(m_emulatedStencilBuffer); | 82 visitor->trace(m_emulatedStencilBuffer); |
| 83 WebGLSharedPlatform3DObject::trace(visitor); | 83 WebGLSharedPlatform3DObject::trace(visitor); |
| 84 } | 84 } |
| 85 | 85 |
| 86 } | 86 } // namespace blink |
| OLD | NEW |