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

Unified Diff: webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc

Issue 11606012: cc: Unify context losing machinery (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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
Index: webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
diff --git a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
index d7ae282dc66a01a7dbbc9120c943596c3c627af3..b4b665a9faadfea446def688ad242f157d859ec3 100644
--- a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
+++ b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
@@ -144,6 +144,10 @@ class GLInProcessContext : public base::SupportsWeakPtr<GLInProcessContext> {
CommandBufferService* GetCommandBufferService();
+ void set_context_lost_reason(WGC3Denum reason) {
+ context_lost_reason_ = reason;
+ }
+
private:
explicit GLInProcessContext(GLInProcessContext* parent);
@@ -169,6 +173,7 @@ class GLInProcessContext : public base::SupportsWeakPtr<GLInProcessContext> {
scoped_ptr<TransferBuffer> transfer_buffer_;
scoped_ptr<GLES2Implementation> gles2_implementation_;
Error last_error_;
+ WGC3Denum context_lost_reason_;
DISALLOW_COPY_AND_ASSIGN(GLInProcessContext);
};
@@ -246,7 +251,8 @@ void GLInProcessContext::PumpCommands() {
decoder_->MakeCurrent();
gpu_scheduler_->PutChanged();
::gpu::CommandBuffer::State state = command_buffer_->GetState();
- CHECK(state.error == ::gpu::error::kNoError);
+ if (!context_lost_reason_)
+ CHECK(state.error == ::gpu::error::kNoError);
}
bool GLInProcessContext::GetBufferChanged(int32 transfer_buffer_id) {
@@ -1657,6 +1663,14 @@ WGC3Dboolean WebGraphicsContext3DInProcessCommandBufferImpl::
return gl_->UnmapBufferCHROMIUM(target);
}
+void WebGraphicsContext3DInProcessCommandBufferImpl::loseContextCHROMIUM(
+ WGC3Denum current, WGC3Denum other) {
+ ClearContext();
+ gl_->LoseContextCHROMIUM(current, other);
+ context_lost_reason_ = GL_UNKNOWN_CONTEXT_RESET_ARB;
+ context_->set_context_lost_reason(context_lost_reason_);
jamesr 2012/12/18 05:40:11 why do we need to store the context loss reason on
danakj 2012/12/18 21:26:59 Done.
+}
+
GrGLInterface* WebGraphicsContext3DInProcessCommandBufferImpl::
onCreateGrGLInterface() {
return CreateCommandBufferSkiaGLBinding();
« cc/thread_proxy.cc ('K') | « webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698