Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Unified Diff: Source/core/html/canvas/WebGLExtension.h

Issue 15876011: Make WebGL extensions get lost when context is lost. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/html/canvas/WebGLExtension.h
diff --git a/Source/core/html/canvas/WebGLExtension.h b/Source/core/html/canvas/WebGLExtension.h
index 6cef3af7c853dab86f5641e48b096c2ca9469e44..8fe34903d91d4092bcdf7627eb74f3dd0a2ac82d 100644
--- a/Source/core/html/canvas/WebGLExtension.h
+++ b/Source/core/html/canvas/WebGLExtension.h
@@ -59,10 +59,30 @@ public:
virtual ~WebGLExtension();
virtual ExtensionName getName() const = 0;
+ virtual void enable() = 0;
+
+ void restore()
Ken Russell (switch to Gerrit) 2013/06/05 00:46:38 Is a restore() method needed? As I understand it,
+ {
+ m_lost = false;
+ enable();
+ }
+
+ virtual void lose()
+ {
+ m_lost = true;
+ }
+
+ bool isLost()
+ {
+ return m_lost || m_context->isContextLost();
+ }
protected:
WebGLExtension(WebGLRenderingContext*);
+
WebGLRenderingContext* m_context;
+ bool m_lost;
Ken Russell (switch to Gerrit) 2013/06/05 00:46:38 Should m_lost be private instead?
+
};
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698