2 * Copyright (C) 2016 Simon Fels <morphis@gravedo.de>
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3, as published
6 * by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranties of
10 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 #include "anbox/graphics/layer_composer.h"
19 #include "anbox/graphics/emugl/Renderer.h"
20 #include "anbox/logger.h"
21 #include "anbox/wm/manager.h"
25 LayerComposer::LayerComposer(const std::shared_ptr<Renderer> renderer, const std::shared_ptr<Strategy> &strategy)
26 : renderer_(renderer), strategy_(strategy) {}
28 LayerComposer::~LayerComposer() {}
30 void LayerComposer::submit_layers(const RenderableList &renderables) {
31 auto win_layers = strategy_->process_layers(renderables);
32 for (auto &w : win_layers) {
33 renderer_->draw(w.first->native_handle(),
34 Rect{0, 0, w.first->frame().width(), w.first->frame().height()},
38 } // namespace graphics