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

Side by Side 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, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 WebGLDepthTextureName, 52 WebGLDepthTextureName,
53 WebGLLoseContextName, 53 WebGLLoseContextName,
54 }; 54 };
55 55
56 void ref() { m_context->ref(); } 56 void ref() { m_context->ref(); }
57 void deref() { m_context->deref(); } 57 void deref() { m_context->deref(); }
58 WebGLRenderingContext* context() { return m_context; } 58 WebGLRenderingContext* context() { return m_context; }
59 59
60 virtual ~WebGLExtension(); 60 virtual ~WebGLExtension();
61 virtual ExtensionName getName() const = 0; 61 virtual ExtensionName getName() const = 0;
62 virtual void enable() = 0;
63
64 void restore()
Ken Russell (switch to Gerrit) 2013/06/05 00:46:38 Is a restore() method needed? As I understand it,
65 {
66 m_lost = false;
67 enable();
68 }
69
70 virtual void lose()
71 {
72 m_lost = true;
73 }
74
75 bool isLost()
76 {
77 return m_lost || m_context->isContextLost();
78 }
62 79
63 protected: 80 protected:
64 WebGLExtension(WebGLRenderingContext*); 81 WebGLExtension(WebGLRenderingContext*);
82
65 WebGLRenderingContext* m_context; 83 WebGLRenderingContext* m_context;
84 bool m_lost;
Ken Russell (switch to Gerrit) 2013/06/05 00:46:38 Should m_lost be private instead?
85
66 }; 86 };
67 87
68 } // namespace WebCore 88 } // namespace WebCore
69 89
70 #endif // WebGLExtension_h 90 #endif // WebGLExtension_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698