~andreas-pokorny/mir/configure-clear-color

« back to all changes in this revision

Viewing changes to tests/unit-tests/compositor/test_default_display_buffer_compositor.cpp

  • Committer: Tarmac
  • Author(s): Daniel van Vugt
  • Date: 2014-01-10 03:23:02 UTC
  • mfrom: (1300.4.26 texture-cache)
  • Revision ID: tarmac-20140110032302-k01lhun9uhg6gu3i
Cache surface textures on the GPU to eliminate duplicate uploads.

At the moment GLRenderer is unconditionally uploading a new copy of every
visible surface to the GPU, on every frame. This branch changes that to
only upload textures for visible surfaces when they change.

In a realistic GUI with multiple surfaces where most of them don't change
on every frame, this eliminates most of the texture copies. So performance
with multiple visible surfaces should be greatly increased.

Also resolves bug: LP: #1263592. Fixes: https://bugs.launchpad.net/bugs/1263592.

Approved by PS Jenkins bot, Alexandros Frantzis, Alan Griffiths, Robert Carr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
123
123
        renderer->end();
124
124
    }
125
125
 
 
126
    void suspend() override
 
127
    {
 
128
        renderer->suspend();
 
129
    }
 
130
 
126
131
    mc::Renderer* const renderer;
127
132
};
128
133
 
250
255
    renderable_vec.push_back(&small);
251
256
    renderable_vec.push_back(&fullscreen);
252
257
 
 
258
    EXPECT_CALL(renderer_factory.mock_renderer, suspend())
 
259
        .Times(1);
253
260
    EXPECT_CALL(renderer_factory.mock_renderer, begin())
254
261
        .Times(0);
255
262
    EXPECT_CALL(renderer_factory.mock_renderer, render(Ref(small),_))
305
312
 
306
313
    Sequence render_seq;
307
314
 
 
315
    EXPECT_CALL(renderer_factory.mock_renderer, suspend())
 
316
        .Times(0);
308
317
    EXPECT_CALL(display_buffer, make_current())
309
318
        .InSequence(render_seq);
310
319
    EXPECT_CALL(renderer_factory.mock_renderer, begin())