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

Unified Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 1885903002: Revert of 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: 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/client/gles2_implementation.cc
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 22032b0147c4d3a9ba33a19a6373b8bf1327ff28..f8f21373ae3af3eb76652aa1da766490cf745f9b 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -161,6 +161,7 @@
base::SysInfo::AmountOfPhysicalMemory() / 20)
: 0),
#endif
+ error_message_callback_(NULL),
current_trace_stack_(0),
gpu_control_(gpu_control),
capabilities_(gpu_control->GetCapabilities()),
@@ -200,8 +201,6 @@
DCHECK_LE(starting_transfer_buffer_size, max_transfer_buffer_size);
DCHECK_GE(min_transfer_buffer_size, kStartingOffset);
- gpu_control_->SetGpuControlClient(this);
-
if (!transfer_buffer_->Initialize(
starting_transfer_buffer_size,
kStartingOffset,
@@ -300,10 +299,6 @@
// Make sure the commands make it the service.
WaitForCmd();
-
- // The gpu_control_ outlives this class, so clear the client on it before we
- // self-destruct.
- gpu_control_->SetGpuControlClient(nullptr);
}
GLES2CmdHelper* GLES2Implementation::helper() const {
@@ -324,22 +319,6 @@
return query_id_allocator_.get();
NOTREACHED();
return NULL;
-}
-
-void GLES2Implementation::OnGpuControlLostContext() {
-#if DCHECK_IS_ON()
- // This should never occur more than once.
- DCHECK(!lost_context_);
- lost_context_ = true;
-#endif
- if (!lost_context_callback_.is_null())
- lost_context_callback_.Run();
-}
-
-void GLES2Implementation::OnGpuControlErrorMessage(const char* message,
- int32_t id) {
- if (!error_message_callback_.is_null())
- error_message_callback_.Run(message, id);
}
void* GLES2Implementation::GetResultBuffer() {
@@ -570,10 +549,10 @@
if (msg) {
last_error_ = msg;
}
- if (!error_message_callback_.is_null()) {
+ if (error_message_callback_) {
std::string temp(GLES2Util::GetStringError(error) + " : " +
function_name + ": " + (msg ? msg : ""));
- error_message_callback_.Run(temp.c_str(), 0);
+ error_message_callback_->OnErrorMessage(temp.c_str(), 0);
}
error_bits_ |= GLES2Util::GLErrorToErrorBit(error);
@@ -5839,16 +5818,6 @@
return share_group_->TracingGUID();
}
-void GLES2Implementation::SetErrorMessageCallback(
- const base::Callback<void(const char*, int32_t)>& callback) {
- error_message_callback_ = callback;
-}
-
-void GLES2Implementation::SetLostContextCallback(
- const base::Closure& callback) {
- lost_context_callback_ = callback;
-}
-
GLuint64 GLES2Implementation::InsertFenceSyncCHROMIUM() {
const uint64_t release = gpu_control_->GenerateFenceSyncRelease();
helper_->InsertFenceSyncCHROMIUM(release);
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.h ('k') | gpu/command_buffer/client/gles2_implementation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698