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

Unified Diff: ui/gl/gl_surface_glx.cc

Issue 23653049: (not for review) Fix composited-to-non-composited corruption on Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« no previous file with comments | « ui/gl/gl_surface_glx.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface_glx.cc
diff --git a/ui/gl/gl_surface_glx.cc b/ui/gl/gl_surface_glx.cc
index 02e5a2a3d1cd257ad735be08549198d234290b2e..2dba6d38ca4956233a98a35404cebb0dfab2f1ea 100644
--- a/ui/gl/gl_surface_glx.cc
+++ b/ui/gl/gl_surface_glx.cc
@@ -311,6 +311,7 @@ class XExposeEventForwarder : public base::MessagePumpObserver {
XExposeEventForwarder() {}
virtual ~XExposeEventForwarder() {
DCHECK(child_to_parent_map_.empty());
+ DCHECK(parent_to_child_map_.empty());
}
void AddParentChildPair(gfx::AcceleratedWidget parent_window,
gfx::AcceleratedWidget child_window) {
@@ -321,16 +322,33 @@ class XExposeEventForwarder : public base::MessagePumpObserver {
child_to_parent_map_.end());
child_to_parent_map_.insert(std::make_pair(
child_window, parent_window));
+ parent_to_child_map_.insert(std::make_pair(
+ parent_window, child_window));
}
void RemoveParentChildPair(gfx::AcceleratedWidget parent_window,
gfx::AcceleratedWidget child_window) {
DCHECK(child_to_parent_map_.find(child_window) !=
child_to_parent_map_.end());
+ DCHECK(parent_to_child_map_.find(parent_window) !=
+ parent_to_child_map_.end());
child_to_parent_map_.erase(child_window);
+ parent_to_child_map_.erase(parent_window);
if (child_to_parent_map_.empty())
base::MessagePumpX11::Current()->RemoveObserver(this);
}
+ void SetChildWindowVisible(gfx::AcceleratedWidget parent_window,
+ bool visible) {
+ WindowMap::const_iterator found = parent_to_child_map_.find(parent_window);
+ if (found == parent_to_child_map_.end())
+ return;
+ gfx::AcceleratedWidget child_window = found->second;
+ if (visible)
+ XMapWindow(g_display, child_window);
+ else
+ XUnmapWindow(g_display, child_window);
+ // XFlush(g_display);
+ }
private:
virtual base::EventStatus WillProcessEvent (
@@ -355,6 +373,7 @@ class XExposeEventForwarder : public base::MessagePumpObserver {
typedef std::map<gfx::AcceleratedWidget, gfx::AcceleratedWidget> WindowMap;
WindowMap child_to_parent_map_;
+ WindowMap parent_to_child_map_;
DISALLOW_COPY_AND_ASSIGN(XExposeEventForwarder);
};
@@ -390,10 +409,6 @@ bool GLSurfaceGLX::InitializeOneOff() {
base::MessageLoop::current() &&
base::MessageLoop::current()->type() == base::MessageLoop::TYPE_GPU;
- // Disable this path because it is causing window contents to disappear.
- // http://crbug.com/292655
- g_create_child_windows = false;
-
if (g_create_child_windows)
g_display = base::MessagePumpX11::GetDefaultXDisplay();
else
@@ -697,6 +712,14 @@ VSyncProvider* NativeViewGLSurfaceGLX::GetVSyncProvider() {
return vsync_provider_.get();
}
+#if defined(TOOLKIT_GTK)
+void NativeViewGLSurfaceGLX::AcceleratedCompositingStateChange(
+ int32 surface_id, bool compositing_active) {
+ g_xexpose_event_forwarder.Pointer()->SetChildWindowVisible(
+ surface_id, compositing_active);
+}
+#endif
+
NativeViewGLSurfaceGLX::NativeViewGLSurfaceGLX()
: parent_window_(0),
#if defined(TOOLKIT_GTK)
« no previous file with comments | « ui/gl/gl_surface_glx.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698