From patchwork Fri Jul 13 15:42:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Barker X-Patchwork-Id: 9993 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 AFEEB23E2F for ; Fri, 13 Jul 2012 15:42:14 +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 60905A182D7 for ; Fri, 13 Jul 2012 15:42:14 +0000 (UTC) Received: by yenq6 with SMTP id q6so4019960yen.11 for ; Fri, 13 Jul 2012 08:42: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=S1DBCNzVz3a3rNVD9ujxUM6XkVYK1Mx2gCpz524cEWw=; b=ivgl7VioTLkSj99dFF353jotXmRxnETgiLqpo5FFnfThFh60XAquBTEG0OPQ2civgs Lgmme2oO+BvYg0xc/LsSbno15rJa1BFW+KgCEDiLuTEoqW7PRN8W3u6ZxzAhEL+K0WYu QyYHgTnFtgkyiZ/3bLQHthh7ToiWG2SPBgNFly/Y/rNm1kBZWYFofO1wCprVk6zTYheb HgPpUiTaLzuXIf8MPAiwNOyP+ObAJ6TMyBsGfHJNd3yBtI0FrU4Z+85hP/rt2sU47qt5 Ehn53c+um2Fsk/FtCjF66wuJVXJVI3TtM3fksDfytJpySS6QBdgw4gxC0w/ZFTfj33jM cBcA== Received: by 10.50.87.227 with SMTP id bb3mr1372526igb.57.1342194133650; Fri, 13 Jul 2012 08:42: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.241.2 with SMTP id lc2csp17101ibb; Fri, 13 Jul 2012 08:42:13 -0700 (PDT) Received: by 10.180.14.8 with SMTP id l8mr3689864wic.6.1342194132509; Fri, 13 Jul 2012 08:42:12 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id a4si5143277wie.23.2012.07.13.08.42.11 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 13 Jul 2012 08:42:12 -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 1Spi0R-0006kX-Ri for ; Fri, 13 Jul 2012 15:42:11 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id BB9AFE0180 for ; Fri, 13 Jul 2012 15:42:11 +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: 86 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~glcompbench-dev/glcompbench/trunk] Rev 86: CompositeTestSimpleFade: Fix the set up and update of the Fader object to allow Message-Id: <20120713154211.16682.23395.launchpad@ackee.canonical.com> Date: Fri, 13 Jul 2012 15:42:11 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="15614"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: f000b6c14f6bef435222567d5752eaa2725a7797 X-Gm-Message-State: ALoCoQmnkqlwuunJcVIuRBwLqT9nYPVjPYVFbZd2cT+NTDNqB4mwRG1R9I3RF8Y2rqWuOuhtzZAI ------------------------------------------------------------ revno: 86 committer: Jesse Barker branch nick: trunk timestamp: Fri 2012-07-13 08:40:15 -0700 message: CompositeTestSimpleFade: Fix the set up and update of the Fader object to allow for multiple runs with different (duration) parameters. Detected during the development of the similar "scale" test. modified: src/composite-test-simple-fade.cc src/composite-test.h --- 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-test-simple-fade.cc' --- src/composite-test-simple-fade.cc 2011-12-05 19:01:24 +0000 +++ src/composite-test-simple-fade.cc 2012-07-13 15:40:15 +0000 @@ -28,6 +28,7 @@ #include using std::string; +using std::list; const string CompositeTestSimpleFade::fade_bias_name_("alpha_bias"); @@ -53,11 +54,14 @@ uint64_t last_eof_; float bias_; float duration_; - Fader(); public: - Fader(const string& duration) : + Fader() : + start_time_(0), last_eof_(0), - bias_(0.0) + bias_(0.0), + duration_(0.0) {} + ~Fader() {} + void init(const string& duration) { // Convert the string representation of the duration in seconds // to microseconds as that's what we'll need to track the time. @@ -66,7 +70,6 @@ duration_ *= 1000000; start_time_ = Profiler::get_timestamp_us(); } - ~Fader() {} void update() { last_eof_ = Profiler::get_timestamp_us(); @@ -84,8 +87,17 @@ float bias() const { return bias_; } }; -void -CompositeTestSimpleFade::draw(std::list &window_list) +static Fader fader; + +void +CompositeTestSimpleFade::prepare_for_run(list& window_list) +{ + CompositeTestSimpleBase::prepare_for_run(window_list); + fader.init(options_["duration"].value); +} + +void +CompositeTestSimpleFade::draw(list& window_list) { vboData_.bind(); glActiveTexture(GL_TEXTURE0); @@ -100,7 +112,6 @@ glEnableVertexAttribArray(texcoordIndex_); program_[projection_matrix_name_] = projection_matrix.getCurrent(); - static Fader fader(options_["duration"].value); program_[fade_bias_name_] = fader.bias(); /* Find out how many windows are visible and calculate the angular step */ @@ -109,7 +120,7 @@ /* Draw the windows in a circle using the calculated angular step */ GLint i(0); - for(std::list::iterator iter = window_list.begin(); + for(list::iterator iter = window_list.begin(); iter != window_list.end(); ++iter) { CompositeWindow *comp_win = *iter; === modified file 'src/composite-test.h' --- src/composite-test.h 2012-03-09 03:58:54 +0000 +++ src/composite-test.h 2012-07-13 15:40:15 +0000 @@ -227,6 +227,7 @@ virtual void draw(std::list &window_list); virtual bool init_shaders(ShaderSource& vtx, ShaderSource& frg); + virtual void prepare_for_run(std::list& window_list); }; struct BlurPrivate;