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

Unified Diff: cc/program_binding.h

Issue 11415040: Relax assertions around context loss and program initialization. Higher level code will take care o… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « cc/gl_renderer.cc ('k') | cc/program_binding.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/program_binding.h
diff --git a/cc/program_binding.h b/cc/program_binding.h
index 5bcf7b998f9d7f5d5d7aee2b4e3ebf09b2387658..49afa5ddac50f9ec85b736b7906499d325cb3125 100644
--- a/cc/program_binding.h
+++ b/cc/program_binding.h
@@ -24,7 +24,7 @@ public:
void link(WebKit::WebGraphicsContext3D*);
void cleanup(WebKit::WebGraphicsContext3D*);
- unsigned program() const { DCHECK(m_initialized); return m_program; }
+ unsigned program() const { return m_program; }
bool initialized() const { return m_initialized; }
protected:
@@ -32,6 +32,7 @@ protected:
unsigned loadShader(WebKit::WebGraphicsContext3D*, unsigned type, const std::string& shaderSource);
unsigned createShaderProgram(WebKit::WebGraphicsContext3D*, unsigned vertexShader, unsigned fragmentShader);
void cleanupShaders(WebKit::WebGraphicsContext3D*);
+ bool IsContextLost(WebKit::WebGraphicsContext3D*);
unsigned m_program;
unsigned m_vertexShaderId;
@@ -50,9 +51,11 @@ public:
void initialize(WebKit::WebGraphicsContext3D* context, bool usingBindUniform)
{
DCHECK(context);
- DCHECK(m_program);
DCHECK(!m_initialized);
+ if (IsContextLost(context))
nduca 2012/11/17 17:02:50 Is this oen needed to sidestep a really hard case
Ken Russell (switch to Gerrit) 2012/11/17 20:23:42 I actually didn't try without it -- seemed best to
+ return;
+
// Need to bind uniforms before linking
if (!usingBindUniform)
link(context);
« no previous file with comments | « cc/gl_renderer.cc ('k') | cc/program_binding.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698