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

Unified Diff: components/exo/surface.h

Issue 1467943002: exo: Handle lost context situations properly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move SharedMainThreadContextProvider Created 5 years, 1 month 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 | « components/exo/buffer_unittest.cc ('k') | components/exo/surface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/surface.h
diff --git a/components/exo/surface.h b/components/exo/surface.h
index 0bb6b98b383070bb14fbce39c196ff9ab503ab99..d21b376357d6b01303f720188c4a51869e11b4bd 100644
--- a/components/exo/surface.h
+++ b/components/exo/surface.h
@@ -98,8 +98,8 @@ class Surface : public views::View, public ui::CompositorObserver {
void OnCompositingDidCommit(ui::Compositor* compositor) override;
void OnCompositingStarted(ui::Compositor* compositor,
base::TimeTicks start_time) override;
- void OnCompositingEnded(ui::Compositor* compositor) override {}
- void OnCompositingAborted(ui::Compositor* compositor) override {}
+ void OnCompositingEnded(ui::Compositor* compositor) override;
+ void OnCompositingAborted(ui::Compositor* compositor) override;
void OnCompositingLockStateChanged(ui::Compositor* compositor) override {}
void OnCompositingShuttingDown(ui::Compositor* compositor) override;
@@ -108,7 +108,12 @@ class Surface : public views::View, public ui::CompositorObserver {
return needs_commit_surface_hierarchy_;
}
- bool has_contents() const { return has_contents_; }
+ // This returns true when the surface has some contents assigned to it.
+ bool has_contents() const { return !!current_buffer_; }
+
+ // This is true when Attach() has been called and new contents should take
+ // effect next time Commit() is called.
+ bool has_pending_contents_;
// The buffer that will become the content of surface when Commit() is called.
base::WeakPtr<Buffer> pending_buffer_;
@@ -138,12 +143,16 @@ class Surface : public views::View, public ui::CompositorObserver {
using SubSurfaceEntryList = std::list<SubSurfaceEntry>;
SubSurfaceEntryList pending_sub_surfaces_;
+ // The buffer that is currently set as content of surface.
+ base::WeakPtr<Buffer> current_buffer_;
+
// This is true if a call to Commit() as been made but
// CommitSurfaceHierarchy() has not yet been called.
bool needs_commit_surface_hierarchy_;
- // This is true when surface has some contents assigned to it.
- bool has_contents_;
+ // This is true when the contents of the surface should be updated next time
+ // the compositor successfully ends compositing.
+ bool update_contents_after_successful_compositing_;
// The compsitor being observer or null if not observing a compositor.
ui::Compositor* compositor_;
« no previous file with comments | « components/exo/buffer_unittest.cc ('k') | components/exo/surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698