A paint buffer based on OpenGL pixel buffers, using hardware accelerated rendering. More...
Public Functions | |
QCPPaintBufferGlPbuffer (const QSize &size, double devicePixelRatio, int multisamples) | |
virtual QCPPainter * | startPainting () |
virtual void | draw (QCPPainter *painter) const |
void | clear (const QColor &color) |
Public Functions inherited from QCPAbstractPaintBuffer | |
QCPAbstractPaintBuffer (const QSize &size, double devicePixelRatio) | |
QSize | size () const |
bool | invalidated () const |
double | devicePixelRatio () const |
void | setSize (const QSize &size) |
void | setInvalidated (bool invalidated=true) |
void | setDevicePixelRatio (double ratio) |
virtual void | donePainting () |
Protected Functions | |
virtual void | reallocateBuffer () |
A paint buffer based on OpenGL pixel buffers, using hardware accelerated rendering.
This paint buffer is one of the OpenGL paint buffers which facilitate hardware accelerated plot rendering. It is based on OpenGL pixel buffers (pbuffer) and is used in Qt versions before 5.0. (See QCPPaintBufferGlFbo used in newer Qt versions.)
The OpenGL paint buffers are used if QCustomPlot::setOpenGl is set to true, and if they are supported by the system.
|
explicit |
Creates a QCPPaintBufferGlPbuffer instance with the specified size and devicePixelRatio, if applicable.
The parameter multisamples defines how many samples are used per pixel. Higher values thus result in higher quality antialiasing. If the specified multisamples value exceeds the capability of the graphics hardware, the highest supported multisampling is used.
|
virtual |
Returns a QCPPainter which is ready to draw to this buffer. The ownership and thus the responsibility to delete the painter after the painting operations are complete is given to the caller of this method.
Once you are done using the painter, delete the painter and call donePainting.
While a painter generated with this method is active, you must not call setSize, setDevicePixelRatio or clear.
This method may return 0, if a painter couldn't be activated on the buffer. This usually indicates a problem with the respective painting backend.
Implements QCPAbstractPaintBuffer.
|
virtual |
Draws the contents of this buffer with the provided painter. This is the method that is used to finally join all paint buffers and draw them onto the screen.
Implements QCPAbstractPaintBuffer.
|
virtual |
Fills the entire buffer with the provided color. To have an empty transparent buffer, use the named color Qt::transparent
.
This method must not be called if there is currently a painter (acquired with startPainting) active.
Implements QCPAbstractPaintBuffer.
|
protectedvirtual |
Reallocates the internal buffer with the currently configured size (setSize) and device pixel ratio, if applicable (setDevicePixelRatio). It is called as soon as any of those properties are changed on this paint buffer.
Implements QCPAbstractPaintBuffer.