From patchwork Thu Apr 19 14:28:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Barker X-Patchwork-Id: 7948 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 4661623E49 for ; Thu, 19 Apr 2012 14:28:14 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id E20EFA183A7 for ; Thu, 19 Apr 2012 14:28:13 +0000 (UTC) Received: by iage36 with SMTP id e36so16394668iag.11 for ; Thu, 19 Apr 2012 07:28:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :content-type:mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state; bh=+DxClZ0/MIg0xPZH/BbxOSfQw7QMnyNkWWmjNs3BiJA=; b=EuFWaSSuoPhZRsiFMFc3y9li0xqbUeH7EEht4WS7Klab05iPIzRRkAOt3sjShyUrxl +6VK1uOyvN+lfWX09IhZdlGZOKAVxbfYG/g+/mgK6JyM3q7mUactZAJVYj5qny9dTg1E UAsqdWk6FtU5aJkScPDXJpBGiiKm0yoduqr4LDnEefK42PGTBetGFm4EhzEPMGal8H0I Yc8XD+uOGPlheFy9a9oZReckVP9REkJlBjIUGEBuNV/1TQKd9cOM3ZTDEYtgxFOeL96N 1cH9PdREhT7m+dFrEn6lhFHGR1gQn2yrIVxCyevb6I3FpKgYppMxruuryiVr1asGPlC+ AXMw== Received: by 10.50.17.201 with SMTP id q9mr2479817igd.19.1334845693284; Thu, 19 Apr 2012 07:28:13 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.137.198 with SMTP id x6csp293714ibt; Thu, 19 Apr 2012 07:28:11 -0700 (PDT) Received: by 10.14.96.129 with SMTP id r1mr397858eef.86.1334845690910; Thu, 19 Apr 2012 07:28:10 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id u63si2567206wec.94.2012.04.19.07.28.10 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 Apr 2012 07:28:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1SKsLC-0008J7-Ax for ; Thu, 19 Apr 2012 14:28:10 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 42320E015A for ; Thu, 19 Apr 2012 14:28:10 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: glcompbench X-Launchpad-Branch: ~glcompbench-dev/glcompbench/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 81 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~glcompbench-dev/glcompbench/trunk] Rev 81: Merge in the fix for bug 984058. Message-Id: <20120419142810.22878.95972.launchpad@ackee.canonical.com> Date: Thu, 19 Apr 2012 14:28:10 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="15108"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: c3f4ea3cf50c83db405d3bf4cfe60fd06f7d3755 X-Gm-Message-State: ALoCoQlFHT/oNXAIFs8JzEEyE7XQa86hZw7GANOt8hYqRE0pmxMtCpP42HItlFb+0E2qzzNMEmyF Merge authors: Jesse Barker (jesse-barker) Related merge proposals: https://code.launchpad.net/~glcompbench-dev/glcompbench/bug-984058/+merge/102594 proposed by: Jesse Barker (jesse-barker) ------------------------------------------------------------ revno: 81 [merge] committer: Jesse Barker branch nick: trunk timestamp: Thu 2012-04-19 07:25:08 -0700 message: Merge in the fix for bug 984058. Update the Canvas to handle the case where a window has been destroyed, but we receive other events on that window before we get the DestroyNotify. modified: src/composite-canvas-egl.cc src/composite-canvas-glx.cc src/composite-canvas.cc src/composite-window.cc --- lp:glcompbench https://code.launchpad.net/~glcompbench-dev/glcompbench/trunk You are subscribed to branch lp:glcompbench. To unsubscribe from this branch go to https://code.launchpad.net/~glcompbench-dev/glcompbench/trunk/+edit-subscription === modified file 'src/composite-canvas-egl.cc' --- src/composite-canvas-egl.cc 2011-12-12 13:16:47 +0000 +++ src/composite-canvas-egl.cc 2012-04-17 23:19:42 +0000 @@ -301,6 +301,7 @@ std::stringstream ss; + ss << " EGL " << eglQueryString(egl_display_, EGL_VERSION) << std::endl; ss << " OpenGL Information" << std::endl; ss << " GL_VENDOR: " << glGetString(GL_VENDOR) << std::endl; ss << " GL_RENDERER: " << glGetString(GL_RENDERER) << std::endl; === modified file 'src/composite-canvas-glx.cc' --- src/composite-canvas-glx.cc 2011-12-09 16:09:11 +0000 +++ src/composite-canvas-glx.cc 2012-04-17 23:19:42 +0000 @@ -254,6 +254,7 @@ std::stringstream ss; + ss << " GLX " << glXGetClientString(xdpy_, GLX_VERSION) << std::endl; ss << " OpenGL Information" << std::endl; ss << " GL_VENDOR: " << glGetString(GL_VENDOR) << std::endl; ss << " GL_RENDERER: " << glGetString(GL_RENDERER) << std::endl; === modified file 'src/composite-canvas.cc' --- src/composite-canvas.cc 2012-03-09 03:58:54 +0000 +++ src/composite-canvas.cc 2012-04-19 14:15:59 +0000 @@ -368,7 +368,6 @@ { XEvent event; bool needs_redraw(false); - Window window(0); Profiler::ScopedSamples xevent_scoped(CompositeCanvas::profiler_xevent_pair()); if (Options::idle_redraw && !XPending(xdpy_)) @@ -376,16 +375,32 @@ XNextEvent(xdpy_, &event); - if (event.type == damage_event_ + XDamageNotify) { + // We have to allow for the possibility that the window has actually + // been destroyed, but we saw the current event before the destroy event. + // So, check for a queued-up DestroyNotify event for our window before + // trying to update (bug 984058). + Window window = event.xany.window; + XEvent destroyEvent; + if (True == XCheckTypedWindowEvent(xdpy_, window, DestroyNotify, &destroyEvent)) { + Log::debug("--- Destroy Win: 0x%x\n", window); + remove_window(window); + // If we're using a user provided list of windows, prune this one + // out to make sure we don't create any new objects with a bad + // window list. + if (!Options::window_ids.empty()) + { + Options::window_ids.remove(window); + } + needs_redraw = true; + } + else if (event.type == damage_event_ + XDamageNotify) { // This is a little ugly, but then so is violating strict aliasing // to make the hideous cast to reference this as an XDamageNotifyEvent. - window = event.xany.window; Log::debug("### Damage Win: 0x%x\n", window); handle_damage(window); needs_redraw = true; } else if (event.type == ConfigureNotify) { - window = event.xconfigure.window; Log::debug("Configure Win: 0x%x %d x %d\n", window, width_, height_); @@ -398,24 +413,20 @@ update_window(window); } else if (event.type == Expose) { - window = event.xexpose.window; Log::debug("Expose Win: 0x%x\n", window); needs_redraw = true; } else if (event.type == UnmapNotify) { - window = event.xunmap.window; Log::debug("--- Unmap Win: 0x%x\n", window); update_window(window); needs_redraw = true; } else if (event.type == MapNotify) { - window = event.xmap.window; Log::debug("+++ Map Win: 0x%x\n", window); update_window(window); needs_redraw = true; } else if (event.type == ReparentNotify) { - window = event.xreparent.window; Window parent = event.xreparent.parent; Log::debug("+++ Reparent Win: 0x%x Parent: 0x%x\n", parent); if (parent == root_) @@ -425,13 +436,11 @@ needs_redraw = true; } else if (event.type == CreateNotify) { - window = event.xcreatewindow.window; Log::debug("+++ Add Win: 0x%x Parent: 0x%x\n", window, event.xcreatewindow.parent); add_window(window); } else if (event.type == DestroyNotify) { - window = event.xdestroywindow.window; Log::debug("--- Destroy Win: 0x%x\n", window); remove_window(window); needs_redraw = true; === modified file 'src/composite-window.cc' --- src/composite-window.cc 2011-08-03 14:34:10 +0000 +++ src/composite-window.cc 2012-04-17 23:17:20 +0000 @@ -34,7 +34,7 @@ if (pix_) XFreePixmap(xdpy_, pix_); - if (damage_) + if (damage_ && attr_.map_state == IsUnmapped) XDamageDestroy(xdpy_, damage_); } @@ -72,12 +72,12 @@ width_, height_, attr_.map_state); /* Update pixmap */ - if (!pix_ && attr_.map_state != 0) { + if (!pix_ && attr_.map_state != IsUnmapped) { pix_ = XCompositeNameWindowPixmap(xdpy_, win_); Log::debug(" => Pixmap <= 0x%x\n", (unsigned) pix_); update_tfp = true; } - else if (pix_ && attr_.map_state == 0) { + else if (pix_ && attr_.map_state == IsUnmapped) { Log::debug(" => Destroying Pixmap 0x%x\n", (unsigned) pix_); pix_to_free = pix_; pix_ = None; @@ -85,11 +85,11 @@ Log::debug(" => Damage State <= 0x%x\n", (unsigned) damage_); /* Update damage object */ - if (!damage_ && attr_.map_state != 0) { + if (!damage_ && attr_.map_state != IsUnmapped) { damage_ = XDamageCreate(xdpy_, win_, XDamageReportNonEmpty); Log::debug(" => Damage <= 0x%x\n", (unsigned) damage_); } - else if (damage_ && attr_.map_state == 0) { + else if (damage_ && attr_.map_state == IsUnmapped) { Log::debug(" => Destroying damage 0x%x\n", (unsigned) damage_); XDamageDestroy(xdpy_, damage_); damage_ = None;