| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google 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 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 OESTextureHalfFloatName, | 47 OESTextureHalfFloatName, |
| 48 OESVertexArrayObjectName, | 48 OESVertexArrayObjectName, |
| 49 WebGLCompressedTextureATCName, | 49 WebGLCompressedTextureATCName, |
| 50 WebGLCompressedTexturePVRTCName, | 50 WebGLCompressedTexturePVRTCName, |
| 51 WebGLCompressedTextureS3TCName, | 51 WebGLCompressedTextureS3TCName, |
| 52 WebGLDebugRendererInfoName, | 52 WebGLDebugRendererInfoName, |
| 53 WebGLDebugShadersName, | 53 WebGLDebugShadersName, |
| 54 WebGLDepthTextureName, | 54 WebGLDepthTextureName, |
| 55 WebGLDrawBuffersName, | 55 WebGLDrawBuffersName, |
| 56 WebGLLoseContextName, | 56 WebGLLoseContextName, |
| 57 WebGLSharedResourcesName, |
| 57 }; | 58 }; |
| 58 | 59 |
| 59 WebGLRenderingContext* context() { return m_context; } | 60 WebGLRenderingContext* context() { return m_context; } |
| 60 | 61 |
| 61 virtual ~WebGLExtension(); | 62 virtual ~WebGLExtension(); |
| 62 virtual ExtensionName getName() const = 0; | 63 virtual ExtensionName getName() const = 0; |
| 63 | 64 |
| 64 // Lose this extension. Passing true = force loss. Some extensions | 65 // Lose this extension. Passing true = force loss. Some extensions |
| 65 // like WEBGL_lose_context are not normally lost when the context | 66 // like WEBGL_lose_context are not normally lost when the context |
| 66 // is lost but must be lost when destroying their WebGLRenderingContext. | 67 // is lost but must be lost when destroying their WebGLRenderingContext. |
| 67 virtual void lose(bool) | 68 virtual void lose(bool) |
| 68 { | 69 { |
| 69 m_context = 0; | 70 m_context = 0; |
| 70 } | 71 } |
| 71 | 72 |
| 72 bool isLost() | 73 bool isLost() const |
| 73 { | 74 { |
| 74 return !m_context; | 75 return !m_context; |
| 75 } | 76 } |
| 76 | 77 |
| 77 protected: | 78 protected: |
| 78 WebGLExtension(WebGLRenderingContext*); | 79 WebGLExtension(WebGLRenderingContext*); |
| 79 | 80 |
| 80 WebGLRenderingContext* m_context; | 81 WebGLRenderingContext* m_context; |
| 81 }; | 82 }; |
| 82 | 83 |
| 83 } // namespace WebCore | 84 } // namespace WebCore |
| 84 | 85 |
| 85 #endif // WebGLExtension_h | 86 #endif // WebGLExtension_h |
| OLD | NEW |