Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
rendering_tracker.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014 Canonical Ltd.
3  *
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,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17  */
18 
19 #ifndef MIR_SCENE_RENDERING_TRACKER_H_
20 #define MIR_SCENE_RENDERING_TRACKER_H_
21 
23 
24 #include <memory>
25 #include <set>
26 #include <mutex>
27 
28 #include "mir_toolkit/common.h"
29 
30 namespace mir
31 {
32 namespace scene
33 {
34 
35 class Surface;
36 
38 {
39 public:
40  RenderingTracker(std::weak_ptr<Surface> const& weak_surface);
41 
44  void active_compositors(std::set<compositor::CompositorID> const& cids);
45 
46 private:
47  bool occluded_in_all_active_compositors();
48  void configure_visibility(MirSurfaceVisibility visibility);
49  void remove_occlusions_for_inactive_compositors();
50  void ensure_is_active_compositor(compositor::CompositorID cid) const;
51 
52  std::weak_ptr<Surface> const weak_surface;
53  std::set<compositor::CompositorID> occlusions;
54  std::set<compositor::CompositorID> active_compositors_;
55  std::mutex guard;
56 };
57 
58 }
59 }
60 
61 #endif
All things Mir.
Definition: aging_buffer.h:24
RenderingTracker(std::weak_ptr< Surface > const &weak_surface)
Definition: rendering_tracker.cpp:30
void rendered_in(compositor::CompositorID cid)
Definition: rendering_tracker.cpp:36
MirSurfaceVisibility
Definition: common.h:83
void const * CompositorID
Definition: compositor_id.h:27
void active_compositors(std::set< compositor::CompositorID > const &cids)
Definition: rendering_tracker.cpp:59
void occluded_in(compositor::CompositorID cid)
Definition: rendering_tracker.cpp:47
Definition: rendering_tracker.h:37

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Oct 10 14:07:14 UTC 2014