~albaguirre/mir/fix-1285215

« back to all changes in this revision

Viewing changes to tests/acceptance-tests/test_surfaces_with_output_id.cpp

  • Committer: Alberto Aguirre
  • Date: 2014-04-08 14:38:27 UTC
  • mfrom: (1537.1.4 development-branch)
  • Revision ID: alberto.aguirre@canonical.com-20140408143827-via2ic0tisu0uy4f
mergeĀ lp:mir/devel

Show diffs side-by-side

added added

removed removed

Lines of Context:
153
153
            verification_thread = std::thread([this](){
154
154
                verify_scene.exec([this]
155
155
                {
156
 
                    auto scene = the_scene();
157
 
 
158
 
                    struct VerificationFilter : public mc::FilterForScene
159
 
                    {
160
 
                        bool operator()(mg::Renderable const& rend)
161
 
                        {
162
 
                            rects.push_back(rend.screen_position());
163
 
                            return false;
164
 
                        }
165
 
 
166
 
                        std::vector<geom::Rectangle> rects;
167
 
                    } filter;
168
 
 
169
 
                    struct NullOperator : public mc::OperatorForScene
170
 
                    {
171
 
                        void operator()(mg::Renderable const&) {}
172
 
                    } null_operator;
173
 
 
174
 
                    scene->for_each_if(filter, null_operator);
 
156
                    std::vector<geom::Rectangle> rects;
 
157
                    auto list = the_scene()->generate_renderable_list();
 
158
                    for(auto &rend : list) 
 
159
                        rects.push_back(rend->screen_position());
175
160
 
176
161
                    auto display_rects = graphics_platform->display_rects();
177
162
                    std::sort(display_rects.begin(), display_rects.end(), RectangleCompare());
178
 
                    std::sort(filter.rects.begin(), filter.rects.end(), RectangleCompare());
179
 
                    EXPECT_EQ(display_rects, filter.rects);
 
163
                    std::sort(rects.begin(), rects.end(), RectangleCompare());
 
164
                    EXPECT_EQ(display_rects, rects);
180
165
                });
181
166
            });
182
167
        }