| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The patch tries to use texture_from_pixmap extentions on glX to properly
bind an X Pixmap to a texture in QGLContextPrivate::bindTexture(QPixmap,).
Because GL & X have different coordinate systems, the pixmap will be
inverted about the y-axis. The extension does however allow a
GLX_Y_INVERTED_EXT attribute to be set which will bind the pixmap the
correct way up. If the underlying driver doesn't support this,
texture_from_pixmap can't be used for QGLContext::bindTexture, because
that function expects the resulting texture to be the right way up.
However, it can still be used internally by the paint engine for
drawPixmap operations. For these cases, if the pixmap is inverted, the
paint engine can simply invert the texture coords to compensate. This is
why this patch also moves QGLTexture into qgl_p.h.
QGLContextPrivate::bindTexture(QPixmap,) now returns a QGLTexture which
the paint engine can inspect to see if it needs to invert the texture
coords.
Finally, it seems on some (probably all) drivers, deleting an X pixmap
which has been bound to a texture before calling glFinish/swapBuffers
renders garbage. Presumably this is because X deletes the pixmap behind
the driver's back before it's had a chance to use it. To fix this, we
reference all QPixmaps which have been bound to stop them being deleted
and only deref them after we swap the buffer, when they can be safely
deleted.
Reviewed-By: Kim
|
|
|
|
|
|
|
| |
When premultiplying a color with the opacity, the color's alpha channel
was not set correcly.
Reviewed-by: Tom
|
|
|
|
|
|
|
| |
Texture filtering was set before binding the texture, so the gradient
spread was not set correctly.
Reviewed-by: Tom
|
|
|
|
| |
Reviewed-by: Tom
|
|
|
|
| |
Reviewed-by: Tom
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I added a QGLContextResource class which can be used internally in Qt
for sharing resources between contexts. The QGLContextResource is a
hash map where the context is used as 'key', and the resource is the
'value'. All the sharing contexts point to the same resource, and the
resource is automatically deleted when it is not referenced any more.
Now, the shader manager uses the QGLContextResource class.
I also added a pointer to a struct in the QGLContextPrivate class. The
struct is shared between all the sharing contexts and is deleted
automatically. Currently, the struct only contains the resolved OpenGL
function pointers.
The shared context register code has been simplified.
Reviewed-by: Tom
|
|
|
|
|
|
|
|
|
|
|
| |
When copying a glyph image into the glyph cache, garbage appeared in
the glyph cache in the lower part of the destination rectangle. This
happened whenever the glyph image's width was not a multiple of four
bytes. I suppose this is a driver bug (nVidia). As a workaround, I
converted the glyph image to ARGB32 such that the width is guaranteed
to be a multiple of four bytes.
Reviewed-by: Tom
|
|
|
|
|
|
| |
Simplified caching of uniform locations.
Reviewed-by: Samuel
|
|
|
|
|
|
|
| |
Need to call syncState() to let the paint engine set depth clipping
state parameters back to their OpenGL defaults.
Reviewed-by: Trond
|
|
|
|
|
|
|
| |
This could potentially crash when a context was destroyed before
the actual font engine holding the QGLTextureGlyphCache was destroyed.
Reviewed-by: Samuel
|
|
|
|
|
|
|
|
| |
Make sure a QPixmap gets an alpha channel when filled with a non-opaque
color, and fix issues where shader manager did not active correct shader
program.
Reviewed-by: Tom
|
|
|
|
|
|
|
|
|
| |
The sync() function properly sets up the state to allow using raw
OpenGL commands with an active QPainter, but we also need to properly
restore the state after sync() has been called and some other painting
operation is done.
Reviewed-by: Trond
|
|
|
|
|
|
|
|
|
|
|
| |
The gl_Position x, y, and z coordinates are always divided by the
homogenuous w coordinate to yield the final coordinates. Since we want
the depth to be constant for the whole item we need to premultiply it by
the w-coordinate. We can do this in the main() function in the vertex
programs since all the vertex programs use the depth uniform, thus
simplifying the programs a bit.
Reviewed-by: Trond
|
|
|
|
|
|
|
| |
Keep track of uniform locations for the current shader program in the
shader manager. Also don't change texture parameters unless necessary.
Reviewed-by: Kim
|
|
|
|
| |
Reviewed-by: Samuel
|
|
|
|
| |
Reviewed-by: Trust Me
|
|\ |
|
| |
| |
| |
| | |
Reviewed-by: Trust Me
|
| |
| |
| |
| |
| |
| |
| |
| | |
The new glyph cache may return null images for e.g. space characters.
Task-number: 253468
Reviewed-by: Samuel
BT: yes
|
| |
|
|
|
|
|
|
|
| |
Switching multisampling is not supported in GLES 2.0, but it's supported
in GL 2.0 so we should do it on desktop at least.
Reviewed-by: Trond
|
|
|
|
|
|
|
|
|
| |
QPixmap shouldn't return true in hasAlphaChannel() for bitmaps, instead
the paint engine should check whether the pixmap is a bitmap or not. In
addition, QBrush::isOpaque() returned true for bitmap brushes, which is
wrong according to the documentation.
Reviewed-by: Trond
|
|
|
|
|
| |
Calling premultiplyColor() with a red channel of 255, alpha channel of
255, and opacity 1 would result in a color with red channel of 254.
|
|
|
|
|
|
|
|
|
| |
The pen color should be used when drawPixmap is called with a bitmap,
and the brush color should be used for texture patterns that are
bitmaps.
Task-number: 245802
Reviewed-by: Trond
|
|
|
|
|
|
|
|
| |
Based on Zack's patch, 17e1bca1ce366395f8331e16aa96b7176ca1abac. Instead
of manually clearing the stencil buffer after drawing we simply do the
clearing and drawing in one go.
Reviewed-by: Trond
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use the stencil method to draw clip paths and regions to the Z-buffer
instead of using glClear / glScissor. Using different depth values for
the various clip parts also makes restore() very cheap when only
IntersectClip is used.
As an additional bonus this patch gives antialiased clip in the GL 2
paint engine.
Task-number: 254658
Reviewed-by: Trond
|
|
|
|
|
|
|
|
| |
An alternative solution is to swap the order of
-I../../include and -I../../include/QtOpenGL when
compiling the opengl module.
Reviewed-by: TrustMe
|
|
|
|
|
|
|
| |
seem fixable easily)
Merge-request: 594
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
|
|
|
|
|
| |
Task-number: QT-80
Reviewed-by: Ian Walters
|
|
|
|
|
|
|
|
|
| |
Now there's only a copy of the texture glyph cache in graphics memory,
avoiding the system memory copy that we used earlier. In addition the
texture will use the GL_ALPHA texture format when possible, making it
consume less graphics memory as well.
Reviewed-by: Tom
|
|
|
|
|
|
|
|
|
|
|
|
| |
To allow mixing QPainter and raw OpenGL commands we need to have some
way for the user to say that's he's about to use raw OpenGL so that we
are free to do buffering optimizations in the paint engines and use
either GL1 or GL2 paint engine. As there's already a syncState()
function in QPaintEngine we've reused this and added
QPaintEngineEx::sync() which takes care of syncing/flushing the paint
engine.
Reviewed-by: Trond
|
|
|
|
|
| |
Make sure the correct texture unit is active when copying from the
pixmap to the FBO in begin().
|
|
|
|
|
|
|
|
| |
Even if the source pixels are opaque we have to enable blending for the
non-trivial composition modes. Some of the composition modes are
independent of source alpha and depend on destination alpha for example.
Reviewed-by: Tom
|
| |
|
|
|
|
| |
Reviewed-by: Tom
|
|
|
|
|
|
|
|
| |
QWidgets are filled with Qt::transparent when WA_TranslucentBackground
is set, reguardless of what their background colour has been set to.
This patch makes QGLWidgets behave the same way.
Reviewed-By: Samuel Rødal
|
|
|
|
|
|
|
| |
This patch enables QGLWidget's to have an ARGB visual on X11, alowing GL
rendering on semi-transparent windows.
Reviewed-By: Trond
|
|
|
|
|
|
|
| |
In the fill case we can simply set a flag saying the pixmap needs to be
filled, and then when painting on the pixmap we start by filling the
background using glClear via the existing
QGLDrawable::autoFillBackground interface.
|
|
|
|
|
|
|
| |
Make sure makeCurrent() on a window surface unbinds any active FBO, and
simplify ensureActive() code in GL2 paint engine a bit. We don't need
the last_engine pointer as ensureActive() will take care of ensuring the
correct engine is active anway.
|
|
|
|
|
|
| |
Override systemStateChanged() to get the system clip updates.
Reviewed-by: Trond
|
| |
|
|
|
|
| |
Reviewed-by: Trond
|
| |
|
|
|
|
|
|
|
| |
Compile both GL and GL2 paint engine on desktop, and choose between them
at run-time based on GL version flags.
Reviewed-by: Tom
|
|\
| |
| |
| |
| | |
Conflicts:
src/gui/painting/qpaintengine_raster.cpp
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Clean up the extension naming and make things build on OpenGL ES 2.0
again. All the extensions which made it into OpenGL 2.0 spec have have
the EXT postfix removed. This also eliminates defines on ES 2.0 as the
code now refers to the in-spec names.
Reviewed-by: sroedal
|
| |
| |
| |
| | |
Reviewed-by: trustme
|
|/ |
|
|
|
|
| |
The list of shaders shouldn't change too much now.
|
|
|
|
|
| |
Returns true if it had to change the shader program so the engine knows
it needs to clean the uniforms.
|