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 10 matching lines...) Expand all Loading... |
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef WebGLBuffer_h | 26 #ifndef WebGLBuffer_h |
27 #define WebGLBuffer_h | 27 #define WebGLBuffer_h |
28 | 28 |
29 #include "bindings/v8/ScriptWrappable.h" | 29 #include "bindings/v8/ScriptWrappable.h" |
30 #include "core/html/canvas/WebGLSharedObject.h" | 30 #include "core/html/canvas/WebGLSharedObject.h" |
31 #include "wtf/ArrayBuffer.h" | |
32 #include "wtf/Forward.h" | 31 #include "wtf/Forward.h" |
33 #include "wtf/PassRefPtr.h" | 32 #include "wtf/PassRefPtr.h" |
34 #include "wtf/RefCounted.h" | |
35 | 33 |
36 namespace WebCore { | 34 namespace WebCore { |
37 | 35 |
38 class WebGLBuffer : public WebGLSharedObject, public ScriptWrappable { | 36 class WebGLBuffer : public WebGLSharedObject, public ScriptWrappable { |
39 public: | 37 public: |
40 virtual ~WebGLBuffer(); | 38 virtual ~WebGLBuffer(); |
41 | 39 |
42 static PassRefPtr<WebGLBuffer> create(WebGLRenderingContext*); | 40 static PassRefPtr<WebGLBuffer> create(WebGLRenderingContext*); |
43 | 41 |
44 GC3Denum getTarget() const { return m_target; } | 42 GC3Denum getTarget() const { return m_target; } |
45 void setTarget(GC3Denum); | 43 void setTarget(GC3Denum); |
46 | 44 |
47 bool hasEverBeenBound() const { return object() && m_target; } | 45 bool hasEverBeenBound() const { return object() && m_target; } |
48 | 46 |
49 protected: | 47 protected: |
50 WebGLBuffer(WebGLRenderingContext*); | 48 WebGLBuffer(WebGLRenderingContext*); |
51 | 49 |
52 virtual void deleteObjectImpl(GraphicsContext3D*, Platform3DObject); | 50 virtual void deleteObjectImpl(GraphicsContext3D*, Platform3DObject); |
53 | 51 |
54 private: | 52 private: |
55 virtual bool isBuffer() const { return true; } | 53 virtual bool isBuffer() const { return true; } |
56 | 54 |
57 GC3Denum m_target; | 55 GC3Denum m_target; |
58 }; | 56 }; |
59 | 57 |
60 } // namespace WebCore | 58 } // namespace WebCore |
61 | 59 |
62 #endif // WebGLBuffer_h | 60 #endif // WebGLBuffer_h |
OLD | NEW |