3
* Copyright © 2013 Canonical Ltd.
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.
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.
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/>.
17
* Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
20
#include "program_factory.h"
21
#include "mir/graphics/gl_program.h"
22
#include "mir/compositor/recently_used_cache.h"
24
namespace mg = mir::graphics;
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
31
std::lock_guard<decltype(mutex)> lock(mutex);
32
return std::make_unique<SimpleGLProgram>(
33
vertex_shader.c_str(), fragment_shader.c_str());
36
std::unique_ptr<mg::GLTextureCache> mg::ProgramFactory::create_texture_cache() const
38
return std::make_unique<mir::compositor::RecentlyUsedCache>();