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

Unified Diff: gpu/command_buffer/service/in_process_command_buffer.cc

Issue 1864723003: Make lost context and error message callbacks on GpuControl go to client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: errorcallback: . Created 4 years, 8 months 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: 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_;
}

Powered by Google App Engine
This is Rietveld 408576698