Index: gpu/command_buffer/service/in_process_command_buffer.cc |
diff --git a/gpu/command_buffer/service/in_process_command_buffer.cc b/gpu/command_buffer/service/in_process_command_buffer.cc |
index 010c0fbb16822eb503ce89765935a47ac2d2364e..8f6d97e43606339e42314bee694885b645711113 100644 |
--- a/gpu/command_buffer/service/in_process_command_buffer.cc |
+++ b/gpu/command_buffer/service/in_process_command_buffer.cc |
@@ -22,6 +22,7 @@ |
#include "base/sequence_checker.h" |
#include "base/single_thread_task_runner.h" |
#include "base/thread_task_runner_handle.h" |
+#include "gpu/command_buffer/client/gpu_control_client.h" |
#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" |
#include "gpu/command_buffer/common/sync_token.h" |
#include "gpu/command_buffer/common/value_state.h" |
@@ -264,12 +265,10 @@ bool InProcessCommandBuffer::Initialize( |
const gfx::Size& size, |
const std::vector<int32_t>& attribs, |
gfx::GpuPreference gpu_preference, |
- const base::Closure& context_lost_callback, |
InProcessCommandBuffer* share_group, |
GpuMemoryBufferManager* gpu_memory_buffer_manager, |
ImageFactory* image_factory) { |
DCHECK(!share_group || service_.get() == share_group->service_.get()); |
- context_lost_callback_ = WrapCallback(context_lost_callback); |
if (surface.get()) { |
// GPU thread must be the same as client thread due to GLSurface not being |
@@ -492,11 +491,10 @@ void InProcessCommandBuffer::CheckSequencedThread() { |
void InProcessCommandBuffer::OnContextLost() { |
CheckSequencedThread(); |
- if (!context_lost_callback_.is_null()) { |
- context_lost_callback_.Run(); |
- context_lost_callback_.Reset(); |
- } |
- |
+ if (context_lost_) |
+ return; |
+ DCHECK(gpu_control_client_); |
+ gpu_control_client_->OnGpuControlLostContext(); |
context_lost_ = true; |
} |
@@ -668,6 +666,10 @@ void InProcessCommandBuffer::DestroyTransferBufferOnGpuThread(int32_t id) { |
command_buffer_->DestroyTransferBuffer(id); |
} |
+void InProcessCommandBuffer::SetGpuControlClient(GpuControlClient* client) { |
+ gpu_control_client_ = client; |
+} |
+ |
gpu::Capabilities InProcessCommandBuffer::GetCapabilities() { |
return capabilities_; |
} |