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

Unified Diff: third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.h

Issue 2335223004: Make SharedGpuContext recover automatically after a context loss (Closed)
Patch Set: fix flake for real Created 4 years, 3 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: third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.h
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.h b/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.h
index ec64583043b4fac3653848b9d67a6dfae9e6393f..e18973b7f965e3915af30156b14401110dfda2ec 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.h
+++ b/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.h
@@ -25,10 +25,12 @@ public:
// User code can rely on this Id to determine whether long-lived
// gpu resources are still alive in the current context.
static unsigned contextId();
- static gpu::gles2::GLES2Interface* gl();
- static GrContext* gr();
- static bool isValid();
- static bool restore();
+ static gpu::gles2::GLES2Interface* gl(); // May re-create context if context was lost
+ static GrContext* gr(); // May re-create context if context was lost
+ static bool isValid(); // May re-create context if context was lost
+ static bool isValidWithoutRestoring();
xidachen 2016/09/15 18:53:35 Is this method suppose to be called inside unit-te
danakj 2016/09/15 19:00:58 (or ForTesting suffix will enforce that).
+ typedef std::function<std::unique_ptr<WebGraphicsContext3DProvider>()> ContextProviderFactory;
+ static void setContextProviderFactoryForTesting(ContextProviderFactory);
enum {
kNoSharedContext = 0,
@@ -39,8 +41,9 @@ private:
SharedGpuContext();
void createContextProviderOnMainThread(WaitableEvent*);
- void createContextProvider();
+ void createContextProviderIfNeeded();
+ ContextProviderFactory m_contextProviderFactory = nullptr;
std::unique_ptr<WebGraphicsContext3DProvider> m_contextProvider;
unsigned m_contextId;
friend class WTF::ThreadSpecific<SharedGpuContext>;
« no previous file with comments | « third_party/WebKit/Source/platform/BUILD.gn ('k') | third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698