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

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

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/client/gles2_implementation.h
diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h
index 6ee901e2a05cb73a8f56c3556d51403e7ece9349..3a1629ea3a3a84de683840c9d5f12c7d688afad0 100644
--- a/gpu/command_buffer/client/gles2_implementation.h
+++ b/gpu/command_buffer/client/gles2_implementation.h
@@ -26,6 +26,7 @@
#include "gpu/command_buffer/client/context_support.h"
#include "gpu/command_buffer/client/gles2_impl_export.h"
#include "gpu/command_buffer/client/gles2_interface.h"
+#include "gpu/command_buffer/client/gpu_control_client.h"
#include "gpu/command_buffer/client/mapped_memory.h"
#include "gpu/command_buffer/client/ref_counted.h"
#include "gpu/command_buffer/client/share_group.h"
@@ -111,12 +112,6 @@ class GLES2CmdHelper;
class VertexArrayObjectManager;
class QueryTracker;
-class GLES2ImplementationErrorMessageCallback {
- public:
- virtual ~GLES2ImplementationErrorMessageCallback() { }
- virtual void OnErrorMessage(const char* msg, int id) = 0;
-};
-
// This class emulates GLES2 over command buffers. It can be used by a client
// program so that the program does not need deal with shared memory and command
// buffer management. See gl2_lib.h. Note that there is a performance gain to
@@ -126,6 +121,7 @@ class GLES2ImplementationErrorMessageCallback {
class GLES2_IMPL_EXPORT GLES2Implementation
: NON_EXPORTED_BASE(public GLES2Interface),
NON_EXPORTED_BASE(public ContextSupport),
+ NON_EXPORTED_BASE(public GpuControlClient),
NON_EXPORTED_BASE(public base::trace_event::MemoryDumpProvider) {
public:
enum MappedMemoryLimit {
@@ -213,6 +209,14 @@ class GLES2_IMPL_EXPORT GLES2Implementation
const gfx::RectF& uv_rect) override;
uint64_t ShareGroupTracingGUID() const override;
+ // GpuControlClient implementation.
+ void OnGpuControlLostContext() override;
+ void OnGpuControlErrorMessage(const char* message, int32_t id) override;
+
+ void SetErrorMessageCallback(
+ const base::Callback<void(const char*, int32_t)>& callback);
+ void SetLostContextCallback(const base::Closure& callback);
+
void GetProgramInfoCHROMIUMHelper(GLuint program,
std::vector<int8_t>* result);
GLint GetAttribLocationHelper(GLuint program, const char* name);
@@ -264,11 +268,6 @@ class GLES2_IMPL_EXPORT GLES2Implementation
bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* pmd) override;
- void SetErrorMessageCallback(
- GLES2ImplementationErrorMessageCallback* callback) {
- error_message_callback_ = callback;
- }
-
ShareGroup* share_group() const {
return share_group_.get();
}
@@ -825,7 +824,8 @@ class GLES2_IMPL_EXPORT GLES2Implementation
scoped_ptr<BufferTracker> buffer_tracker_;
- GLES2ImplementationErrorMessageCallback* error_message_callback_;
+ base::Callback<void(const char*, int32_t)> error_message_callback_;
+ base::Closure lost_context_callback_;
int current_trace_stack_;

Powered by Google App Engine
This is Rietveld 408576698