| 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 21 matching lines...) Expand all Loading... |
| 32 namespace blink { | 32 namespace blink { |
| 33 | 33 |
| 34 WebGLBuffer* WebGLBuffer::create(WebGLRenderingContextBase* ctx) | 34 WebGLBuffer* WebGLBuffer::create(WebGLRenderingContextBase* ctx) |
| 35 { | 35 { |
| 36 return new WebGLBuffer(ctx); | 36 return new WebGLBuffer(ctx); |
| 37 } | 37 } |
| 38 | 38 |
| 39 WebGLBuffer::WebGLBuffer(WebGLRenderingContextBase* ctx) | 39 WebGLBuffer::WebGLBuffer(WebGLRenderingContextBase* ctx) |
| 40 : WebGLSharedPlatform3DObject(ctx) | 40 : WebGLSharedPlatform3DObject(ctx) |
| 41 , m_initialTarget(0) | 41 , m_initialTarget(0) |
| 42 , m_size(0) |
| 42 { | 43 { |
| 43 setObject(ctx->webContext()->createBuffer()); | 44 setObject(ctx->webContext()->createBuffer()); |
| 44 } | 45 } |
| 45 | 46 |
| 46 WebGLBuffer::~WebGLBuffer() | 47 WebGLBuffer::~WebGLBuffer() |
| 47 { | 48 { |
| 48 // See the comment in WebGLObject::detachAndDeleteObject(). | 49 // See the comment in WebGLObject::detachAndDeleteObject(). |
| 49 detachAndDeleteObject(); | 50 detachAndDeleteObject(); |
| 50 } | 51 } |
| 51 | 52 |
| 52 void WebGLBuffer::deleteObjectImpl(WebGraphicsContext3D* context3d) | 53 void WebGLBuffer::deleteObjectImpl(WebGraphicsContext3D* context3d) |
| 53 { | 54 { |
| 54 context3d->deleteBuffer(m_object); | 55 context3d->deleteBuffer(m_object); |
| 55 m_object = 0; | 56 m_object = 0; |
| 56 } | 57 } |
| 57 | 58 |
| 58 void WebGLBuffer::setInitialTarget(GLenum target) | 59 void WebGLBuffer::setInitialTarget(GLenum target) |
| 59 { | 60 { |
| 60 // WebGL restricts the ability to bind buffers to multiple targets based on | 61 // WebGL restricts the ability to bind buffers to multiple targets based on |
| 61 // it's initial bind point. | 62 // it's initial bind point. |
| 62 ASSERT(!m_initialTarget); | 63 ASSERT(!m_initialTarget); |
| 63 m_initialTarget = target; | 64 m_initialTarget = target; |
| 64 } | 65 } |
| 65 | 66 |
| 66 } // namespace blink | 67 } // namespace blink |
| OLD | NEW |