Index: content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h |
diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h |
index f649a21cca9b66d7db5d25e73a99495c13641e5c..332f014b0b4eda7a4f01e6e49fc5fe7f7a12650c 100644 |
--- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h |
+++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h |
@@ -18,7 +18,6 @@ |
#include "base/synchronization/lock.h" |
#include "content/common/content_export.h" |
#include "content/common/gpu/client/command_buffer_metrics.h" |
-#include "gpu/blink/webgraphicscontext3d_impl.h" |
#include "gpu/command_buffer/common/gles2_cmd_utils.h" |
#include "gpu/ipc/client/command_buffer_proxy_impl.h" |
#include "gpu/ipc/common/surface_handle.h" |
@@ -49,7 +48,7 @@ const size_t kDefaultMinTransferBufferSize = 1 * 256 * 1024; |
const size_t kDefaultMaxTransferBufferSize = 16 * 1024 * 1024; |
class WebGraphicsContext3DCommandBufferImpl |
- : public gpu_blink::WebGraphicsContext3DImpl { |
+ : public NON_EXPORTED_BASE(blink::WebGraphicsContext3D) { |
public: |
enum MappedMemoryReclaimLimit { |
kNoLimit = 0, |
@@ -99,6 +98,14 @@ class WebGraphicsContext3DCommandBufferImpl |
DISALLOW_COPY_AND_ASSIGN(ShareGroup); |
}; |
+ class WebGraphicsContextLostCallback { |
+ public: |
+ virtual void onContextLost() = 0; |
+ |
+ protected: |
+ virtual ~WebGraphicsContextLostCallback() {} |
+ }; |
+ |
CONTENT_EXPORT WebGraphicsContext3DCommandBufferImpl( |
gpu::SurfaceHandle surface_handle, |
const GURL& active_url, |
@@ -121,6 +128,10 @@ class WebGraphicsContext3DCommandBufferImpl |
return real_gl_.get(); |
} |
+ void SetContextLostCallback(WebGraphicsContextLostCallback* callback) { |
+ context_lost_callback_ = callback; |
+ } |
+ |
CONTENT_EXPORT bool InitializeOnCurrentThread( |
const gpu::SharedMemoryLimits& memory_limits); |
@@ -163,6 +174,10 @@ class WebGraphicsContext3DCommandBufferImpl |
void OnContextLost(); |
+ bool initialized_ = false; |
+ bool initialize_failed_ = false; |
+ WebGraphicsContextLostCallback* context_lost_callback_ = nullptr; |
+ |
bool automatic_flushes_; |
gpu::gles2::ContextCreationAttribHelper attributes_; |