Mir
command_stream_sync.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2016 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser 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 Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
17  */
18 
19 #ifndef MIR_GRAPHICS_COMMAND_STREAM_SYNC_H_
20 #define MIR_GRAPHICS_COMMAND_STREAM_SYNC_H_
21 
22 #include <chrono>
23 
24 namespace mir
25 {
26 namespace graphics
27 {
29 {
30 public:
31  //insert a sync object into the GL command stream of the current context.
32  // \warning the calling thread should have a current egl context and display
33  virtual void raise() = 0;
34  // remove fence without waiting.
35  virtual void reset() = 0;
36  //wait for fence.
37  // \ param [in] ns The amount of time to wait for the fence to become signalled
38  // \ returns true if the fence was signalled, false if timeout
39  virtual bool wait_for(std::chrono::nanoseconds ns) = 0;
40 
41  virtual ~CommandStreamSync() = default;
42  CommandStreamSync() = default;
43  CommandStreamSync(CommandStreamSync const&) = delete;
45 };
46 
47 
48 }
49 }
50 
51 #endif /* MIR_GRAPHICS_COMMAND_STREAM_SYNC_H_ */
CommandStreamSync & operator=(CommandStreamSync const &)=delete
All things Mir.
Definition: atomic_callback.h:25
virtual bool wait_for(std::chrono::nanoseconds ns)=0
Definition: command_stream_sync.h:28
virtual ~CommandStreamSync()=default

Copyright © 2012-2015 Canonical Ltd.
Generated on Wed Mar 30 00:29:56 UTC 2016