~ubuntu-branches/ubuntu/wily/mir/wily-proposed

« back to all changes in this revision

Viewing changes to src/server/compositor/recently_used_cache.cpp

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release
  • Date: 2014-10-10 14:01:26 UTC
  • mto: This revision was merged to the branch mainline in revision 84.
  • Revision ID: package-import@ubuntu.com-20141010140126-n1czko8na1kuz4ll
Tags: upstream-0.8.0+14.10.20141010
ImportĀ upstreamĀ versionĀ 0.8.0+14.10.20141010

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    auto& texture = textures[renderable.id()];
33
33
    texture.texture->bind();
34
34
 
35
 
    if (texture.last_bound_buffer != buffer_id)
 
35
    if ((texture.last_bound_buffer != buffer_id) || (!texture.valid_binding))
36
36
    {
37
37
        buffer->gl_bind_to_texture();
38
38
        texture.resource = buffer;
39
39
        texture.last_bound_buffer = buffer_id;
40
40
    }
 
41
    texture.valid_binding = true;
41
42
    texture.used = true;
42
43
 
43
44
    return texture.texture;
45
46
 
46
47
void mc::RecentlyUsedCache::invalidate()
47
48
{
48
 
    mg::BufferID invalid_id;
49
49
    for (auto &t : textures)
50
 
        t.second.last_bound_buffer = invalid_id;
 
50
        t.second.valid_binding = false;
51
51
}
52
52
 
53
53
void mc::RecentlyUsedCache::drop_unused()