Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 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 18 matching lines...) Expand all Loading... | |
| 29 #include "modules/webgl/WebGLObject.h" | 29 #include "modules/webgl/WebGLObject.h" |
| 30 | 30 |
| 31 namespace blink { | 31 namespace blink { |
| 32 | 32 |
| 33 class WebGLRenderingContextBase; | 33 class WebGLRenderingContextBase; |
| 34 | 34 |
| 35 // WebGLContextObject the base class for objects that are owned by a specific | 35 // WebGLContextObject the base class for objects that are owned by a specific |
| 36 // WebGLRenderingContextBase. | 36 // WebGLRenderingContextBase. |
| 37 class WebGLContextObject : public WebGLObject { | 37 class WebGLContextObject : public WebGLObject { |
| 38 public: | 38 public: |
| 39 ~WebGLContextObject() override; | |
| 40 | |
| 41 WebGLRenderingContextBase* context() const { return m_context; } | 39 WebGLRenderingContextBase* context() const { return m_context; } |
| 42 | 40 |
| 43 bool validate(const WebGLContextGroup*, | 41 bool validate(const WebGLContextGroup*, |
| 44 const WebGLRenderingContextBase* context) const final { | 42 const WebGLRenderingContextBase* context) const final { |
| 45 return context == m_context; | 43 return context == m_context; |
|
Zhenyao Mo
2016/12/02 18:58:39
Do we also want to check the numberOfContextLosses
Ken Russell (switch to Gerrit)
2016/12/02 22:13:38
Sorry, forgot to reply to your comment. Yes, thank
| |
| 46 } | 44 } |
| 47 | 45 |
| 48 void detachContext(); | |
| 49 | |
| 50 DECLARE_VIRTUAL_TRACE(); | 46 DECLARE_VIRTUAL_TRACE(); |
| 51 | 47 |
| 52 protected: | 48 protected: |
| 53 explicit WebGLContextObject(WebGLRenderingContextBase*); | 49 explicit WebGLContextObject(WebGLRenderingContextBase*); |
| 54 | 50 |
| 55 bool hasGroupOrContext() const final { return m_context; } | 51 bool hasGroupOrContext() const final { return m_context; } |
| 56 | 52 |
| 53 uint32_t currentNumberOfContextLosses() const final; | |
| 54 | |
| 57 gpu::gles2::GLES2Interface* getAGLInterface() const final; | 55 gpu::gles2::GLES2Interface* getAGLInterface() const final; |
| 58 | 56 |
| 59 private: | 57 private: |
| 60 Member<WebGLRenderingContextBase> m_context; | 58 Member<WebGLRenderingContextBase> m_context; |
| 61 }; | 59 }; |
| 62 | 60 |
| 63 } // namespace blink | 61 } // namespace blink |
| 64 | 62 |
| 65 #endif // WebGLContextObject_h | 63 #endif // WebGLContextObject_h |
| OLD | NEW |