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

« back to all changes in this revision

Viewing changes to src/server/graphics/program_factory.cpp

  • Committer: Package Import Robot
  • Author(s): Alexandros Frantzis
  • Date: 2015-10-08 16:12:19 UTC
  • mto: This revision was merged to the branch mainline in revision 109.
  • Revision ID: package-import@ubuntu.com-20151008161219-emk4a1ys51yy0wjb
Tags: upstream-0.17.0+15.10.20151008.2
Import upstream version 0.17.0+15.10.20151008.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
/*
3
 
 * Copyright © 2013 Canonical Ltd.
4
 
 *
5
 
 * This program is free software: you can redistribute it and/or modify it
6
 
 * under the terms of the GNU General Public License version 3,
7
 
 * as published by the Free Software Foundation.
8
 
 *
9
 
 * This program is distributed in the hope that it will be useful,
10
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
 
 * GNU General Public License for more details.
13
 
 *
14
 
 * You should have received a copy of the GNU General Public License
15
 
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16
 
 *
17
 
 * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
18
 
 */
19
 
 
20
 
#include "program_factory.h"
21
 
#include "mir/graphics/gl_program.h"
22
 
#include "mir/compositor/recently_used_cache.h"
23
 
 
24
 
namespace mg = mir::graphics;
25
 
 
26
 
std::unique_ptr<mg::GLProgram>
27
 
mg::ProgramFactory::create_gl_program(
28
 
    std::string const& vertex_shader,
29
 
    std::string const& fragment_shader) const
30
 
{
31
 
    std::lock_guard<decltype(mutex)> lock(mutex);
32
 
    return std::make_unique<SimpleGLProgram>(
33
 
        vertex_shader.c_str(), fragment_shader.c_str());
34
 
}
35
 
 
36
 
std::unique_ptr<mg::GLTextureCache> mg::ProgramFactory::create_texture_cache() const
37
 
{
38
 
    return std::make_unique<mir::compositor::RecentlyUsedCache>();
39
 
}