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); |