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

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: Resolved merge with rate limiter CL Created 7 years, 5 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
« no previous file with comments | « Source/core/testing/Internals.h ('k') | Source/core/testing/Internals.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/testing/Internals.cpp
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp
index b8189bf9a9fbbdf03d97e56b402804831fa9afa6..6e5b1f0424b2c49b9cfd79656efbefa6753af543 100644
--- a/Source/core/testing/Internals.cpp
+++ b/Source/core/testing/Internals.cpp
@@ -100,6 +100,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"
@@ -2054,4 +2055,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;
+}
+
}
« no previous file with comments | « Source/core/testing/Internals.h ('k') | Source/core/testing/Internals.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698