Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
buffer_writer.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 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: Robert Carr <robert.carr@canonical.com>
17  */
18 
19 #include <cstddef>
20 
21 namespace mir
22 {
23 namespace graphics
24 {
25 class Buffer;
26 
29 {
30 public:
31  virtual ~BufferWriter() = default;
32 
33  // Expects data to be an unstrided array containing (buffer.width * buffer.height) pixels. Likewise
34  // it is expected that buffer and data match in pixel format.
35  virtual void write(Buffer& buffer, unsigned char const* data, size_t size) = 0;
36 
37 protected:
38  BufferWriter() = default;
39  BufferWriter(BufferWriter const&) = delete;
40  BufferWriter& operator=(BufferWriter const&) = delete;
41 };
42 
43 }
44 }
All things Mir.
Definition: aging_buffer.h:24
BufferWriter & operator=(BufferWriter const &)=delete
virtual void write(Buffer &buffer, unsigned char const *data, size_t size)=0
virtual ~BufferWriter()=default
An interface provided by the graphics platform allowing for writing untiled pixel data into buffers...
Definition: buffer_writer.h:28
Definition: buffer.h:34
int const size
Definition: make_socket_rpc_channel.cpp:51

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