| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 template <typename T> | 51 template <typename T> |
| 52 GLuint objectNonZero(const T* object) | 52 GLuint objectNonZero(const T* object) |
| 53 { | 53 { |
| 54 GLuint result = object->object(); | 54 GLuint result = object->object(); |
| 55 DCHECK(result); | 55 DCHECK(result); |
| 56 return result; | 56 return result; |
| 57 } | 57 } |
| 58 | 58 |
| 59 class WebGLObject : public GarbageCollectedFinalized<WebGLObject>, public Script
Wrappable { | 59 class WebGLObject : public GarbageCollectedFinalized<WebGLObject>, public Script
Wrappable { |
| 60 WTF_MAKE_NONCOPYABLE(WebGLObject); |
| 60 public: | 61 public: |
| 61 virtual ~WebGLObject(); | 62 virtual ~WebGLObject(); |
| 62 | 63 |
| 63 // deleteObject may not always delete the OpenGL resource. For programs and | 64 // deleteObject may not always delete the OpenGL resource. For programs and |
| 64 // shaders, deletion is delayed until they are no longer attached. | 65 // shaders, deletion is delayed until they are no longer attached. |
| 65 // FIXME: revisit this when resource sharing between contexts are implemente
d. | 66 // FIXME: revisit this when resource sharing between contexts are implemente
d. |
| 66 void deleteObject(gpu::gles2::GLES2Interface*); | 67 void deleteObject(gpu::gles2::GLES2Interface*); |
| 67 | 68 |
| 68 void onAttached() { ++m_attachmentCount; } | 69 void onAttached() { ++m_attachmentCount; } |
| 69 void onDetached(gpu::gles2::GLES2Interface*); | 70 void onDetached(gpu::gles2::GLES2Interface*); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 94 virtual gpu::gles2::GLES2Interface* getAGLInterface() const = 0; | 95 virtual gpu::gles2::GLES2Interface* getAGLInterface() const = 0; |
| 95 | 96 |
| 96 private: | 97 private: |
| 97 unsigned m_attachmentCount; | 98 unsigned m_attachmentCount; |
| 98 bool m_deleted; | 99 bool m_deleted; |
| 99 }; | 100 }; |
| 100 | 101 |
| 101 } // namespace blink | 102 } // namespace blink |
| 102 | 103 |
| 103 #endif // WebGLObject_h | 104 #endif // WebGLObject_h |
| OLD | NEW |