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

Unified Diff: gpu/command_buffer/client/share_group.h

Issue 1916303003: Report lost context from GLES2Implementation based on share group state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lost-share-group: disconnect-channel Created 4 years, 8 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 | « gpu/command_buffer/client/query_tracker.cc ('k') | gpu/command_buffer/client/share_group.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/share_group.h
diff --git a/gpu/command_buffer/client/share_group.h b/gpu/command_buffer/client/share_group.h
index 066c6e6266596bf3ac15db0a1ba8b840163afbe0..091b69f2385034d354e2f5946dcecabc67d4d2a2 100644
--- a/gpu/command_buffer/client/share_group.h
+++ b/gpu/command_buffer/client/share_group.h
@@ -11,6 +11,7 @@
#include <memory>
#include "base/macros.h"
+#include "base/synchronization/lock.h"
#include "gles2_impl_export.h"
#include "gpu/command_buffer/client/ref_counted.h"
#include "gpu/command_buffer/common/gles2_cmd_format.h"
@@ -146,13 +147,20 @@ class GLES2_IMPL_EXPORT ShareGroup
uint64_t TracingGUID() const { return tracing_guid_; }
+ // Mark the ShareGroup as lost when an error occurs on any context in the
+ // group. This is thread safe as contexts may be on different threads.
+ void Lose();
+ // Report if any context in the ShareGroup has reported itself lost. This is
+ // thread safe as contexts may be on different threads.
+ bool IsLost() const;
+
private:
friend class gpu::RefCountedThreadSafe<ShareGroup>;
friend class gpu::gles2::GLES2ImplementationTest;
~ShareGroup();
// Install a new program info manager. Used for testing only;
- void set_program_info_manager(ProgramInfoManager* manager);
+ void SetProgramInfoManagerForTesting(ProgramInfoManager* manager);
std::unique_ptr<IdHandlerInterface>
id_handlers_[id_namespaces::kNumIdNamespaces];
@@ -163,6 +171,9 @@ class GLES2_IMPL_EXPORT ShareGroup
bool bind_generates_resource_;
uint64_t tracing_guid_;
+ mutable base::Lock lost_lock_;
+ bool lost_ = false;
+
DISALLOW_COPY_AND_ASSIGN(ShareGroup);
};
« no previous file with comments | « gpu/command_buffer/client/query_tracker.cc ('k') | gpu/command_buffer/client/share_group.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698