Index: content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc |
diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc |
index ea5f90d78151db78e0026a1ef679b03d66b1bf18..c1bad826b02c4dac2cf189b841d1c596086baf2a 100644 |
--- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc |
+++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc |
@@ -64,6 +64,7 @@ WebGraphicsContext3DCommandBufferImpl::WebGraphicsContext3DCommandBufferImpl( |
gpu_preference_(gfx::PreferIntegratedGpu), |
cached_width_(0), |
cached_height_(0), |
+ dead_(false), |
bound_fbo_(0), |
weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
} |
@@ -263,6 +264,11 @@ int WebGraphicsContext3DCommandBufferImpl::height() { |
return cached_height_; |
} |
+void WebGraphicsContext3DCommandBufferImpl::playDead() { |
+ dead_ = true; |
+ OnContextLost(ContentGLContext::kInnocent); |
+} |
+ |
bool WebGraphicsContext3DCommandBufferImpl::isGLES2Compliant() { |
return true; |
} |
@@ -757,7 +763,7 @@ WGC3Denum WebGraphicsContext3DCommandBufferImpl::getError() { |
} |
bool WebGraphicsContext3DCommandBufferImpl::isContextLost() { |
- return initialize_failed_ || |
+ return dead_ || initialize_failed_ || |
(context_ && context_->IsCommandBufferContextLost()) || |
context_lost_reason_ != GL_NO_ERROR; |
} |
@@ -1150,8 +1156,8 @@ void WebGraphicsContext3DCommandBufferImpl::setContextLostCallback( |
} |
WGC3Denum WebGraphicsContext3DCommandBufferImpl::getGraphicsResetStatusARB() { |
- if (context_->IsCommandBufferContextLost() && |
- context_lost_reason_ == GL_NO_ERROR) { |
+ if (dead_ || (context_->IsCommandBufferContextLost() && |
+ context_lost_reason_ == GL_NO_ERROR)) { |
return GL_UNKNOWN_CONTEXT_RESET_ARB; |
} |
@@ -1196,6 +1202,7 @@ WGC3Denum convertReason(ContentGLContext::ContextLostReason reason) { |
void WebGraphicsContext3DCommandBufferImpl::OnContextLost( |
ContentGLContext::ContextLostReason reason) { |
+ |
context_lost_reason_ = convertReason(reason); |
if (context_lost_callback_) { |
context_lost_callback_->onContextLost(); |