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 28 matching lines...) Expand all Loading... |
39 | 39 |
40 class WebGLContextGroup; | 40 class WebGLContextGroup; |
41 class WebGLRenderingContextBase; | 41 class WebGLRenderingContextBase; |
42 | 42 |
43 template <typename T> | 43 template <typename T> |
44 Platform3DObject objectOrZero(const T* object) | 44 Platform3DObject objectOrZero(const T* object) |
45 { | 45 { |
46 return object ? object->object() : 0; | 46 return object ? object->object() : 0; |
47 } | 47 } |
48 | 48 |
49 class WebGLObject : public RefCountedWillBeGarbageCollectedFinalized<WebGLObject
>, public ScriptWrappable { | 49 class WebGLObject : public GarbageCollectedFinalized<WebGLObject>, public Script
Wrappable { |
50 public: | 50 public: |
51 virtual ~WebGLObject(); | 51 virtual ~WebGLObject(); |
52 | 52 |
53 // deleteObject may not always delete the OpenGL resource. For programs and | 53 // deleteObject may not always delete the OpenGL resource. For programs and |
54 // shaders, deletion is delayed until they are no longer attached. | 54 // shaders, deletion is delayed until they are no longer attached. |
55 // FIXME: revisit this when resource sharing between contexts are implemente
d. | 55 // FIXME: revisit this when resource sharing between contexts are implemente
d. |
56 void deleteObject(WebGraphicsContext3D*); | 56 void deleteObject(WebGraphicsContext3D*); |
57 | 57 |
58 void onAttached() { ++m_attachmentCount; } | 58 void onAttached() { ++m_attachmentCount; } |
59 void onDetached(WebGraphicsContext3D*); | 59 void onDetached(WebGraphicsContext3D*); |
(...skipping 24 matching lines...) Expand all Loading... |
84 virtual WebGraphicsContext3D* getAWebGraphicsContext3D() const = 0; | 84 virtual WebGraphicsContext3D* getAWebGraphicsContext3D() const = 0; |
85 | 85 |
86 private: | 86 private: |
87 unsigned m_attachmentCount; | 87 unsigned m_attachmentCount; |
88 bool m_deleted; | 88 bool m_deleted; |
89 }; | 89 }; |
90 | 90 |
91 } // namespace blink | 91 } // namespace blink |
92 | 92 |
93 #endif // WebGLObject_h | 93 #endif // WebGLObject_h |
OLD | NEW |