mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 10:52:56 +00:00
remove windows and mac remains from opengl component
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
07891e9a41
commit
600e7127a0
13 changed files with 34 additions and 403 deletions
|
@ -96,14 +96,6 @@ inline static bool isPowerOfTwo(uint x)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(Q_WS_WIN)
|
||||
extern Q_GUI_EXPORT bool qt_cleartype_enabled;
|
||||
#endif
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
extern bool qt_applefontsmoothing_enabled;
|
||||
#endif
|
||||
|
||||
#if !defined(QT_MAX_CACHED_GLYPH_SIZE)
|
||||
# define QT_MAX_CACHED_GLYPH_SIZE 64
|
||||
#endif
|
||||
|
@ -1569,14 +1561,6 @@ namespace {
|
|||
|
||||
}
|
||||
|
||||
#if defined(Q_WS_WIN)
|
||||
static bool fontSmoothingApproximately(qreal target)
|
||||
{
|
||||
extern Q_GUI_EXPORT qreal qt_fontsmoothing_gamma; // qapplication_win.cpp
|
||||
return (qAbs(qt_fontsmoothing_gamma - target) < 0.2);
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline qreal qt_sRGB_to_linear_RGB(qreal f)
|
||||
{
|
||||
return f > 0.04045 ? qPow((f + 0.055) / 1.055, 2.4) : f / 12.92;
|
||||
|
@ -1742,29 +1726,6 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp
|
|||
|
||||
QBrush pensBrush = q->state()->pen.brush();
|
||||
|
||||
bool srgbFrameBufferEnabled = false;
|
||||
if (pensBrush.style() == Qt::SolidPattern &&
|
||||
(ctx->d_ptr->extension_flags & QGLExtensions::SRGBFrameBuffer)) {
|
||||
#if defined(Q_WS_MAC)
|
||||
if (glyphType == QFontEngineGlyphCache::Raster_RGBMask)
|
||||
#elif defined(Q_WS_WIN)
|
||||
if (glyphType != QFontEngineGlyphCache::Raster_RGBMask || fontSmoothingApproximately(2.1))
|
||||
#else
|
||||
if (false)
|
||||
#endif
|
||||
{
|
||||
QColor c = pensBrush.color();
|
||||
qreal red = qt_sRGB_to_linear_RGB(c.redF());
|
||||
qreal green = qt_sRGB_to_linear_RGB(c.greenF());
|
||||
qreal blue = qt_sRGB_to_linear_RGB(c.blueF());
|
||||
c = QColor::fromRgbF(red, green, blue, c.alphaF());
|
||||
pensBrush.setColor(c);
|
||||
|
||||
glEnable(FRAMEBUFFER_SRGB_EXT);
|
||||
srgbFrameBufferEnabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
setBrush(pensBrush);
|
||||
|
||||
if (glyphType == QFontEngineGlyphCache::Raster_RGBMask) {
|
||||
|
@ -1881,10 +1842,6 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp
|
|||
#else
|
||||
glDrawElements(GL_TRIANGLE_STRIP, 6 * numGlyphs, GL_UNSIGNED_SHORT, elementIndices.data());
|
||||
#endif
|
||||
|
||||
if (srgbFrameBufferEnabled)
|
||||
glDisable(FRAMEBUFFER_SRGB_EXT);
|
||||
|
||||
}
|
||||
|
||||
void QGL2PaintEngineEx::drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap,
|
||||
|
@ -2155,14 +2112,7 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev)
|
|||
d->glyphCacheType = QFontEngineGlyphCache::Raster_A8;
|
||||
|
||||
#if !defined(QT_OPENGL_ES_2)
|
||||
#if defined(Q_WS_WIN)
|
||||
if (qt_cleartype_enabled
|
||||
&& (fontSmoothingApproximately(1.0) || fontSmoothingApproximately(2.1)))
|
||||
#endif
|
||||
#if defined(Q_WS_MAC)
|
||||
if (qt_applefontsmoothing_enabled)
|
||||
#endif
|
||||
d->glyphCacheType = QFontEngineGlyphCache::Raster_RGBMask;
|
||||
d->glyphCacheType = QFontEngineGlyphCache::Raster_RGBMask;
|
||||
#endif
|
||||
|
||||
#if defined(QT_OPENGL_ES_2)
|
||||
|
|
|
@ -49,10 +49,6 @@
|
|||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#ifdef Q_WS_WIN
|
||||
extern Q_GUI_EXPORT bool qt_cleartype_enabled;
|
||||
#endif
|
||||
|
||||
QBasicAtomicInt qgltextureglyphcache_serial_number = Q_BASIC_ATOMIC_INITIALIZER(1);
|
||||
|
||||
QGLTextureGlyphCache::QGLTextureGlyphCache(const QGLContext *context, QFontEngineGlyphCache::Type type, const QTransform &matrix)
|
||||
|
|
|
@ -55,8 +55,6 @@
|
|||
#undef INT32
|
||||
#undef INT8
|
||||
#include "qx11info_x11.h"
|
||||
#elif defined(Q_WS_MAC)
|
||||
# include <qt_mac_p.h>
|
||||
#endif
|
||||
|
||||
#include <qdatetime.h>
|
||||
|
@ -98,11 +96,8 @@
|
|||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#if defined(Q_WS_X11) || defined(Q_WS_MAC)
|
||||
#if defined(Q_WS_X11)
|
||||
QGLExtensionFuncs QGLContextPrivate::qt_extensionFuncs;
|
||||
#endif
|
||||
|
||||
#ifdef Q_WS_X11
|
||||
extern const QX11Info *qt_x11Info(const QPaintDevice *pd);
|
||||
#endif
|
||||
|
||||
|
@ -155,23 +150,6 @@ public:
|
|||
}
|
||||
|
||||
QPaintEngine::Type preferredPaintEngine() {
|
||||
#ifdef Q_WS_MAC
|
||||
// The ATI X1600 driver for Mac OS X does not support return
|
||||
// values from functions in GLSL. Since working around this in
|
||||
// the GL2 engine would require a big, ugly rewrite, we're
|
||||
// falling back to the GL 1 engine..
|
||||
static bool mac_x1600_check_done = false;
|
||||
if (!mac_x1600_check_done) {
|
||||
QGLTemporaryContext *tmp = 0;
|
||||
if (!QGLContext::currentContext())
|
||||
tmp = new QGLTemporaryContext();
|
||||
if (strstr((char *) glGetString(GL_RENDERER), "X1600"))
|
||||
engineType = QPaintEngine::OpenGL;
|
||||
if (tmp)
|
||||
delete tmp;
|
||||
mac_x1600_check_done = true;
|
||||
}
|
||||
#endif
|
||||
if (engineType == QPaintEngine::MaxUser) {
|
||||
// No user-set engine - use the defaults
|
||||
#if defined(QT_OPENGL_ES_2)
|
||||
|
@ -1686,21 +1664,6 @@ void QGLContextPrivate::init(QPaintDevice *dev, const QGLFormat &format)
|
|||
vi = 0;
|
||||
screen = QX11Info::appScreen();
|
||||
#endif
|
||||
#if defined(Q_WS_WIN)
|
||||
dc = 0;
|
||||
win = 0;
|
||||
threadId = 0;
|
||||
pixelFormatId = 0;
|
||||
cmap = 0;
|
||||
hbitmap = 0;
|
||||
hbitmap_hdc = 0;
|
||||
#endif
|
||||
#if defined(Q_WS_MAC)
|
||||
# ifndef QT_MAC_USE_COCOA
|
||||
update = false;
|
||||
# endif
|
||||
vi = 0;
|
||||
#endif
|
||||
#if !defined(QT_NO_EGL)
|
||||
ownsEglContext = false;
|
||||
eglContext = 0;
|
||||
|
@ -2281,7 +2244,7 @@ static void convertToGLFormatHelper(QImage &dst, const QImage &img, GLenum textu
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(Q_WS_X11) || defined(Q_WS_MAC)
|
||||
#if defined(Q_WS_X11)
|
||||
QGLExtensionFuncs& QGLContextPrivate::extensionFuncs(const QGLContext *)
|
||||
{
|
||||
return qt_extensionFuncs;
|
||||
|
@ -3833,25 +3796,11 @@ QGLWidget::~QGLWidget()
|
|||
#endif
|
||||
delete d->glcx;
|
||||
d->glcx = 0;
|
||||
#if defined(Q_WS_WIN)
|
||||
delete d->olcx;
|
||||
d->olcx = 0;
|
||||
#endif
|
||||
#if defined(GLX_MESA_release_buffers) && defined(QGL_USE_MESA_EXT)
|
||||
if (doRelease)
|
||||
glXReleaseBuffersMESA(x11Display(), winId());
|
||||
#endif
|
||||
d->cleanupColormaps();
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
QWidget *current = parentWidget();
|
||||
while (current) {
|
||||
qt_widget_private(current)->glWidgets.removeAll(QWidgetPrivate::GlWidgetInfo(this));
|
||||
if (current->isWindow())
|
||||
break;
|
||||
current = current->parentWidget();
|
||||
};
|
||||
#endif
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -4243,45 +4192,6 @@ bool QGLWidget::event(QEvent *e)
|
|||
d->recreateEglSurface();
|
||||
}
|
||||
#endif
|
||||
#elif defined(Q_WS_WIN)
|
||||
if (e->type() == QEvent::ParentChange) {
|
||||
QGLContext *newContext = new QGLContext(d->glcx->requestedFormat(), this);
|
||||
setContext(newContext, d->glcx);
|
||||
|
||||
// the overlay needs to be recreated as well
|
||||
delete d->olcx;
|
||||
if (isValid() && context()->format().hasOverlay()) {
|
||||
d->olcx = new QGLContext(QGLFormat::defaultOverlayFormat(), this);
|
||||
if (!d->olcx->create(isSharing() ? d->glcx : 0)) {
|
||||
delete d->olcx;
|
||||
d->olcx = 0;
|
||||
d->glcx->d_func()->glFormat.setOverlay(false);
|
||||
}
|
||||
} else {
|
||||
d->olcx = 0;
|
||||
}
|
||||
} else if (e->type() == QEvent::Show) {
|
||||
if (!format().rgba())
|
||||
d->updateColormap();
|
||||
}
|
||||
#elif defined(Q_WS_MAC)
|
||||
if (e->type() == QEvent::MacGLWindowChange
|
||||
#if 0 //(MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
||||
&& ((QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5 && isWindow())
|
||||
|| QSysInfo::MacintoshVersion <= QSysInfo::MV_10_4)
|
||||
#endif
|
||||
) {
|
||||
if (d->needWindowChange) {
|
||||
d->needWindowChange = false;
|
||||
d->glcx->updatePaintDevice();
|
||||
update();
|
||||
}
|
||||
return true;
|
||||
# if defined(QT_MAC_USE_COCOA)
|
||||
} else if (e->type() == QEvent::MacGLClearDrawable) {
|
||||
d->glcx->d_ptr->clearDrawable();
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
return QWidget::event(e);
|
||||
|
@ -4394,9 +4304,6 @@ QPixmap QGLWidget::renderPixmap(int w, int h, bool useContext)
|
|||
QGLFormat fmt = d->glcx->requestedFormat();
|
||||
fmt.setDirectRendering(false); // Direct is unlikely to work
|
||||
fmt.setDoubleBuffer(false); // We don't need dbl buf
|
||||
#ifdef Q_WS_MAC // crash prevention on the Mac - it's unlikely to work anyway
|
||||
fmt.setSampleBuffers(false);
|
||||
#endif
|
||||
|
||||
QGLContext* ocx = d->glcx;
|
||||
ocx->doneCurrent();
|
||||
|
@ -4437,26 +4344,11 @@ QPixmap QGLWidget::renderPixmap(int w, int h, bool useContext)
|
|||
QImage QGLWidget::grabFrameBuffer(bool withAlpha)
|
||||
{
|
||||
makeCurrent();
|
||||
QImage res;
|
||||
int w = width();
|
||||
int h = height();
|
||||
if (format().rgba()) {
|
||||
res = qt_gl_read_framebuffer(QSize(w, h), format().alpha(), withAlpha);
|
||||
} else {
|
||||
#if defined (Q_WS_WIN) && !defined(QT_OPENGL_ES)
|
||||
res = QImage(w, h, QImage::Format_Indexed8);
|
||||
glReadPixels(0, 0, w, h, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, res.bits());
|
||||
const QVector<QColor> pal = QColormap::instance().colormap();
|
||||
if (pal.size()) {
|
||||
res.setColorCount(pal.size());
|
||||
for (int i = 0; i < pal.size(); i++)
|
||||
res.setColor(i, pal.at(i).rgb());
|
||||
}
|
||||
res = res.mirrored();
|
||||
#endif
|
||||
return qt_gl_read_framebuffer(size(), format().alpha(), withAlpha);
|
||||
}
|
||||
|
||||
return res;
|
||||
return QImage();
|
||||
}
|
||||
|
||||
|
||||
|
@ -5427,28 +5319,19 @@ void QGLWidgetPrivate::initContext(QGLContext *context, const QGLWidget* shareWi
|
|||
glcx = new QGLContext(QGLFormat::defaultFormat(), q);
|
||||
}
|
||||
|
||||
#if defined(Q_WS_X11) || defined(Q_WS_MAC)
|
||||
#if defined(Q_WS_X11)
|
||||
Q_GLOBAL_STATIC(QString, qt_gl_lib_name)
|
||||
|
||||
Q_OPENGL_EXPORT void qt_set_gl_library_name(const QString& name)
|
||||
{
|
||||
qt_gl_lib_name()->operator=(name);
|
||||
}
|
||||
|
||||
Q_OPENGL_EXPORT const QString qt_gl_library_name()
|
||||
{
|
||||
if (qt_gl_lib_name()->isNull()) {
|
||||
#ifdef Q_WS_MAC
|
||||
return QLatin1String("/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib");
|
||||
#else
|
||||
# if defined(QT_OPENGL_ES_1)
|
||||
#if defined(QT_OPENGL_ES_1)
|
||||
return QLatin1String("GLES_CM");
|
||||
# elif defined(QT_OPENGL_ES_2)
|
||||
#elif defined(QT_OPENGL_ES_2)
|
||||
return QLatin1String("GLESv2");
|
||||
# else
|
||||
#else
|
||||
return QLatin1String("GL");
|
||||
# endif
|
||||
#endif // defined Q_WS_MAC
|
||||
#endif
|
||||
}
|
||||
return *qt_gl_lib_name();
|
||||
}
|
||||
|
|
|
@ -50,13 +50,7 @@
|
|||
|
||||
QT_BEGIN_HEADER
|
||||
|
||||
#if defined(Q_WS_WIN)
|
||||
# include <QtCore/qt_windows.h>
|
||||
#endif
|
||||
|
||||
#if defined(Q_WS_MAC)
|
||||
# include <OpenGL/gl.h>
|
||||
#elif defined(QT_OPENGL_ES_1)
|
||||
#if defined(QT_OPENGL_ES_1)
|
||||
# if defined(Q_OS_MAC)
|
||||
# include <OpenGLES/ES1/gl.h>
|
||||
# else
|
||||
|
@ -86,37 +80,6 @@ typedef GLfloat GLdouble;
|
|||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#if defined(Q_WS_MAC) && defined (QT_BUILD_OPENGL_LIB) && !defined(QT_MAC_USE_COCOA)
|
||||
#define Q_MAC_COMPAT_GL_FUNCTIONS
|
||||
|
||||
template <typename T>
|
||||
struct QMacGLCompatTypes
|
||||
{
|
||||
typedef long CompatGLint;
|
||||
typedef unsigned long CompatGLuint;
|
||||
typedef unsigned long CompatGLenum;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct QMacGLCompatTypes<long>
|
||||
{
|
||||
typedef int CompatGLint;
|
||||
typedef unsigned int CompatGLuint;
|
||||
typedef unsigned int CompatGLenum;
|
||||
};
|
||||
|
||||
typedef QMacGLCompatTypes<GLint>::CompatGLint QMacCompatGLint;
|
||||
typedef QMacGLCompatTypes<GLint>::CompatGLuint QMacCompatGLuint;
|
||||
typedef QMacGLCompatTypes<GLint>::CompatGLenum QMacCompatGLenum;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
|
||||
class QGLCmap;
|
||||
#endif
|
||||
|
||||
class QPixmap;
|
||||
#if defined(Q_WS_X11) && !defined(QT_OPENGL_ES)
|
||||
class QGLOverlayWidget;
|
||||
|
@ -378,16 +341,10 @@ public:
|
|||
protected:
|
||||
virtual bool chooseContext(const QGLContext* shareContext = 0);
|
||||
|
||||
#if defined(Q_WS_WIN)
|
||||
virtual int choosePixelFormat(void* pfd, HDC pdc);
|
||||
#endif
|
||||
#if defined(Q_WS_X11)
|
||||
virtual void* tryVisual(const QGLFormat& f, int bufDepth = 1);
|
||||
virtual void* chooseVisual();
|
||||
#endif
|
||||
#if defined(Q_WS_MAC)
|
||||
virtual void* chooseMacVisual(GDHandle);
|
||||
#endif
|
||||
|
||||
bool deviceIsPixmap() const;
|
||||
bool windowCreated() const;
|
||||
|
@ -427,13 +384,6 @@ private:
|
|||
friend class QGLExtensions;
|
||||
friend class QGLTexture;
|
||||
friend QGLFormat::OpenGLVersionFlags QGLFormat::openGLVersionFlags();
|
||||
#ifdef Q_WS_MAC
|
||||
public:
|
||||
void updatePaintDevice();
|
||||
private:
|
||||
friend class QMacGLWindowChangeEvent;
|
||||
friend QGLContextPrivate *qt_phonon_get_dptr(const QGLContext *);
|
||||
#endif
|
||||
friend class QGLFramebufferObject;
|
||||
friend class QGLFramebufferObjectPrivate;
|
||||
friend class QGLFBOGLPaintDevice;
|
||||
|
@ -560,9 +510,6 @@ protected:
|
|||
private:
|
||||
Q_DISABLE_COPY(QGLWidget)
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
friend class QMacGLWindowChangeEvent;
|
||||
#endif
|
||||
friend class QGLDrawable;
|
||||
friend class QGLPixelBuffer;
|
||||
friend class QGLPixelBufferPrivate;
|
||||
|
|
|
@ -75,24 +75,6 @@ class QGLContext;
|
|||
class QGLOverlayWidget;
|
||||
class QPixmap;
|
||||
class QPixmapFilter;
|
||||
#ifdef Q_WS_MAC
|
||||
# ifdef qDebug
|
||||
# define old_qDebug qDebug
|
||||
# undef qDebug
|
||||
# endif
|
||||
QT_BEGIN_INCLUDE_NAMESPACE
|
||||
#ifndef QT_MAC_USE_COCOA
|
||||
# include <AGL/agl.h>
|
||||
#endif
|
||||
QT_END_INCLUDE_NAMESPACE
|
||||
# ifdef old_qDebug
|
||||
# undef qDebug
|
||||
# define qDebug QT_NO_QDEBUG_MACRO
|
||||
# undef old_qDebug
|
||||
# endif
|
||||
class QMacWindowChangeEvent;
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_EGL
|
||||
class QEglContext;
|
||||
#endif
|
||||
|
@ -187,18 +169,12 @@ public:
|
|||
|
||||
bool disable_clear_on_painter_begin;
|
||||
|
||||
#if defined(Q_WS_WIN)
|
||||
void updateColormap();
|
||||
QGLContext *olcx;
|
||||
#elif defined(Q_WS_X11)
|
||||
#if defined(Q_WS_X11)
|
||||
QGLOverlayWidget *olw;
|
||||
#ifndef QT_NO_EGL
|
||||
void recreateEglSurface();
|
||||
WId eglSurfaceWindowId;
|
||||
#endif
|
||||
#elif defined(Q_WS_MAC)
|
||||
QGLContext *olcx;
|
||||
void updatePaintDevice();
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -332,20 +308,6 @@ public:
|
|||
void syncGlState(); // Makes sure the GL context's state is what we think it is
|
||||
void swapRegion(const QRegion ®ion);
|
||||
|
||||
#if defined(Q_WS_WIN)
|
||||
void updateFormatVersion();
|
||||
#endif
|
||||
|
||||
#if defined(Q_WS_WIN)
|
||||
HGLRC rc;
|
||||
HDC dc;
|
||||
WId win;
|
||||
int pixelFormatId;
|
||||
QGLCmap* cmap;
|
||||
HBITMAP hbitmap;
|
||||
HDC hbitmap_hdc;
|
||||
Qt::HANDLE threadId;
|
||||
#endif
|
||||
#ifndef QT_NO_EGL
|
||||
QEglContext *eglContext;
|
||||
EGLSurface eglSurface;
|
||||
|
@ -355,13 +317,9 @@ public:
|
|||
static void setExtraWindowSurfaceCreationProps(QEglProperties *props);
|
||||
#endif
|
||||
|
||||
#if defined(Q_WS_X11) || defined(Q_WS_MAC)
|
||||
void* cx;
|
||||
#endif
|
||||
#if defined(Q_WS_X11) || defined(Q_WS_MAC)
|
||||
void* vi;
|
||||
#endif
|
||||
#if defined(Q_WS_X11)
|
||||
void* cx;
|
||||
void* vi;
|
||||
void* pbuf;
|
||||
quint32 gpm;
|
||||
int screen;
|
||||
|
@ -370,11 +328,6 @@ public:
|
|||
QGLContext::BindOptions options);
|
||||
static void destroyGlSurfaceForPixmap(QPixmapData*);
|
||||
static void unbindPixmapFromTexture(QPixmapData*);
|
||||
#endif
|
||||
#if defined(Q_WS_MAC)
|
||||
bool update;
|
||||
void *tryFormat(const QGLFormat &format);
|
||||
void clearDrawable();
|
||||
#endif
|
||||
QGLFormat glFormat;
|
||||
QGLFormat reqFormat;
|
||||
|
@ -424,11 +377,7 @@ public:
|
|||
|
||||
static inline QGLContextGroup *contextGroup(const QGLContext *ctx) { return ctx->d_ptr->group; }
|
||||
|
||||
#ifdef Q_WS_WIN
|
||||
static inline QGLExtensionFuncs& extensionFuncs(const QGLContext *ctx) { return ctx->d_ptr->group->extensionFuncs(); }
|
||||
#endif
|
||||
|
||||
#if defined(Q_WS_X11) || defined(Q_WS_MAC)
|
||||
#if defined(Q_WS_X11)
|
||||
static Q_OPENGL_EXPORT QGLExtensionFuncs qt_extensionFuncs;
|
||||
static Q_OPENGL_EXPORT QGLExtensionFuncs& extensionFuncs(const QGLContext *);
|
||||
#endif
|
||||
|
|
|
@ -54,18 +54,13 @@
|
|||
//
|
||||
|
||||
// extension prototypes
|
||||
#ifndef Q_WS_MAC
|
||||
# ifndef APIENTRYP
|
||||
# ifdef APIENTRY
|
||||
# define APIENTRYP APIENTRY *
|
||||
# else
|
||||
# define APIENTRY
|
||||
# define APIENTRYP *
|
||||
# endif
|
||||
# endif
|
||||
#else
|
||||
# define APIENTRY
|
||||
# define APIENTRYP *
|
||||
#ifndef APIENTRYP
|
||||
# ifdef APIENTRY
|
||||
# define APIENTRYP APIENTRY *
|
||||
# else
|
||||
# define APIENTRY
|
||||
# define APIENTRYP *
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_EGL
|
||||
|
|
|
@ -58,18 +58,13 @@ QT_BEGIN_NAMESPACE
|
|||
typedef ptrdiff_t qgl_GLintptr;
|
||||
typedef ptrdiff_t qgl_GLsizeiptr;
|
||||
|
||||
#ifndef Q_WS_MAC
|
||||
# ifndef QGLF_APIENTRYP
|
||||
# ifdef QGLF_APIENTRY
|
||||
# define QGLF_APIENTRYP QGLF_APIENTRY *
|
||||
# else
|
||||
# define QGLF_APIENTRY
|
||||
# define QGLF_APIENTRYP *
|
||||
# endif
|
||||
# endif
|
||||
#else
|
||||
# define QGLF_APIENTRY
|
||||
# define QGLF_APIENTRYP *
|
||||
#ifndef QGLF_APIENTRYP
|
||||
# ifdef QGLF_APIENTRY
|
||||
# define QGLF_APIENTRYP QGLF_APIENTRY *
|
||||
# else
|
||||
# define QGLF_APIENTRY
|
||||
# define QGLF_APIENTRYP *
|
||||
# endif
|
||||
#endif
|
||||
|
||||
struct QGLFunctionsPrivate;
|
||||
|
|
|
@ -149,16 +149,10 @@ void QGLPixelBufferPrivate::common_init(const QSize &size, const QGLFormat &form
|
|||
glDevice.setPBuffer(q);
|
||||
qctx->d_func()->paintDevice = q;
|
||||
qctx->d_func()->valid = true;
|
||||
#if defined(Q_WS_WIN) && !defined(QT_OPENGL_ES)
|
||||
qctx->d_func()->dc = dc;
|
||||
qctx->d_func()->rc = ctx;
|
||||
#elif (defined(Q_WS_X11) && defined(QT_NO_EGL))
|
||||
#if defined(Q_WS_X11) && defined(QT_NO_EGL)
|
||||
qctx->d_func()->cx = ctx;
|
||||
qctx->d_func()->pbuf = (void *) pbuf;
|
||||
qctx->d_func()->vi = 0;
|
||||
#elif defined(Q_WS_MAC)
|
||||
qctx->d_func()->cx = ctx;
|
||||
qctx->d_func()->vi = 0;
|
||||
#elif !defined(QT_NO_EGL)
|
||||
qctx->d_func()->eglContext = ctx;
|
||||
qctx->d_func()->eglSurface = pbuf;
|
||||
|
@ -269,7 +263,7 @@ bool QGLPixelBuffer::doneCurrent()
|
|||
\sa size()
|
||||
*/
|
||||
|
||||
#if (defined(Q_WS_X11) || defined(Q_WS_WIN)) && defined(QT_NO_EGL)
|
||||
#if defined(Q_WS_X11) && defined(QT_NO_EGL)
|
||||
GLuint QGLPixelBuffer::generateDynamicTexture() const
|
||||
{
|
||||
Q_D(const QGLPixelBuffer);
|
||||
|
|
|
@ -125,8 +125,6 @@ struct GLXFBConfig {
|
|||
|
||||
#endif // Q_OS_HPUX
|
||||
|
||||
#elif defined(Q_WS_WIN)
|
||||
DECLARE_HANDLE(HPBUFFERARB);
|
||||
#elif !defined(QT_NO_EGL)
|
||||
#include <QtGui/qegl_p.h>
|
||||
#endif
|
||||
|
@ -152,11 +150,6 @@ class QGLPixelBufferPrivate {
|
|||
public:
|
||||
QGLPixelBufferPrivate(QGLPixelBuffer *q) : q_ptr(q), invalid(true), qctx(0), pbuf(0), ctx(0)
|
||||
{
|
||||
#ifdef Q_WS_WIN
|
||||
dc = 0;
|
||||
#elif defined(Q_WS_MACX)
|
||||
share_ctx = 0;
|
||||
#endif
|
||||
}
|
||||
bool init(const QSize &size, const QGLFormat &f, QGLWidget *shareWidget);
|
||||
void common_init(const QSize &size, const QGLFormat &f, QGLWidget *shareWidget);
|
||||
|
@ -175,23 +168,6 @@ public:
|
|||
#if defined(Q_WS_X11) && defined(QT_NO_EGL)
|
||||
GLXPbuffer pbuf;
|
||||
GLXContext ctx;
|
||||
#elif defined(Q_WS_WIN)
|
||||
HDC dc;
|
||||
bool has_render_texture :1;
|
||||
#if !defined(QT_OPENGL_ES)
|
||||
HPBUFFERARB pbuf;
|
||||
HGLRC ctx;
|
||||
#endif
|
||||
#elif defined(Q_WS_MACX)
|
||||
# ifdef QT_MAC_USE_COCOA
|
||||
void *pbuf;
|
||||
void *ctx;
|
||||
void *share_ctx;
|
||||
# else
|
||||
AGLPbuffer pbuf;
|
||||
AGLContext ctx;
|
||||
AGLContext share_ctx;
|
||||
# endif
|
||||
#endif
|
||||
#ifndef QT_NO_EGL
|
||||
EGLSurface pbuf;
|
||||
|
|
|
@ -64,14 +64,6 @@ QPixmapData *QGLGraphicsSystem::createPixmapData(QPixmapData::PixelType type) co
|
|||
|
||||
QWindowSurface *QGLGraphicsSystem::createWindowSurface(QWidget *widget) const
|
||||
{
|
||||
#ifdef Q_WS_WIN
|
||||
// On Windows the QGLWindowSurface class can't handle
|
||||
// drop shadows and native effects, e.g. fading a menu in/out using
|
||||
// top level window opacity.
|
||||
if (widget->windowType() == Qt::Popup)
|
||||
return new QRasterWindowSurface(widget);
|
||||
#endif
|
||||
|
||||
#if defined(Q_WS_X11) && !defined(QT_NO_EGL)
|
||||
if (m_useX11GL && QX11GLPixmapData::hasX11GLPixmaps()) {
|
||||
// If the widget is a QGraphicsView which will be re-drawing the entire
|
||||
|
|
|
@ -4101,12 +4101,7 @@ void QOpenGLPaintEngine::drawTextureRect(int tx_width, int tx_height, const QRec
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef Q_WS_WIN
|
||||
HDC
|
||||
#else
|
||||
Qt::HANDLE
|
||||
#endif
|
||||
QOpenGLPaintEngine::handle() const
|
||||
Qt::HANDLE QOpenGLPaintEngine::handle() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -4196,16 +4191,7 @@ void QGLGlyphCache::fontEngineDestroyed(QObject *o)
|
|||
quint64 font_key = (reinterpret_cast<quint64>(ctx) << 32) | reinterpret_cast<quint64>(fe);
|
||||
QGLFontTexture *tex = qt_font_textures.take(font_key);
|
||||
if (tex) {
|
||||
#ifdef Q_WS_MAC
|
||||
if (
|
||||
# ifndef QT_MAC_USE_COCOA
|
||||
aglGetCurrentContext() != 0
|
||||
# else
|
||||
qt_current_nsopengl_context() != 0
|
||||
# endif
|
||||
)
|
||||
#endif
|
||||
glDeleteTextures(1, &tex->texture);
|
||||
glDeleteTextures(1, &tex->texture);
|
||||
delete tex;
|
||||
}
|
||||
}
|
||||
|
@ -4229,16 +4215,7 @@ void QGLGlyphCache::cleanupContext(const QGLContext *ctx)
|
|||
quint64 font_key = (reinterpret_cast<quint64>(ctx) << 32) | reinterpret_cast<quint64>(fe);
|
||||
QGLFontTexture *font_tex = qt_font_textures.take(font_key);
|
||||
if (font_tex) {
|
||||
#ifdef Q_WS_MAC
|
||||
if (
|
||||
# ifndef QT_MAC_USE_COCOA
|
||||
aglGetCurrentContext() == 0
|
||||
# else
|
||||
qt_current_nsopengl_context() != 0
|
||||
# endif
|
||||
)
|
||||
#endif
|
||||
glDeleteTextures(1, &font_tex->texture);
|
||||
glDeleteTextures(1, &font_tex->texture);
|
||||
delete font_tex;
|
||||
}
|
||||
}
|
||||
|
@ -4252,10 +4229,6 @@ void QGLGlyphCache::cleanCache()
|
|||
QGLFontTexHash::const_iterator it = qt_font_textures.constBegin();
|
||||
if (QGLContext::currentContext()) {
|
||||
while (it != qt_font_textures.constEnd()) {
|
||||
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
|
||||
if (qt_current_nsopengl_context() == 0)
|
||||
break;
|
||||
#endif
|
||||
glDeleteTextures(1, &it.value()->texture);
|
||||
++it;
|
||||
}
|
||||
|
@ -4439,13 +4412,8 @@ void QGLGlyphCache::cacheGlyphs(QGLContext *context, QFontEngine *fontEngine,
|
|||
qgl_glyph->height = qreal(glyph_height) / font_tex->height;
|
||||
qgl_glyph->log_width = qreal(glyph_width);
|
||||
qgl_glyph->log_height = qgl_glyph->height * font_tex->height;
|
||||
#ifdef Q_WS_MAC
|
||||
qgl_glyph->x_offset = -metrics.x + 1;
|
||||
qgl_glyph->y_offset = metrics.y - 2;
|
||||
#else
|
||||
qgl_glyph->x_offset = -metrics.x;
|
||||
qgl_glyph->y_offset = metrics.y;
|
||||
#endif
|
||||
|
||||
if (!glyph_im.isNull()) {
|
||||
int idx = 0;
|
||||
|
|
|
@ -137,11 +137,7 @@ public:
|
|||
|
||||
void drawEllipse(const QRectF &rect);
|
||||
|
||||
#ifdef Q_WS_WIN
|
||||
HDC handle() const;
|
||||
#else
|
||||
Qt::HANDLE handle() const;
|
||||
#endif
|
||||
inline Type type() const { return QPaintEngine::OpenGL; }
|
||||
bool supportsTransformations(qreal, const QTransform &) const { return true; }
|
||||
|
||||
|
|
|
@ -91,9 +91,6 @@ QT_BEGIN_NAMESPACE
|
|||
//
|
||||
// QGLGraphicsSystem
|
||||
//
|
||||
#ifdef Q_WS_WIN
|
||||
extern Q_GUI_EXPORT bool qt_win_owndc_required;
|
||||
#endif
|
||||
QGLGraphicsSystem::QGLGraphicsSystem(bool useX11GL)
|
||||
: QGraphicsSystem(), m_useX11GL(useX11GL)
|
||||
{
|
||||
|
@ -171,10 +168,6 @@ QGLGraphicsSystem::QGLGraphicsSystem(bool useX11GL)
|
|||
printf("using visual class %x, id %x\n", X11->visual_class, X11->visual_id);
|
||||
}
|
||||
}
|
||||
#elif defined(Q_WS_WIN)
|
||||
QGLWindowSurface::surfaceFormat.setDoubleBuffer(true);
|
||||
|
||||
qt_win_owndc_required = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -827,9 +820,6 @@ void QGLWindowSurface::updateGeometry() {
|
|||
hijackWindow(window());
|
||||
|
||||
QGLContext *ctx = reinterpret_cast<QGLContext *>(wd->extraData()->glContext);
|
||||
#ifdef Q_WS_MAC
|
||||
ctx->updatePaintDevice();
|
||||
#endif
|
||||
|
||||
QSize surfSize = geometry().size();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue