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

Unified Diff: cc/test/fake_web_graphics_context_3d.cc

Issue 11606012: cc: Unify context losing machinery (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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: cc/test/fake_web_graphics_context_3d.cc
diff --git a/cc/test/fake_web_graphics_context_3d.cc b/cc/test/fake_web_graphics_context_3d.cc
index 52c765d688a36bba486794ac664096849f4bba3f..48269eaeac56a60a58e4099e368e309381d46a8b 100644
--- a/cc/test/fake_web_graphics_context_3d.cc
+++ b/cc/test/fake_web_graphics_context_3d.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "cc/test/fake_web_graphics_context_3d.h"
+#include "third_party/khronos/GLES2/gl2ext.h"
namespace cc {
@@ -36,7 +37,11 @@ WebKit::WebGLId FakeWebGraphicsContext3D::getPlatformTextureId() {
}
bool FakeWebGraphicsContext3D::isContextLost() {
- return false;
+ return m_contextLost;
+}
+
+WebKit::WGC3Denum FakeWebGraphicsContext3D::getGraphicsResetStatusARB() {
+ return m_contextLost ? GL_UNKNOWN_CONTEXT_RESET_ARB : GL_NO_ERROR;
}
void* FakeWebGraphicsContext3D::mapBufferSubDataCHROMIUM(
@@ -219,4 +224,15 @@ WebKit::WGC3Dboolean FakeWebGraphicsContext3D::isQueryEXT(WebKit::WebGLId) {
return true;
}
+void FakeWebGraphicsContext3D::setContextLostCallback(
+ WebGraphicsContextLostCallback* callback) {
+ m_contextLostCallback = callback;
+}
+
+void FakeWebGraphicsContext3D::loseContext() {
+ m_contextLost = true;
+ if (m_contextLostCallback)
+ m_contextLostCallback->onContextLost();
+}
+
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698