summaryrefslogtreecommitdiffstats
path: root/gpu/blink
diff options
context:
space:
mode:
authordanakj <danakj@chromium.org>2015-06-09 10:18:59 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-09 17:19:30 +0000
commitb0abc0dab520325f2b8cf9acc3308dfaf2cb2652 (patch)
treec0ad4178e32a386eba4ef161612b6da7d83441d0 /gpu/blink
parentac2ffadacece2698f02b414f55fa7372c720e828 (diff)
downloadchromium_src-b0abc0dab520325f2b8cf9acc3308dfaf2cb2652.zip
chromium_src-b0abc0dab520325f2b8cf9acc3308dfaf2cb2652.tar.gz
chromium_src-b0abc0dab520325f2b8cf9acc3308dfaf2cb2652.tar.bz2
Implement WebGraphicsContext3D's lost context methods on GLES2Impl
Implement isContextLost and GetGraphicsResetStatusARB in the base WebGraphicsContext3DImpl instead of its subclasses, by just having then both call through to GLES2Interface::GetGraphicsResetStatusKHR. R=piman@chromium.org BUG=492447 Review URL: https://codereview.chromium.org/1169923004 Cr-Commit-Position: refs/heads/master@{#333512}
Diffstat (limited to 'gpu/blink')
-rw-r--r--gpu/blink/webgraphicscontext3d_impl.cc9
-rw-r--r--gpu/blink/webgraphicscontext3d_impl.h4
-rw-r--r--gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.cc11
-rw-r--r--gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h6
4 files changed, 11 insertions, 19 deletions
diff --git a/gpu/blink/webgraphicscontext3d_impl.cc b/gpu/blink/webgraphicscontext3d_impl.cc
index 8645c23..123ba79 100644
--- a/gpu/blink/webgraphicscontext3d_impl.cc
+++ b/gpu/blink/webgraphicscontext3d_impl.cc
@@ -185,7 +185,6 @@ WebGraphicsContext3DImpl::WebGraphicsContext3DImpl()
: initialized_(false),
initialize_failed_(false),
context_lost_callback_(0),
- context_lost_reason_(GL_NO_ERROR),
error_message_callback_(0),
gl_(NULL),
flush_id_(0) {
@@ -1174,6 +1173,14 @@ void WebGraphicsContext3DImpl::waitSync(WGC3Dsync sync,
gl_->WaitSync(reinterpret_cast<GLsync>(sync), flags, timeout);
}
+bool WebGraphicsContext3DImpl::isContextLost() {
+ return getGraphicsResetStatusARB() != GL_NO_ERROR;
+}
+
+blink::WGC3Denum WebGraphicsContext3DImpl::getGraphicsResetStatusARB() {
+ return gl_->GetGraphicsResetStatusKHR();
+}
+
GrGLInterface* WebGraphicsContext3DImpl::createGrGLInterface() {
return skia_bindings::CreateCommandBufferSkiaGLBinding();
}
diff --git a/gpu/blink/webgraphicscontext3d_impl.h b/gpu/blink/webgraphicscontext3d_impl.h
index b11c1f4..c053f88 100644
--- a/gpu/blink/webgraphicscontext3d_impl.h
+++ b/gpu/blink/webgraphicscontext3d_impl.h
@@ -921,6 +921,9 @@ class GPU_BLINK_EXPORT WebGraphicsContext3DImpl
blink::WGC3Dbitfield flags,
blink::WGC3Duint64 timeout);
+ virtual bool isContextLost();
+ virtual blink::WGC3Denum getGraphicsResetStatusARB();
+
virtual GrGLInterface* createGrGLInterface();
::gpu::gles2::GLES2Interface* GetGLInterface() {
@@ -950,7 +953,6 @@ class GPU_BLINK_EXPORT WebGraphicsContext3DImpl
bool initialize_failed_;
WebGraphicsContext3D::WebGraphicsContextLostCallback* context_lost_callback_;
- blink::WGC3Denum context_lost_reason_;
WebGraphicsContext3D::WebGraphicsErrorMessageCallback*
error_message_callback_;
diff --git a/gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.cc b/gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.cc
index e661fc9..4f83fa3 100644
--- a/gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.cc
+++ b/gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.cc
@@ -154,23 +154,12 @@ void WebGraphicsContext3DInProcessCommandBufferImpl::SetLock(base::Lock* lock) {
context_->SetLock(lock);
}
-bool WebGraphicsContext3DInProcessCommandBufferImpl::isContextLost() {
- return context_lost_reason_ != GL_NO_ERROR;
-}
-
-WGC3Denum WebGraphicsContext3DInProcessCommandBufferImpl::
- getGraphicsResetStatusARB() {
- return context_lost_reason_;
-}
-
::gpu::ContextSupport*
WebGraphicsContext3DInProcessCommandBufferImpl::GetContextSupport() {
return real_gl_;
}
void WebGraphicsContext3DInProcessCommandBufferImpl::OnContextLost() {
- // TODO(kbr): improve the precision here.
- context_lost_reason_ = GL_UNKNOWN_CONTEXT_RESET_ARB;
if (context_lost_callback_) {
context_lost_callback_->onContextLost();
}
diff --git a/gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h b/gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h
index fa7542c..d463582 100644
--- a/gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h
+++ b/gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h
@@ -59,12 +59,6 @@ class GPU_BLINK_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl
bool InitializeOnCurrentThread();
void SetLock(base::Lock* lock);
- //----------------------------------------------------------------------
- // WebGraphicsContext3D methods
- virtual bool isContextLost();
-
- virtual blink::WGC3Denum getGraphicsResetStatusARB();
-
::gpu::ContextSupport* GetContextSupport();
::gpu::gles2::GLES2Implementation* GetImplementation() {