Index: content/common/gpu/client/context_provider_command_buffer.cc |
diff --git a/content/common/gpu/client/context_provider_command_buffer.cc b/content/common/gpu/client/context_provider_command_buffer.cc |
index 198fefc7f8d0cd02780c9f86733bcd0cd03b1ad3..439e14f4fc1e49a9f57be80f56e5da5e9cec1cbd 100644 |
--- a/content/common/gpu/client/context_provider_command_buffer.cc |
+++ b/content/common/gpu/client/context_provider_command_buffer.cc |
@@ -11,6 +11,7 @@ |
#include "base/strings/stringprintf.h" |
#include "cc/output/managed_memory_policy.h" |
#include "gpu/command_buffer/client/gles2_implementation.h" |
+#include "third_party/skia/include/gpu/GrContext.h" |
#include "webkit/common/gpu/grcontext_for_webgraphicscontext3d.h" |
namespace content { |
@@ -133,6 +134,11 @@ class GrContext* ContextProviderCommandBuffer::GrContext() { |
gr_context_.reset( |
new webkit::gpu::GrContextForWebGraphicsContext3D(context3d_.get())); |
+ |
+ // If GlContext is already lost, also abandon the new GrContext. |
+ if (IsContextLost()) |
+ gr_context_->get()->abandonContext(); |
+ |
return gr_context_->get(); |
} |