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

Unified Diff: ui/compositor/compositor.h

Issue 2083853002: exo: Recreate Surface resources on context lost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nits Created 4 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: ui/compositor/compositor.h
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
index a6245dae5afdc34756adb3b416c6415d3503bd12..b632ba5bdbfd0ddc091c30f05bfcd5938f519b2d 100644
--- a/ui/compositor/compositor.h
+++ b/ui/compositor/compositor.h
@@ -69,6 +69,20 @@ class Texture;
const int kCompositorLockTimeoutMs = 67;
+class COMPOSITOR_EXPORT ContextFactoryObserver {
+ public:
+ virtual ~ContextFactoryObserver() {}
+
+ // Notifies that the ContextProvider returned from
+ // ui::ContextFactory::SharedMainThreadContextProvider was lost. When this
+ // is called, the old resources (e.g. shared context, GL helper) still
+ // exist, but are about to be destroyed. Getting a reference to those
+ // resources from the ContextFactory (e.g. through
+ // SharedMainThreadContextProvider()) will return newly recreated, valid
+ // resources.
+ virtual void OnLostResources() = 0;
+};
+
// This class abstracts the creation of the 3D context for the compositor. It is
// a global object.
class COMPOSITOR_EXPORT ContextFactory {
@@ -128,6 +142,10 @@ class COMPOSITOR_EXPORT ContextFactory {
base::TimeDelta interval) = 0;
virtual void SetOutputIsSecure(Compositor* compositor, bool secure) = 0;
+
+ virtual void AddObserver(ContextFactoryObserver* observer) = 0;
+
+ virtual void RemoveObserver(ContextFactoryObserver* observer) = 0;
};
// This class represents a lock on the compositor, that can be used to prevent
« no previous file with comments | « content/browser/renderer_host/delegated_frame_host.cc ('k') | ui/compositor/test/in_process_context_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698