Commit e3b2e8d8 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Introduce methods for retrieving individual buffer dimensions

The new methods can be useful when one wants to get the size of the
buffer along some specific dimension, e.g. width or height.

Of course, size() could be used for this purpose, but with the new
helper methods, one has to type less.
parent 0665cacd
......@@ -314,6 +314,16 @@ wl_resource *BufferInterface::resource() const
return d->buffer;
}
int BufferInterface::width() const
{
return d->size.width();
}
int BufferInterface::height() const
{
return d->size.height();
}
QSize BufferInterface::size() const
{
return d->size;
......
......@@ -119,6 +119,14 @@ public:
**/
QImage data();
/**
* Returns the width of the buffer in device pixels.
*/
int width() const;
/**
* Returns the height of the buffer in device pixels.
*/
int height() const;
/**
* Returns the size of this BufferInterface.
* Note: only for shared memory buffers (shmBuffer) the size can be derived,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment