Chromium Code Reviews| 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..ce39fb2b46a8a00ba00adbf57f717380a38ed11a 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. |
|
no sievers
2016/04/08 18:11:45
nit: these two can be private, I think?
danakj
2016/04/08 18:38:58
Done. And final too.
|
| + 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,11 @@ 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_; |
| +#if DCHECK_IS_ON() |
| + bool lost_context_ = false; |
| +#endif |
| int current_trace_stack_; |