~cemil-azizoglu/mir/improve-raii-take2

« back to all changes in this revision

Viewing changes to include/platform/mir/graphics/display.h

  • Committer: Cemil Azizoglu
  • Date: 2015-02-26 23:37:35 UTC
  • mfrom: (2323.1.24 development-branch)
  • Revision ID: cemil.azizoglu@canonical.com-20150226233735-zm2j3eunf26b2hgb
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
typedef std::function<bool()> DisplayResumeHandler;
40
40
typedef std::function<void()> DisplayConfigurationChangeHandler;
41
41
 
 
42
/* DisplaySyncGroup allows for multiple displays to be posted together.
 
43
 * A DisplayGroup containing multiple DisplayBuffers should only be used
 
44
 * by platforms that have a nonblocking post implemenation. 
 
45
 * One DisplayBuffer per DisplaySyncGroup is preferable for platforms that
 
46
 * wait for the post to complete.
 
47
 */
 
48
class DisplaySyncGroup
 
49
{
 
50
public:
 
51
    /**
 
52
     *  Executes a functor that allows the DisplayBuffer contents to be updated
 
53
    **/
 
54
    virtual void for_each_display_buffer(std::function<void(DisplayBuffer&)> const& f) = 0;
 
55
 
 
56
    /** Post the content of the DisplayBuffers associated with this DisplaySyncGroup.
 
57
     *  The content of all the DisplayBuffers in this DisplaySyncGroup are guaranteed to be onscreen
 
58
     *  in the near future. On some platforms, this may wait a potentially long time for vsync. 
 
59
    **/
 
60
    virtual void post() = 0;
 
61
    virtual ~DisplaySyncGroup() = default;
 
62
protected:
 
63
    DisplaySyncGroup() = default;
 
64
    DisplaySyncGroup(DisplaySyncGroup const&) = delete;
 
65
    DisplaySyncGroup& operator=(DisplaySyncGroup const&) = delete;
 
66
};
 
67
 
42
68
/**
43
69
 * Interface to the display subsystem.
44
70
 */
46
72
{
47
73
public:
48
74
    /**
49
 
     * Executes a functor for each output framebuffer.
 
75
     * Executes a functor for each output group.
50
76
     */
51
 
    virtual void for_each_display_buffer(std::function<void(DisplayBuffer&)> const& f) = 0;
 
77
    virtual void for_each_display_sync_group(std::function<void(DisplaySyncGroup&)> const& f) = 0;
52
78
 
53
79
    /**
54
80
     * Gets a copy of the current output configuration.