Build on Windows/clean build on Linux.
Change-Id: I26552e85a8e8c63002db93b7d9b645981620f0af Reviewed-on: http://codereview.qt.nokia.com/3738 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
This commit is contained in:
parent
c1ccf69226
commit
cf9a304e6e
@ -85,7 +85,7 @@ private:
|
|||||||
class Q_GUI_EXPORT QOpenGLContext : public QObject
|
class Q_GUI_EXPORT QOpenGLContext : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_DECLARE_PRIVATE(QOpenGLContext);
|
Q_DECLARE_PRIVATE(QOpenGLContext)
|
||||||
public:
|
public:
|
||||||
QOpenGLContext(QObject *parent = 0);
|
QOpenGLContext(QObject *parent = 0);
|
||||||
~QOpenGLContext();
|
~QOpenGLContext();
|
||||||
|
@ -173,7 +173,7 @@ class QOpenGLFunctions;
|
|||||||
|
|
||||||
class Q_GUI_EXPORT QOpenGLContextPrivate : public QObjectPrivate
|
class Q_GUI_EXPORT QOpenGLContextPrivate : public QObjectPrivate
|
||||||
{
|
{
|
||||||
Q_DECLARE_PUBLIC(QOpenGLContext);
|
Q_DECLARE_PUBLIC(QOpenGLContext)
|
||||||
public:
|
public:
|
||||||
QOpenGLContextPrivate()
|
QOpenGLContextPrivate()
|
||||||
: qGLContextHandle(0)
|
: qGLContextHandle(0)
|
||||||
|
@ -24,7 +24,8 @@ HEADERS += opengl/qopengl.h \
|
|||||||
opengl/qrbtree_p.h \
|
opengl/qrbtree_p.h \
|
||||||
opengl/qtextureglyphcache_gl_p.h \
|
opengl/qtextureglyphcache_gl_p.h \
|
||||||
opengl/qopenglshadercache_p.h \
|
opengl/qopenglshadercache_p.h \
|
||||||
opengl/qopenglshadercache_meego_p.h
|
opengl/qopenglshadercache_meego_p.h \
|
||||||
|
opengl/qopenglcolormap.h
|
||||||
|
|
||||||
SOURCES += opengl/qopengl.cpp \
|
SOURCES += opengl/qopengl.cpp \
|
||||||
opengl/qopenglfunctions.cpp \
|
opengl/qopenglfunctions.cpp \
|
||||||
@ -39,6 +40,7 @@ SOURCES += opengl/qopengl.cpp \
|
|||||||
opengl/qopenglcustomshaderstage.cpp \
|
opengl/qopenglcustomshaderstage.cpp \
|
||||||
opengl/qtriangulatingstroker.cpp \
|
opengl/qtriangulatingstroker.cpp \
|
||||||
opengl/qtriangulator.cpp \
|
opengl/qtriangulator.cpp \
|
||||||
opengl/qtextureglyphcache_gl.cpp
|
opengl/qtextureglyphcache_gl.cpp \
|
||||||
|
opengl/qopenglcolormap.cpp
|
||||||
|
|
||||||
#INCLUDEPATH += ../3rdparty/harfbuzz/src
|
#INCLUDEPATH += ../3rdparty/harfbuzz/src
|
||||||
|
@ -63,6 +63,9 @@ typedef GLfloat GLdouble;
|
|||||||
# if defined(Q_OS_MAC)
|
# if defined(Q_OS_MAC)
|
||||||
# include <OpenGL/gl.h>
|
# include <OpenGL/gl.h>
|
||||||
# else
|
# else
|
||||||
|
# if defined(Q_OS_WIN)
|
||||||
|
# include <QtCore/qt_windows.h>
|
||||||
|
# endif
|
||||||
# include <GL/gl.h>
|
# include <GL/gl.h>
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -61,6 +61,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
QT_MODULE(Gui)
|
QT_MODULE(Gui)
|
||||||
|
|
||||||
|
class QPainter;
|
||||||
class QOpenGLCustomShaderStagePrivate;
|
class QOpenGLCustomShaderStagePrivate;
|
||||||
class Q_GUI_EXPORT QOpenGLCustomShaderStage
|
class Q_GUI_EXPORT QOpenGLCustomShaderStage
|
||||||
{
|
{
|
||||||
|
@ -72,7 +72,7 @@ typedef ptrdiff_t GLsizeiptrARB;
|
|||||||
typedef char GLchar;
|
typedef char GLchar;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct QOpenGLExtensionsPrivate;
|
class QOpenGLExtensionsPrivate;
|
||||||
|
|
||||||
class Q_GUI_EXPORT QOpenGLExtensions : public QOpenGLFunctions
|
class Q_GUI_EXPORT QOpenGLExtensions : public QOpenGLFunctions
|
||||||
{
|
{
|
||||||
@ -122,7 +122,7 @@ public:
|
|||||||
GLenum internalFormat,
|
GLenum internalFormat,
|
||||||
GLsizei width, GLsizei height);
|
GLsizei width, GLsizei height);
|
||||||
|
|
||||||
void glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
|
void glGetBufferSubData(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, GLvoid *data);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static bool isInitialized(const QOpenGLFunctionsPrivate *d) { return d != 0; }
|
static bool isInitialized(const QOpenGLFunctionsPrivate *d) { return d != 0; }
|
||||||
@ -130,9 +130,10 @@ private:
|
|||||||
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(QOpenGLExtensions::OpenGLExtensions)
|
Q_DECLARE_OPERATORS_FOR_FLAGS(QOpenGLExtensions::OpenGLExtensions)
|
||||||
|
|
||||||
struct QOpenGLExtensionsPrivate : public QOpenGLFunctionsPrivate
|
class QOpenGLExtensionsPrivate : public QOpenGLFunctionsPrivate
|
||||||
{
|
{
|
||||||
QOpenGLExtensionsPrivate(QOpenGLContext *ctx);
|
public:
|
||||||
|
explicit QOpenGLExtensionsPrivate(QOpenGLContext *ctx);
|
||||||
|
|
||||||
GLvoid* (QOPENGLF_APIENTRYP MapBuffer)(GLenum target, GLenum access);
|
GLvoid* (QOPENGLF_APIENTRYP MapBuffer)(GLenum target, GLenum access);
|
||||||
GLboolean (QOPENGLF_APIENTRYP UnmapBuffer)(GLenum target);
|
GLboolean (QOPENGLF_APIENTRYP UnmapBuffer)(GLenum target);
|
||||||
@ -142,7 +143,7 @@ struct QOpenGLExtensionsPrivate : public QOpenGLFunctionsPrivate
|
|||||||
void (QOPENGLF_APIENTRYP RenderbufferStorageMultisample)(GLenum target, GLsizei samples,
|
void (QOPENGLF_APIENTRYP RenderbufferStorageMultisample)(GLenum target, GLsizei samples,
|
||||||
GLenum internalFormat,
|
GLenum internalFormat,
|
||||||
GLsizei width, GLsizei height);
|
GLsizei width, GLsizei height);
|
||||||
void (QOPENGLF_APIENTRYP GetBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
|
void (QOPENGLF_APIENTRYP GetBufferSubData)(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, GLvoid *data);
|
||||||
};
|
};
|
||||||
|
|
||||||
inline GLvoid *QOpenGLExtensions::glMapBuffer(GLenum target, GLenum access)
|
inline GLvoid *QOpenGLExtensions::glMapBuffer(GLenum target, GLenum access)
|
||||||
@ -183,7 +184,7 @@ inline void QOpenGLExtensions::glRenderbufferStorageMultisample(GLenum target, G
|
|||||||
Q_OPENGL_FUNCTIONS_DEBUG
|
Q_OPENGL_FUNCTIONS_DEBUG
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void QOpenGLExtensions::glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data)
|
inline void QOpenGLExtensions::glGetBufferSubData(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, GLvoid *data)
|
||||||
{
|
{
|
||||||
Q_D(QOpenGLExtensions);
|
Q_D(QOpenGLExtensions);
|
||||||
Q_ASSERT(QOpenGLExtensions::isInitialized(d));
|
Q_ASSERT(QOpenGLExtensions::isInitialized(d));
|
||||||
|
@ -2332,7 +2332,7 @@ static void QOPENGLF_APIENTRY qopenglfResolveRenderbufferStorageMultisample(GLen
|
|||||||
(target, samples, internalFormat, width, height);
|
(target, samples, internalFormat, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void QOPENGLF_APIENTRY qopenglfResolveGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data)
|
static void QOPENGLF_APIENTRY qopenglfResolveGetBufferSubData(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, GLvoid *data)
|
||||||
{
|
{
|
||||||
RESOLVE_FUNC_VOID(ResolveEXT, GetBufferSubData)
|
RESOLVE_FUNC_VOID(ResolveEXT, GetBufferSubData)
|
||||||
(target, offset, size, data);
|
(target, offset, size, data);
|
||||||
|
@ -47,6 +47,8 @@
|
|||||||
#include <QtCore/qfile.h>
|
#include <QtCore/qfile.h>
|
||||||
#include <QtCore/qvarlengtharray.h>
|
#include <QtCore/qvarlengtharray.h>
|
||||||
#include <QtCore/qvector.h>
|
#include <QtCore/qvector.h>
|
||||||
|
#include <QtGui/qtransform.h>
|
||||||
|
#include <QtGui/QColor>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ QOpenGL2PaintEngineExPrivate::~QOpenGL2PaintEngineExPrivate()
|
|||||||
|
|
||||||
void QOpenGL2PaintEngineExPrivate::updateTextureFilter(GLenum target, GLenum wrapMode, bool smoothPixmapTransform, GLuint id)
|
void QOpenGL2PaintEngineExPrivate::updateTextureFilter(GLenum target, GLenum wrapMode, bool smoothPixmapTransform, GLuint id)
|
||||||
{
|
{
|
||||||
// glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT); //### Is it always this texture unit?
|
// funcs.glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT); //### Is it always this texture unit?
|
||||||
if (id != GLuint(-1) && id == lastTextureUsed)
|
if (id != GLuint(-1) && id == lastTextureUsed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -196,7 +196,7 @@ void QOpenGL2PaintEngineExPrivate::updateBrushTexture()
|
|||||||
// Get the image data for the pattern
|
// Get the image data for the pattern
|
||||||
QImage texImage = qt_imageForBrush(style, false);
|
QImage texImage = qt_imageForBrush(style, false);
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT);
|
funcs.glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT);
|
||||||
//ctx->d_func()->bindTexture(texImage, GL_TEXTURE_2D, GL_RGBA, QOpenGLContext::InternalBindOption);
|
//ctx->d_func()->bindTexture(texImage, GL_TEXTURE_2D, GL_RGBA, QOpenGLContext::InternalBindOption);
|
||||||
updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform);
|
updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform);
|
||||||
}
|
}
|
||||||
@ -209,7 +209,7 @@ void QOpenGL2PaintEngineExPrivate::updateBrushTexture()
|
|||||||
// for opacity to the cache.
|
// for opacity to the cache.
|
||||||
GLuint texId = QOpenGL2GradientCache::cacheForContext(ctx)->getBuffer(*g, 1.0);
|
GLuint texId = QOpenGL2GradientCache::cacheForContext(ctx)->getBuffer(*g, 1.0);
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT);
|
funcs.glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT);
|
||||||
glBindTexture(GL_TEXTURE_2D, texId);
|
glBindTexture(GL_TEXTURE_2D, texId);
|
||||||
|
|
||||||
if (g->spread() == QGradient::RepeatSpread || g->type() == QGradient::ConicalGradient)
|
if (g->spread() == QGradient::RepeatSpread || g->type() == QGradient::ConicalGradient)
|
||||||
@ -226,7 +226,7 @@ void QOpenGL2PaintEngineExPrivate::updateBrushTexture()
|
|||||||
if (currentBrushPixmap.width() > max_texture_size || currentBrushPixmap.height() > max_texture_size)
|
if (currentBrushPixmap.width() > max_texture_size || currentBrushPixmap.height() > max_texture_size)
|
||||||
currentBrushPixmap = currentBrushPixmap.scaled(max_texture_size, max_texture_size, Qt::KeepAspectRatio);
|
currentBrushPixmap = currentBrushPixmap.scaled(max_texture_size, max_texture_size, Qt::KeepAspectRatio);
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT);
|
funcs.glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT);
|
||||||
QOpenGLTexture *tex = 0;//ctx->d_func()->bindTexture(currentBrushPixmap, GL_TEXTURE_2D, GL_RGBA,
|
QOpenGLTexture *tex = 0;//ctx->d_func()->bindTexture(currentBrushPixmap, GL_TEXTURE_2D, GL_RGBA,
|
||||||
// QOpenGLContext::InternalBindOption |
|
// QOpenGLContext::InternalBindOption |
|
||||||
// QOpenGLContext::CanFlipNativePixmapBindOption);
|
// QOpenGLContext::CanFlipNativePixmapBindOption);
|
||||||
@ -582,7 +582,7 @@ void QOpenGL2PaintEngineEx::beginNativePainting()
|
|||||||
void QOpenGL2PaintEngineExPrivate::resetGLState()
|
void QOpenGL2PaintEngineExPrivate::resetGLState()
|
||||||
{
|
{
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
glActiveTexture(GL_TEXTURE0);
|
funcs.glActiveTexture(GL_TEXTURE0);
|
||||||
glDisable(GL_STENCIL_TEST);
|
glDisable(GL_STENCIL_TEST);
|
||||||
glDisable(GL_DEPTH_TEST);
|
glDisable(GL_DEPTH_TEST);
|
||||||
glDisable(GL_SCISSOR_TEST);
|
glDisable(GL_SCISSOR_TEST);
|
||||||
@ -1356,7 +1356,7 @@ void QOpenGL2PaintEngineEx::drawPixmap(const QRectF& dest, const QPixmap & pixma
|
|||||||
ensureActive();
|
ensureActive();
|
||||||
d->transferMode(ImageDrawingMode);
|
d->transferMode(ImageDrawingMode);
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0 + QT_IMAGE_TEXTURE_UNIT);
|
d->funcs.glActiveTexture(GL_TEXTURE0 + QT_IMAGE_TEXTURE_UNIT);
|
||||||
QOpenGLTexture *texture = 0;
|
QOpenGLTexture *texture = 0;
|
||||||
// ctx->d_func()->bindTexture(pixmap, GL_TEXTURE_2D, GL_RGBA, bindOptions);
|
// ctx->d_func()->bindTexture(pixmap, GL_TEXTURE_2D, GL_RGBA, bindOptions);
|
||||||
|
|
||||||
@ -1392,7 +1392,7 @@ void QOpenGL2PaintEngineEx::drawImage(const QRectF& dest, const QImage& image, c
|
|||||||
ensureActive();
|
ensureActive();
|
||||||
d->transferMode(ImageDrawingMode);
|
d->transferMode(ImageDrawingMode);
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0 + QT_IMAGE_TEXTURE_UNIT);
|
d->funcs.glActiveTexture(GL_TEXTURE0 + QT_IMAGE_TEXTURE_UNIT);
|
||||||
|
|
||||||
QOpenGLTexture *texture = 0;//ctx->d_func()->bindTexture(image, GL_TEXTURE_2D, GL_RGBA, bindOptions);
|
QOpenGLTexture *texture = 0;//ctx->d_func()->bindTexture(image, GL_TEXTURE_2D, GL_RGBA, bindOptions);
|
||||||
GLuint id = texture->id();
|
GLuint id = texture->id();
|
||||||
@ -1731,7 +1731,7 @@ void QOpenGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type
|
|||||||
|
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
glBlendFunc(GL_CONSTANT_COLOR, GL_ONE_MINUS_SRC_COLOR);
|
glBlendFunc(GL_CONSTANT_COLOR, GL_ONE_MINUS_SRC_COLOR);
|
||||||
glBlendColor(c.redF(), c.greenF(), c.blueF(), c.alphaF());
|
funcs.glBlendColor(c.redF(), c.greenF(), c.blueF(), c.alphaF());
|
||||||
} else {
|
} else {
|
||||||
// Other brush styles need two passes.
|
// Other brush styles need two passes.
|
||||||
|
|
||||||
@ -1748,7 +1748,7 @@ void QOpenGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type
|
|||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
glBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_COLOR);
|
glBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_COLOR);
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0 + QT_MASK_TEXTURE_UNIT);
|
funcs.glActiveTexture(GL_TEXTURE0 + QT_MASK_TEXTURE_UNIT);
|
||||||
glBindTexture(GL_TEXTURE_2D, cache->texture());
|
glBindTexture(GL_TEXTURE_2D, cache->texture());
|
||||||
updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, false);
|
updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, false);
|
||||||
|
|
||||||
@ -1783,7 +1783,7 @@ void QOpenGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type
|
|||||||
QOpenGLTextureGlyphCache::FilterMode filterMode = (s->matrix.type() > QTransform::TxTranslate)?QOpenGLTextureGlyphCache::Linear:QOpenGLTextureGlyphCache::Nearest;
|
QOpenGLTextureGlyphCache::FilterMode filterMode = (s->matrix.type() > QTransform::TxTranslate)?QOpenGLTextureGlyphCache::Linear:QOpenGLTextureGlyphCache::Nearest;
|
||||||
if (lastMaskTextureUsed != cache->texture() || cache->filterMode() != filterMode) {
|
if (lastMaskTextureUsed != cache->texture() || cache->filterMode() != filterMode) {
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0 + QT_MASK_TEXTURE_UNIT);
|
funcs.glActiveTexture(GL_TEXTURE0 + QT_MASK_TEXTURE_UNIT);
|
||||||
if (lastMaskTextureUsed != cache->texture()) {
|
if (lastMaskTextureUsed != cache->texture()) {
|
||||||
glBindTexture(GL_TEXTURE_2D, cache->texture());
|
glBindTexture(GL_TEXTURE_2D, cache->texture());
|
||||||
lastMaskTextureUsed = cache->texture();
|
lastMaskTextureUsed = cache->texture();
|
||||||
@ -1903,7 +1903,7 @@ void QOpenGL2PaintEngineExPrivate::drawPixmapFragments(const QPainter::PixmapFra
|
|||||||
allOpaque &= (opacity >= 0.99f);
|
allOpaque &= (opacity >= 0.99f);
|
||||||
}
|
}
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0 + QT_IMAGE_TEXTURE_UNIT);
|
funcs.glActiveTexture(GL_TEXTURE0 + QT_IMAGE_TEXTURE_UNIT);
|
||||||
QOpenGLTexture *texture = 0;//ctx->d_func()->bindTexture(pixmap, GL_TEXTURE_2D, GL_RGBA,
|
QOpenGLTexture *texture = 0;//ctx->d_func()->bindTexture(pixmap, GL_TEXTURE_2D, GL_RGBA,
|
||||||
// QOpenGLContext::InternalBindOption
|
// QOpenGLContext::InternalBindOption
|
||||||
// | QOpenGLContext::CanFlipNativePixmapBindOption);
|
// | QOpenGLContext::CanFlipNativePixmapBindOption);
|
||||||
|
@ -64,9 +64,10 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
class QOpenGL2PaintEngineExPrivate;
|
class QOpenGL2PaintEngineExPrivate;
|
||||||
|
|
||||||
struct QOpenGLGlyphTexture : public QOpenGLSharedResource
|
class QOpenGLGlyphTexture : public QOpenGLSharedResource
|
||||||
{
|
{
|
||||||
QOpenGLGlyphTexture(QOpenGLContext *ctx)
|
public:
|
||||||
|
explicit QOpenGLGlyphTexture(QOpenGLContext *ctx)
|
||||||
: QOpenGLSharedResource(ctx->shareGroup())
|
: QOpenGLSharedResource(ctx->shareGroup())
|
||||||
, m_width(0)
|
, m_width(0)
|
||||||
, m_height(0)
|
, m_height(0)
|
||||||
|
@ -2508,7 +2508,7 @@ void QTriangulator<T>::MonotoneToTriangles::decompose()
|
|||||||
// qTriangulate //
|
// qTriangulate //
|
||||||
//============================================================================//
|
//============================================================================//
|
||||||
|
|
||||||
QTriangleSet qTriangulate(const qreal *polygon,
|
Q_GUI_EXPORT QTriangleSet qTriangulate(const qreal *polygon,
|
||||||
int count, uint hint, const QTransform &matrix)
|
int count, uint hint, const QTransform &matrix)
|
||||||
{
|
{
|
||||||
QTriangleSet triangleSet;
|
QTriangleSet triangleSet;
|
||||||
@ -2531,7 +2531,7 @@ QTriangleSet qTriangulate(const qreal *polygon,
|
|||||||
return triangleSet;
|
return triangleSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
QTriangleSet qTriangulate(const QVectorPath &path,
|
Q_GUI_EXPORT QTriangleSet qTriangulate(const QVectorPath &path,
|
||||||
const QTransform &matrix, qreal lod)
|
const QTransform &matrix, qreal lod)
|
||||||
{
|
{
|
||||||
QTriangleSet triangleSet;
|
QTriangleSet triangleSet;
|
||||||
|
@ -137,8 +137,8 @@ struct Q_GUI_EXPORT QPolylineSet
|
|||||||
// integers, the polygon is triangulated, and then scaled back by 1/32.
|
// integers, the polygon is triangulated, and then scaled back by 1/32.
|
||||||
// 'hint' should be a combination of QVectorPath::Hints.
|
// 'hint' should be a combination of QVectorPath::Hints.
|
||||||
// 'lod' is the level of detail. Default is 1. Curves are split into more lines when 'lod' is higher.
|
// 'lod' is the level of detail. Default is 1. Curves are split into more lines when 'lod' is higher.
|
||||||
QTriangleSet qTriangulate(const qreal *polygon, int count, uint hint = QVectorPath::PolygonHint | QVectorPath::OddEvenFill, const QTransform &matrix = QTransform());
|
QTriangleSet Q_GUI_EXPORT qTriangulate(const qreal *polygon, int count, uint hint = QVectorPath::PolygonHint | QVectorPath::OddEvenFill, const QTransform &matrix = QTransform());
|
||||||
QTriangleSet qTriangulate(const QVectorPath &path, const QTransform &matrix = QTransform(), qreal lod = 1);
|
QTriangleSet Q_GUI_EXPORT qTriangulate(const QVectorPath &path, const QTransform &matrix = QTransform(), qreal lod = 1);
|
||||||
QTriangleSet Q_GUI_EXPORT qTriangulate(const QPainterPath &path, const QTransform &matrix = QTransform(), qreal lod = 1);
|
QTriangleSet Q_GUI_EXPORT qTriangulate(const QPainterPath &path, const QTransform &matrix = QTransform(), qreal lod = 1);
|
||||||
QPolylineSet qPolyline(const QVectorPath &path, const QTransform &matrix = QTransform(), qreal lod = 1);
|
QPolylineSet qPolyline(const QVectorPath &path, const QTransform &matrix = QTransform(), qreal lod = 1);
|
||||||
QPolylineSet Q_GUI_EXPORT qPolyline(const QPainterPath &path, const QTransform &matrix = QTransform(), qreal lod = 1);
|
QPolylineSet Q_GUI_EXPORT qPolyline(const QPainterPath &path, const QTransform &matrix = QTransform(), qreal lod = 1);
|
||||||
|
@ -78,7 +78,7 @@
|
|||||||
#include <private/qfontengine_p.h>
|
#include <private/qfontengine_p.h>
|
||||||
#include <private/qdatabuffer_p.h>
|
#include <private/qdatabuffer_p.h>
|
||||||
#include <private/qstatictext_p.h>
|
#include <private/qstatictext_p.h>
|
||||||
#include <private/qtriangulator_p.h>
|
#include <QtGui/private/qtriangulator_p.h>
|
||||||
|
|
||||||
#include "qglengineshadermanager_p.h"
|
#include "qglengineshadermanager_p.h"
|
||||||
#include "qgl2pexvertexarray_p.h"
|
#include "qgl2pexvertexarray_p.h"
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,148 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
|
||||||
** All rights reserved.
|
|
||||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
||||||
**
|
|
||||||
** This file is part of the QtOpenGL module of the Qt Toolkit.
|
|
||||||
**
|
|
||||||
** $QT_BEGIN_LICENSE:LGPL$
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
** This file may be used under the terms of the GNU Lesser General Public
|
|
||||||
** License version 2.1 as published by the Free Software Foundation and
|
|
||||||
** appearing in the file LICENSE.LGPL included in the packaging of this
|
|
||||||
** file. Please review the following information to ensure the GNU Lesser
|
|
||||||
** General Public License version 2.1 requirements will be met:
|
|
||||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** In addition, as a special exception, Nokia gives you certain additional
|
|
||||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
|
||||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU General
|
|
||||||
** Public License version 3.0 as published by the Free Software Foundation
|
|
||||||
** and appearing in the file LICENSE.GPL included in the packaging of this
|
|
||||||
** file. Please review the following information to ensure the GNU General
|
|
||||||
** Public License version 3.0 requirements will be met:
|
|
||||||
** http://www.gnu.org/copyleft/gpl.html.
|
|
||||||
**
|
|
||||||
** Other Usage
|
|
||||||
** Alternatively, this file may be used in accordance with the terms and
|
|
||||||
** conditions contained in a signed written agreement between you and Nokia.
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
** $QT_END_LICENSE$
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#ifndef QTRIANGULATOR_P_H
|
|
||||||
#define QTRIANGULATOR_P_H
|
|
||||||
|
|
||||||
//
|
|
||||||
// W A R N I N G
|
|
||||||
// -------------
|
|
||||||
//
|
|
||||||
// This file is not part of the Qt API. It exists purely as an
|
|
||||||
// implementation detail. This header file may change from version to
|
|
||||||
// version without notice, or even be removed.
|
|
||||||
//
|
|
||||||
// We mean it.
|
|
||||||
//
|
|
||||||
|
|
||||||
#include <QtCore/qvector.h>
|
|
||||||
#include <QtGui/private/qvectorpath_p.h>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
|
|
||||||
class QVertexIndexVector
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
enum Type {
|
|
||||||
UnsignedInt,
|
|
||||||
UnsignedShort
|
|
||||||
};
|
|
||||||
|
|
||||||
inline Type type() const { return t; }
|
|
||||||
|
|
||||||
inline void setDataUint(const QVector<quint32> &data)
|
|
||||||
{
|
|
||||||
t = UnsignedInt;
|
|
||||||
indices32 = data;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void setDataUshort(const QVector<quint16> &data)
|
|
||||||
{
|
|
||||||
t = UnsignedShort;
|
|
||||||
indices16 = data;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline const void* data() const
|
|
||||||
{
|
|
||||||
if (t == UnsignedInt)
|
|
||||||
return indices32.data();
|
|
||||||
return indices16.data();
|
|
||||||
}
|
|
||||||
|
|
||||||
inline int size() const
|
|
||||||
{
|
|
||||||
if (t == UnsignedInt)
|
|
||||||
return indices32.size();
|
|
||||||
return indices16.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
inline QVertexIndexVector &operator = (const QVertexIndexVector &other)
|
|
||||||
{
|
|
||||||
if (t == UnsignedInt)
|
|
||||||
indices32 = other.indices32;
|
|
||||||
else
|
|
||||||
indices16 = other.indices16;
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
Type t;
|
|
||||||
QVector<quint32> indices32;
|
|
||||||
QVector<quint16> indices16;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct QTriangleSet
|
|
||||||
{
|
|
||||||
inline QTriangleSet() { }
|
|
||||||
inline QTriangleSet(const QTriangleSet &other) : vertices(other.vertices), indices(other.indices) { }
|
|
||||||
QTriangleSet &operator = (const QTriangleSet &other) {vertices = other.vertices; indices = other.indices; return *this;}
|
|
||||||
|
|
||||||
// The vertices of a triangle are given by: (x[i[n]], y[i[n]]), (x[j[n]], y[j[n]]), (x[k[n]], y[k[n]]), n = 0, 1, ...
|
|
||||||
QVector<qreal> vertices; // [x[0], y[0], x[1], y[1], x[2], ...]
|
|
||||||
QVertexIndexVector indices; // [i[0], j[0], k[0], i[1], j[1], k[1], i[2], ...]
|
|
||||||
};
|
|
||||||
|
|
||||||
struct QPolylineSet
|
|
||||||
{
|
|
||||||
inline QPolylineSet() { }
|
|
||||||
inline QPolylineSet(const QPolylineSet &other) : vertices(other.vertices), indices(other.indices) { }
|
|
||||||
QPolylineSet &operator = (const QPolylineSet &other) {vertices = other.vertices; indices = other.indices; return *this;}
|
|
||||||
|
|
||||||
QVector<qreal> vertices; // [x[0], y[0], x[1], y[1], x[2], ...]
|
|
||||||
QVertexIndexVector indices; // End of polyline is marked with -1.
|
|
||||||
};
|
|
||||||
|
|
||||||
// The vertex coordinates of the returned triangle set will be rounded to a grid with a mesh size
|
|
||||||
// of 1/32. The polygon is first transformed, then scaled by 32, the coordinates are rounded to
|
|
||||||
// integers, the polygon is triangulated, and then scaled back by 1/32.
|
|
||||||
// 'hint' should be a combination of QVectorPath::Hints.
|
|
||||||
// 'lod' is the level of detail. Default is 1. Curves are split into more lines when 'lod' is higher.
|
|
||||||
QTriangleSet qTriangulate(const qreal *polygon, int count, uint hint = QVectorPath::PolygonHint | QVectorPath::OddEvenFill, const QTransform &matrix = QTransform());
|
|
||||||
QTriangleSet qTriangulate(const QVectorPath &path, const QTransform &matrix = QTransform(), qreal lod = 1);
|
|
||||||
QTriangleSet qTriangulate(const QPainterPath &path, const QTransform &matrix = QTransform(), qreal lod = 1);
|
|
||||||
QPolylineSet qPolyline(const QVectorPath &path, const QTransform &matrix = QTransform(), qreal lod = 1);
|
|
||||||
QPolylineSet qPolyline(const QPainterPath &path, const QTransform &matrix = QTransform(), qreal lod = 1);
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
#endif
|
|
@ -56,7 +56,6 @@ HEADERS += qglshaderprogram.h \
|
|||||||
gl2paintengineex/qglengineshadersource_p.h \
|
gl2paintengineex/qglengineshadersource_p.h \
|
||||||
gl2paintengineex/qglcustomshaderstage_p.h \
|
gl2paintengineex/qglcustomshaderstage_p.h \
|
||||||
gl2paintengineex/qtriangulatingstroker_p.h \
|
gl2paintengineex/qtriangulatingstroker_p.h \
|
||||||
gl2paintengineex/qtriangulator_p.h \
|
|
||||||
gl2paintengineex/qrbtree_p.h \
|
gl2paintengineex/qrbtree_p.h \
|
||||||
gl2paintengineex/qtextureglyphcache_gl_p.h \
|
gl2paintengineex/qtextureglyphcache_gl_p.h \
|
||||||
gl2paintengineex/qglshadercache_p.h \
|
gl2paintengineex/qglshadercache_p.h \
|
||||||
@ -70,7 +69,6 @@ SOURCES += qglshaderprogram.cpp \
|
|||||||
gl2paintengineex/qpaintengineex_opengl2.cpp \
|
gl2paintengineex/qpaintengineex_opengl2.cpp \
|
||||||
gl2paintengineex/qglcustomshaderstage.cpp \
|
gl2paintengineex/qglcustomshaderstage.cpp \
|
||||||
gl2paintengineex/qtriangulatingstroker.cpp \
|
gl2paintengineex/qtriangulatingstroker.cpp \
|
||||||
gl2paintengineex/qtriangulator.cpp \
|
|
||||||
gl2paintengineex/qtextureglyphcache_gl.cpp
|
gl2paintengineex/qtextureglyphcache_gl.cpp
|
||||||
|
|
||||||
SOURCES += qgl_qpa.cpp \
|
SOURCES += qgl_qpa.cpp \
|
||||||
|
@ -45,9 +45,8 @@
|
|||||||
#include <qdebug.h>
|
#include <qdebug.h>
|
||||||
#include <private/qgl_p.h>
|
#include <private/qgl_p.h>
|
||||||
#include <private/qfont_p.h>
|
#include <private/qfont_p.h>
|
||||||
#include <gl2paintengineex/qpaintengineex_opengl2_p.h>
|
#include "gl2paintengineex/qpaintengineex_opengl2_p.h"
|
||||||
|
|
||||||
#include <qglframebufferobject.h>
|
|
||||||
#include <qlibrary.h>
|
#include <qlibrary.h>
|
||||||
#include <qimage.h>
|
#include <qimage.h>
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@
|
|||||||
|
|
||||||
#include <QtCore/qglobal.h>
|
#include <QtCore/qglobal.h>
|
||||||
|
|
||||||
#include <gl2paintengineex/qpaintengineex_opengl2_p.h>
|
#include "gl2paintengineex/qpaintengineex_opengl2_p.h"
|
||||||
|
|
||||||
#include <qglpixelbuffer.h>
|
#include <qglpixelbuffer.h>
|
||||||
#include <private/qglpixelbuffer_p.h>
|
#include <private/qglpixelbuffer_p.h>
|
||||||
|
@ -1868,12 +1868,14 @@ public:
|
|||||||
|
|
||||||
int tst_QGLResource::deletions = 0;
|
int tst_QGLResource::deletions = 0;
|
||||||
|
|
||||||
Q_GLOBAL_STATIC(QGLContextGroupResource<tst_QGLResource>, qt_shared_test)
|
#ifdef TODO
|
||||||
|
Q_GLOBAL_STATIC(QOpenGLContextGroupResource<tst_QGLResource>, qt_shared_test)
|
||||||
|
#endif //TODO
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void tst_QGL::shareRegister()
|
void tst_QGL::shareRegister()
|
||||||
{
|
{
|
||||||
|
#ifdef TODO
|
||||||
#ifdef QT_BUILD_INTERNAL
|
#ifdef QT_BUILD_INTERNAL
|
||||||
// Create a context.
|
// Create a context.
|
||||||
QGLWidget *glw1 = new QGLWidget();
|
QGLWidget *glw1 = new QGLWidget();
|
||||||
@ -1883,15 +1885,15 @@ void tst_QGL::shareRegister()
|
|||||||
QVERIFY(!glw1->isSharing());
|
QVERIFY(!glw1->isSharing());
|
||||||
|
|
||||||
// Create a guard for the first context.
|
// Create a guard for the first context.
|
||||||
QGLSharedResourceGuard guard(glw1->context());
|
QOpenGLSharedResourceGuard guard(glw1->context()->contextHandle());
|
||||||
QVERIFY(guard.id() == 0);
|
QVERIFY(guard.id() == 0);
|
||||||
guard.setId(3);
|
guard.setId(3);
|
||||||
QVERIFY(guard.id() == 3);
|
QVERIFY(guard.id() == 3);
|
||||||
|
|
||||||
// Request a tst_QGLResource object for the first context.
|
// Request a tst_QGLResource object for the first context.
|
||||||
tst_QGLResource *res1 = qt_shared_test()->value(glw1->context());
|
tst_QGLResource *res1 = qt_shared_test()->value(glw1->context()->contextHandle());
|
||||||
QVERIFY(res1);
|
QVERIFY(res1);
|
||||||
QVERIFY(qt_shared_test()->value(glw1->context()) == res1);
|
QVERIFY(qt_shared_test()->value(glw1->context()->contextHandle()) == res1);
|
||||||
|
|
||||||
// Create another context that shares with the first.
|
// Create another context that shares with the first.
|
||||||
QVERIFY(!glw1->isSharing());
|
QVERIFY(!glw1->isSharing());
|
||||||
@ -1985,6 +1987,7 @@ void tst_QGL::shareRegister()
|
|||||||
QVERIFY(guard3.context() == 0);
|
QVERIFY(guard3.context() == 0);
|
||||||
QVERIFY(guard3.id() == 0);
|
QVERIFY(guard3.id() == 0);
|
||||||
#endif
|
#endif
|
||||||
|
#endif //TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tests QGLContext::bindTexture with default options
|
// Tests QGLContext::bindTexture with default options
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
load(qttest_p4)
|
load(qttest_p4)
|
||||||
requires(contains(QT_CONFIG,opengl))
|
requires(contains(QT_CONFIG,opengl))
|
||||||
QT += opengl
|
QT += opengl widgets
|
||||||
|
|
||||||
win32:!wince*: DEFINES += QT_NO_EGL
|
win32:!wince*: DEFINES += QT_NO_EGL
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
#include <QtTest/QtTest>
|
#include <QtTest/QtTest>
|
||||||
#include <QtCore/QtCore>
|
#include <QtCore/QtCore>
|
||||||
#include <QtGui/QtGui>
|
#include <QtGui/QtGui>
|
||||||
|
#include <QtWidgets/QApplication>
|
||||||
#include <QtOpenGL/QtOpenGL>
|
#include <QtOpenGL/QtOpenGL>
|
||||||
#include "tst_qglthreads.h"
|
#include "tst_qglthreads.h"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user