From patchwork Tue May 8 10:33:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alexandros.frantzis@linaro.org X-Patchwork-Id: 8464 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 B1C8923EB5 for ; Tue, 8 May 2012 10:33:12 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 62A59A18562 for ; Tue, 8 May 2012 10:33:12 +0000 (UTC) Received: by yenq6 with SMTP id q6so211745yen.11 for ; Tue, 08 May 2012 03:33:11 -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=HNsGTISFVoaFROhuoxM3dNaHHkwMu920JnqOqf2XhC0=; b=kfA4IXpfd6rpobvN5Sq3D4JQzR9tSQ09eLksGTbDhW6zL1SyvA57KnwdrC6QMj90Ev e4exfJ7s2jqWg+hobbv5hc7F5Zs6nHtv1Nm0rtATww1OlCTL1b/UtMjivbp6R//vqBq1 dnryszw601tioWVVh2Oq8CjLNZxSpG51j4y/620zqfujo+JQTwprtcIgvVJFr+t6QLf8 uM+3tQKoJsqUBfblpbsyGzzGTPArkGFSxShhqsqSJju6TyxD7JeYxmnE0fxRuGGxy86X o/2iEQjbQudAn0IedGMxo+kOcWUP9kjIvkaNOwoFnjPWCQGQWYzKP/IcI1FFndLsnhOz ESGw== Received: by 10.50.181.164 with SMTP id dx4mr10593807igc.1.1336473191733; Tue, 08 May 2012 03:33:11 -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.73.147 with SMTP id q19csp189825ibj; Tue, 8 May 2012 03:33:10 -0700 (PDT) Received: by 10.180.79.72 with SMTP id h8mr14594893wix.1.1336473190116; Tue, 08 May 2012 03:33:10 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id p8si5362348weh.20.2012.05.08.03.33.09 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 May 2012 03:33: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 1SRhjB-0007Kl-I0 for ; Tue, 08 May 2012 10:33:09 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 79ACAE03A6 for ; Tue, 8 May 2012 10:33:09 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: glmark2 X-Launchpad-Branch: ~glmark2-dev/glmark2/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 205 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~glmark2-dev/glmark2/trunk] Rev 205: Ensure that the framebuffer is drawn opaquely. Message-Id: <20120508103309.26779.84403.launchpad@ackee.canonical.com> Date: Tue, 08 May 2012 10:33:09 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="15204"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: b99b721115ea76b4a8348db314b4c3e227d605c7 X-Gm-Message-State: ALoCoQkODUIAGJ0Ff6kONQi2a3vrNNT/+tZ3BCVnQOT6dbYdabFYIU8mylGxGjhRxKU+d2yjWpO1 ------------------------------------------------------------ revno: 205 committer: Alexandros Frantzis branch nick: opaque-framebuffer timestamp: Mon 2012-05-07 15:45:34 +0300 message: Ensure that the framebuffer is drawn opaquely. Some rendering operations draw translucent pixels to the framebuffer, leading to inconsistent visual results on different platforms and compositing managers. This commit ensures that pixels drawn to the framebuffer by the various scenes are opaque. modified: data/shaders/desktop-blur.frag data/shaders/effect-2d-convolution.frag data/shaders/light-advanced.frag data/shaders/light-basic.vert src/canvas-x11.cpp src/scene-desktop.cpp src/scene-pulsar.cpp --- lp:glmark2 https://code.launchpad.net/~glmark2-dev/glmark2/trunk You are subscribed to branch lp:glmark2. To unsubscribe from this branch go to https://code.launchpad.net/~glmark2-dev/glmark2/trunk/+edit-subscription === modified file 'data/shaders/desktop-blur.frag' --- data/shaders/desktop-blur.frag 2011-09-14 16:53:37 +0000 +++ data/shaders/desktop-blur.frag 2012-05-07 12:45:34 +0000 @@ -8,6 +8,6 @@ $CONVOLUTION$ - gl_FragColor = result; + gl_FragColor = vec4(result.xyz, 1.0); } === modified file 'data/shaders/effect-2d-convolution.frag' --- data/shaders/effect-2d-convolution.frag 2011-09-14 16:53:37 +0000 +++ data/shaders/effect-2d-convolution.frag 2012-05-07 12:45:34 +0000 @@ -7,6 +7,6 @@ $CONVOLUTION$ - gl_FragColor = result; + gl_FragColor = vec4(result.xyz, 1.0); } === modified file 'data/shaders/light-advanced.frag' --- data/shaders/light-advanced.frag 2011-10-11 09:51:17 +0000 +++ data/shaders/light-advanced.frag 2012-05-07 12:45:34 +0000 @@ -29,5 +29,5 @@ pow(max(dot(N,H), 0.0), MaterialShininess); // Calculate the final color - gl_FragColor = ambient + specular + diffuse; + gl_FragColor = vec4((ambient + specular + diffuse).xyz, 1.0); } === modified file 'data/shaders/light-basic.vert' --- data/shaders/light-basic.vert 2011-10-11 09:51:17 +0000 +++ data/shaders/light-basic.vert 2012-05-07 12:45:34 +0000 @@ -19,7 +19,7 @@ // Multiply the diffuse value by the vertex color (which is fixed in this case) // to get the actual color that we will use to draw this vertex with float diffuse = max(dot(N, L), 0.0); - Color = diffuse * MaterialDiffuse; + Color = vec4(diffuse * MaterialDiffuse.rgb, MaterialDiffuse.a); // Set the texture coordinates as a varying TextureCoord = texcoord; === modified file 'src/canvas-x11.cpp' --- src/canvas-x11.cpp 2012-03-20 12:55:49 +0000 +++ src/canvas-x11.cpp 2012-05-07 12:45:34 +0000 @@ -87,7 +87,7 @@ void CanvasX11::clear() { - glClearColor(0.0f, 0.0f, 0.0f, 0.5f); + glClearColor(0.0f, 0.0f, 0.0f, 1.0f); #if USE_GL glClearDepth(1.0f); #elif USE_GLESv2 === modified file 'src/scene-desktop.cpp' --- src/scene-desktop.cpp 2012-03-12 15:32:07 +0000 +++ src/scene-desktop.cpp 2012-05-07 12:45:34 +0000 @@ -494,7 +494,12 @@ */ if (draw_contents_) { glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + /* + * Blend the colors normally, but don't change the + * destination alpha value. + */ + glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, + GL_ZERO, GL_ONE); window_contents_.position(position()); window_contents_.render_to(target); glDisable(GL_BLEND); @@ -658,7 +663,12 @@ virtual void render_to(RenderObject& target) { glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + /* + * Blend the colors normally, but don't change the + * destination alpha value. + */ + glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, + GL_ZERO, GL_ONE); /* Bottom shadow */ shadow_h_.rotation(0.0); === modified file 'src/scene-pulsar.cpp' --- src/scene-pulsar.cpp 2011-12-08 11:09:09 +0000 +++ src/scene-pulsar.cpp 2012-05-07 12:45:34 +0000 @@ -79,7 +79,8 @@ glDisable(GL_CULL_FACE); // Enable alpha blending glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + // Blend the colors normally, but don't change the destination alpha value. + glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ZERO, GL_ONE); // Create a rotation for each quad. numQuads_ = Util::fromString(options_["quads"].value);