| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 // Lose this extension. Passing true = force loss. Some extensions | 59 // Lose this extension. Passing true = force loss. Some extensions |
| 60 // like WEBGL_lose_context are not normally lost when the context | 60 // like WEBGL_lose_context are not normally lost when the context |
| 61 // is lost but must be lost when destroying their WebGLRenderingContextBase. | 61 // is lost but must be lost when destroying their WebGLRenderingContextBase. |
| 62 virtual void lose(bool) { m_context = nullptr; } | 62 virtual void lose(bool) { m_context = nullptr; } |
| 63 | 63 |
| 64 bool isLost() { return !m_context; } | 64 bool isLost() { return !m_context; } |
| 65 | 65 |
| 66 DECLARE_VIRTUAL_TRACE(); | 66 DECLARE_VIRTUAL_TRACE(); |
| 67 | 67 |
| 68 // For use by V8 bindings only. | |
| 69 HTMLCanvasElement* canvas() const { | |
| 70 if (m_context) | |
| 71 return m_context->canvas(); | |
| 72 return nullptr; | |
| 73 } | |
| 74 | |
| 75 protected: | 68 protected: |
| 76 explicit WebGLExtension(WebGLRenderingContextBase*); | 69 explicit WebGLExtension(WebGLRenderingContextBase*); |
| 77 | 70 |
| 78 private: | 71 private: |
| 79 friend WebGLExtensionScopedContext; | 72 friend WebGLExtensionScopedContext; |
| 80 | 73 |
| 81 WeakMember<WebGLRenderingContextBase> m_context; | 74 WeakMember<WebGLRenderingContextBase> m_context; |
| 82 }; | 75 }; |
| 83 | 76 |
| 84 } // namespace blink | 77 } // namespace blink |
| 85 | 78 |
| 86 #endif // WebGLExtension_h | 79 #endif // WebGLExtension_h |
| OLD | NEW |