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

Unified Diff: Source/core/testing/Internals.cpp

Issue 16032003: Fixing Canvas2DLayerBridge to handle lost graphics contexts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixing gpu_test Canvas2DAllowed Created 7 years, 6 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: Source/core/testing/Internals.cpp
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp
index 133890bf8e3b1d5ef443ef0b8c5d623a51f3c1c5..4efb874ee9d08256cbaada6d60f21cff80000e27 100644
--- a/Source/core/testing/Internals.cpp
+++ b/Source/core/testing/Internals.cpp
@@ -95,6 +95,7 @@
#include "core/platform/Cursor.h"
#include "core/platform/Language.h"
#include "core/platform/graphics/IntRect.h"
+#include "core/platform/graphics/gpu/SharedGraphicsContext3D.h"
#include "core/rendering/RenderMenuList.h"
#include "core/rendering/RenderObject.h"
#include "core/rendering/RenderTreeAsText.h"
@@ -1963,4 +1964,17 @@ bool Internals::isSelectPopupVisible(Node* node)
return menuList->popupIsVisible();
}
+bool Internals::loseSharedGraphicsContext3D()
+{
+ RefPtr<GraphicsContext3D> sharedContext = SharedGraphicsContext3D::get();
+ if (!sharedContext)
+ return false;
+ sharedContext->getExtensions()->loseContextCHROMIUM(Extensions3D::GUILTY_CONTEXT_RESET_ARB, Extensions3D::INNOCENT_CONTEXT_RESET_ARB);
+ // To prevent tests that call loseSharedGraphicsContext3D from being
+ // flaky, we call finish so that the context is guaranteed to be lost
+ // synchronously (i.e. before returning).
+ sharedContext->finish();
+ return true;
+}
+
}

Powered by Google App Engine
This is Rietveld 408576698