2 * Copyright (C) 2017 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/single_window_composer_strategy.h"
19 #include "anbox/wm/manager.h"
20 #include "anbox/utils.h"
21 #include "anbox/logger.h"
24 const constexpr char *sprite_name{"Sprite"};
29 SingleWindowComposerStrategy::SingleWindowComposerStrategy(const std::shared_ptr<wm::Manager> &wm) : wm_(wm) {}
31 std::map<std::shared_ptr<wm::Window>, RenderableList> SingleWindowComposerStrategy::process_layers(const RenderableList &renderables) {
32 WindowRenderableList win_layers;
33 // FIXME there will be only one window in single-window mode ever so it
34 // doesn't matter which task
35 auto window = wm_->find_window_for_task(0);
37 // Filter out any unwanted layers like the one responsible for the mouse
38 // cursor which we don't want to render.
39 RenderableList final_renderables;
40 for (const auto &r : renderables) {
41 if (r.name() == sprite_name)
43 final_renderables.push_back(r);
46 win_layers.insert({window, final_renderables});
49 } // namespace graphics