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

Unified Diff: gfx/gtk_native_view_id_manager.h

Issue 5275009: Defer window destruction until GPU finished drawing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 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
Index: gfx/gtk_native_view_id_manager.h
diff --git a/gfx/gtk_native_view_id_manager.h b/gfx/gtk_native_view_id_manager.h
index 513537a7eced09dc11f997583af42a15cb92ad2b..3643552944b33f4d2012137aececaf792b575894 100644
--- a/gfx/gtk_native_view_id_manager.h
+++ b/gfx/gtk_native_view_id_manager.h
@@ -70,6 +70,14 @@ class GtkNativeViewManager {
// returns: true if |id| is a valid id, false otherwise.
bool GetPermanentXIDForId(XID* xid, gfx::NativeViewId id);
+ // Must be called from the UI thread because we may need to access a
+ // GtkWidget or destroy a GdkWindow.
+ //
+ // If the widget associated with the XID is still alive, release the lock
piman 2010/11/29 21:59:01 You're talking about a lock here, but it's unclear
+ // on the XID associated with a widget. Otherwise, destroy the GdkWindow
+ // associated with the XID.
+ void ReleasePermanentXID(XID xid);
+
// These are actually private functions, but need to be called from statics.
void OnRealize(gfx::NativeView widget);
void OnUnrealize(gfx::NativeView widget);
@@ -105,6 +113,16 @@ class GtkNativeViewManager {
std::map<gfx::NativeView, gfx::NativeViewId> native_view_to_id_;
std::map<gfx::NativeViewId, NativeViewInfo> id_to_info_;
+ // Mapping from X window to associated widget.
+ //
+ // In general, several GTK widgets may share the same X window. We assume
+ // that is not true of widgets in this registry.
+ //
+ // An XID will map to NULL, if the widget had been instructed to preserve
+ // it's X window, but was destroyed. In this case, the destruction is deferred
piman 2010/11/29 21:59:01 it's->its
jonathan.backer 2010/11/30 13:09:31 Done.
+ // until a call to ReleasePermXID.
piman 2010/11/29 21:59:01 ReleasePermXID -> ReleasePermanentXID
jonathan.backer 2010/11/30 13:09:31 Done.
+ std::map<XID, gfx::NativeView> xid_to_native_view_;
+
DISALLOW_COPY_AND_ASSIGN(GtkNativeViewManager);
};

Powered by Google App Engine
This is Rietveld 408576698