| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Reviewed-by: Tom
|
|\ |
|
| |
| |
| |
| | |
Reviewed-by: Trust Me
|
| | |
|
|\ \
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/opengl/gl2paintengineex/qglengineshadermanager.cpp
src/opengl/gl2paintengineex/qglengineshadermanager_p.h
src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
Merge custom shader / GL blur pixmap filter implementation from graphics
team repo with implementation from kinetic graphics-team repo.
|
| |
| |
| |
| |
| | |
The FBO pool will be useful in other places as well, plus it makes it
easier to deal with graphics memory management issues.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 an extern function is declared in the scope of another function,
MSVC sometimes ignores the enclosing namespace {}.
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change moves the w, h, d variables to QPixmapData and introduces
is_null to keep track of nullness. This is possible only because
QPixmapData is internal API; otherwise we'd have to be smarter.
The optimization makes the QPixmap::width() function take 7 instructions,
down from 34 before. For the calculator demo in the declarative ui branch
this reduces a block of 750000 instructions (out of 30000000) to around
100000-150000 instructions.
Tested on Windows, Linux, Mac. Raster, X11 and OpenGL paint engines. Have
not tested the DirectFB engine.
Reviewed-by: Trond
|
|
|
|
|
|
|
|
|
|
|
|
| |
If creating a QGLWidget triggers the creation of a QPixmap then we might
end up in an infinite recursion due to QPixmap trying to access
qt_gl_share_widget(). This can happen via setWindowIcon for example.
Adding an initializing flag to QGLGlobalShareWidget and preventing
QGLFramebufferObject::hasOpenGLFramebufferObjects() and
::hasOpenGLFramebufferBlit() from creating a QGLWidget every time they
are called with no active GL context.
Reviewed-by: Trond
|
|\ |
|
| |
| |
| |
| | |
Reviewed-by: Trust Me
|
| |
|
|
|
|
|
|
|
| |
GL window surface and GL pixmap backend should work with old GL engine
as well, though not supported to the same degree.
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The window surface has been modified to track widget deletion to make
sure it doesn't try to access the widget's context data after deletion.
QGLPixmapData now also uses GL_RGB instead of GL_RGBA when appropriate,
and hasAlphaChannel() has been modified in view of this.
A number of other issues have been fixed in QGLPixmapData, and the
autotest has been modified to use a more lenient pixmap compare function
due to off-by-one pixel errors here and there.
Reviewed-by: Trond
|
|
|
|
|
|
|
|
| |
If we're painting to very wide and then very tall pixmaps we don't want
the FBO to grow to max_width * max_height, instead we should recreate
the FBO if it grows too large compared to what's being painted.
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.
|
|
|
|
|
|
|
| |
When not setting filtering mode to GL_NEAREST/GL_LINEAR copying back
from FBO to texture fails for some reason.
Reviewed-by: Trond
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using GL 2 as default engine breaks the use cases where OpenGL commands
are inter-mixed with QPainter commands, such as when using raw OpenGL in
graphicsview.
For now we'll use the old OpenGL engine for QGLWidget, QGLPixelBuffer,
and QGLFramebufferObject on desktop, and the OpenGL 2 paint engine when
the OpenGL graphics system is used.
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
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the case where a GL pixmap is used when there it still has an active
engine we need to ensure that the pixmap has been flushed from the
render FBO first. The newly added QGLPixmapData::copyBackFromRenderFbo()
handles this.
In addition, because several GL 2 paint engines can be active on the same
context at the same time, we can't make any assumptions and need to call
the newly added QGL2PaintEngineEx::ensureCreated() in the beginning of
any state-dependent paint engine function.
QGL2PaintEngineEx::ensureCreated() correctly transfers control to the
current engine if a different engine is active.
Running lance with -pixmap and -graphicssystem opengl works correctly
with the GL pixmap backend now.
|
|
|
|
|
|
|
|
| |
We now use FBOs to implement render-to-pixmap for the GL pixmap backend.
A multisample FBO is used for rendering, and is then blitted onto a
non-multisample FBO dynamically bound to the relevant texture.
Reviewed-by: Tom
|
| |
|
|
|