| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Reviewed-by: Tom
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QGLPaintDevice::format() was returning the context's format, not
the format of the window surface's FBO. This caused the OpenGL1
paint engine to think that the window didn't have depth and
stencil buffers, even though the FBO most certainly did.
This change makes QGLPaintDevice::format() virtual and overrides it
in QGLFBOGLPaintDevice to return an updated format that includes
the context parameters plus the extra features that the FBO supports.
Reviewed-by: Tom Cooksey
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
|
|
|
|
|
| |
This is the last patch in the QGLPaintDevice series. Although previous
patches have not been reviewed individually, Samuel's reviewed
QGLPaintDevice API and all the changes as the code stands with this
patch.
Reviewed-by: Samuel
|
|
|
|
|
|
|
|
|
|
| |
This patch changes the ordering of QGL2PaintEngine::begin a bit because
QGLPixmapData needs to use the paint engine's drawTexture method within
beginPaint().
Also, this initialises needsSync to true and removes the setState call.
So now all the state initialisation is done in ensureActive rather than
begin.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, the paint engine cleared the surface's buffers in begin.
This logic really belongs in QGLPaintDevice::beginPaint as not all paint
devices will want this behaviour (in fact most don't). This also makes
QGLPaintDevice API much simpler as the virtual getters for the clear
color, etc. can be removed. It's much cleaner this way. The only
possible problem is with the GL1 engine, which also cleared the
accumulation & depth buffers in begin. However, the engine will also
clear the depth buffer later as part of it's clipping logic. It also
doesn't use the accumulation buffer, so clearing it seems unnessisary.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch also refactors QGL2PaintEngineEx::ensureActive() and the
logic which handles multiple paint engines rendering to the same
QGLContext. In a nut-shell:
* QGLPaintDevice::beginPaint() stores the currently bound FBO
* QGLPaintDevice::ensureActiveTarget() makes sure that GL rendering will
end up in the paint device (I.e. the right context is current and the
right FBO is bound). If a different context or FBO was bound, it is
_not_ remembered.
* QGLPaintDevice::endPaint() restores whatever FBO was bound when
beginPaint() was called.
This logic allows interleaved painter rendering to multiple FBOs and
contexts to work as expected. It also allows a stacked begin/end to work
properly when it's mixed with native GL rendering (as far as current
render target is concerened. GL state clobbering is obviously a
different topic).
QGLPaintDevice::context() also had to be made virtual as there's no good
place to call setContext. This might be possible to change in the future
though.
Finally, to make this work, QGLFramebufferObjectPrivate had to be moved
into it's own private header.
|
|
This patch adds a new abstract base class which inherits from
QPaintDevice called QGLPaintDevice. This base class will contain
everything the GL paint engines need to know about the surface they are
drawing onto. As such, new surfaces can be targeted by the GL paint
engines without having to modify QtOpenGL. This is very useful for
plugins, specifically QGraphicsSystem plugins.
To unify things a little, the GL paint engines will use the same
QGLPaintDevice API to render into existing target surfaces (QGLWidget,
QGLPixelBuffer & QGLFrameBufferObject). Ideally we'd make QGLPaintDevice
a common ancestor for these surfaces, but obviously that wil break B/C.
This patch only implements QGLWidget using the new interface. Rendering
to other surfaces will be fixed in following patches.
|