summaryrefslogtreecommitdiffstats
path: root/src/openvg
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@nokia.com>2010-03-16 21:07:09 (GMT)
committerAlessandro Portale <alessandro.portale@nokia.com>2010-03-16 21:16:22 (GMT)
commit3675bfca72e8e848a3a547dfc68fadbd775e973b (patch)
tree89673d447bdc80a8f1d97f299d0681052f693f3d /src/openvg
parent071d4bf6b871a353350dfd7448255ca23ce13c68 (diff)
downloadQt-3675bfca72e8e848a3a547dfc68fadbd775e973b.zip
Qt-3675bfca72e8e848a3a547dfc68fadbd775e973b.tar.gz
Qt-3675bfca72e8e848a3a547dfc68fadbd775e973b.tar.bz2
Fix linking issues of QtOpenVG.dll
QEglContext::display() is a static function, and exported as such. qpixmapdata_vg.cpp and qwindowsurface_vgegl.cpp referenced it as a non- static function which made the linking of QtOpenVG.dll fail. Reviewed-by: Jason Barron
Diffstat (limited to 'src/openvg')
-rw-r--r--src/openvg/qpixmapdata_vg.cpp16
-rw-r--r--src/openvg/qwindowsurface_vgegl.cpp22
2 files changed, 17 insertions, 21 deletions
diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp
index 3087b77..15a2712 100644
--- a/src/openvg/qpixmapdata_vg.cpp
+++ b/src/openvg/qpixmapdata_vg.cpp
@@ -467,10 +467,6 @@ void QVGPixmapData::fromNativeType(void* pixmap, NativeType type)
#if defined(QT_SYMBIAN_SUPPORTS_SGIMAGE) && !defined(QT_NO_EGL)
if (type == QPixmapData::SgImage && pixmap) {
RSgImage *sgImage = reinterpret_cast<RSgImage*>(pixmap);
- // when "0" used as argument then
- // default display, context are used
- if (!context)
- context = qt_vg_create_context(0, QInternal::Pixmap);
destroyImages();
prevSize = QSize();
@@ -508,7 +504,7 @@ void QVGPixmapData::fromNativeType(void* pixmap, NativeType type)
}
const EGLint KEglImageAttribs[] = {EGL_IMAGE_PRESERVED_SYMBIAN, EGL_TRUE, EGL_NONE};
- EGLImageKHR eglImage = eglCreateImageKHR(context->display(),
+ EGLImageKHR eglImage = eglCreateImageKHR(QEglContext::display(),
EGL_NO_CONTEXT,
EGL_NATIVE_PIXMAP_KHR,
(EGLClientBuffer)sgImage,
@@ -523,7 +519,7 @@ void QVGPixmapData::fromNativeType(void* pixmap, NativeType type)
vgImage = vgCreateEGLImageTargetKHR(eglImage);
if(vgGetError() != VG_NO_ERROR) {
cleanup();
- eglDestroyImageKHR(context->display(), eglImage);
+ eglDestroyImageKHR(QEglContext::display(), eglImage);
SgDriver::Close();
return;
}
@@ -537,7 +533,7 @@ void QVGPixmapData::fromNativeType(void* pixmap, NativeType type)
prevSize = QSize(w, h);
setSerialNumber(++qt_vg_pixmap_serial);
// release stuff
- eglDestroyImageKHR(context->display(), eglImage);
+ eglDestroyImageKHR(QEglContext::display(), eglImage);
SgDriver::Close();
} else if (type == QPixmapData::FbsBitmap) {
CFbsBitmap *bitmap = reinterpret_cast<CFbsBitmap*>(pixmap);
@@ -632,7 +628,7 @@ void* QVGPixmapData::toNativeType(NativeType type)
}
const EGLint KEglImageAttribs[] = {EGL_IMAGE_PRESERVED_SYMBIAN, EGL_TRUE, EGL_NONE};
- EGLImageKHR eglImage = eglCreateImageKHR(context->display(),
+ EGLImageKHR eglImage = eglCreateImageKHR(QEglContext::display(),
EGL_NO_CONTEXT,
EGL_NATIVE_PIXMAP_KHR,
(EGLClientBuffer)sgImage,
@@ -645,7 +641,7 @@ void* QVGPixmapData::toNativeType(NativeType type)
VGImage dstVgImage = vgCreateEGLImageTargetKHR(eglImage);
if(vgGetError() != VG_NO_ERROR) {
- eglDestroyImageKHR(context->display(), eglImage);
+ eglDestroyImageKHR(QEglContext::display(), eglImage);
sgImage->Close();
SgDriver::Close();
return 0;
@@ -661,7 +657,7 @@ void* QVGPixmapData::toNativeType(NativeType type)
}
// release stuff
vgDestroyImage(dstVgImage);
- eglDestroyImageKHR(context->display(), eglImage);
+ eglDestroyImageKHR(QEglContext::display(), eglImage);
SgDriver::Close();
return reinterpret_cast<void*>(sgImage);
} else if (type == QPixmapData::FbsBitmap) {
diff --git a/src/openvg/qwindowsurface_vgegl.cpp b/src/openvg/qwindowsurface_vgegl.cpp
index 693312a..f46d6c2 100644
--- a/src/openvg/qwindowsurface_vgegl.cpp
+++ b/src/openvg/qwindowsurface_vgegl.cpp
@@ -230,9 +230,9 @@ static QEglContext *createContext(QPaintDevice *device)
// Set the swap interval for the display.
QByteArray interval = qgetenv("QT_VG_SWAP_INTERVAL");
if (!interval.isEmpty())
- eglSwapInterval(context->display(), interval.toInt());
+ eglSwapInterval(QEglContext::display(), interval.toInt());
else
- eglSwapInterval(context->display(), 1);
+ eglSwapInterval(QEglContext::display(), 1);
#ifdef EGL_RENDERABLE_TYPE
// Has the user specified an explicit EGL configuration to use?
@@ -246,16 +246,16 @@ static QEglContext *createContext(QPaintDevice *device)
EGLint matching = 0;
EGLConfig cfg;
if (eglChooseConfig
- (context->display(), properties, &cfg, 1, &matching) &&
+ (QEglContext::display(), properties, &cfg, 1, &matching) &&
matching > 0) {
// Check that the selected configuration actually supports OpenVG
// and then create the context with it.
EGLint id = 0;
EGLint type = 0;
eglGetConfigAttrib
- (context->display(), cfg, EGL_CONFIG_ID, &id);
+ (QEglContext::display(), cfg, EGL_CONFIG_ID, &id);
eglGetConfigAttrib
- (context->display(), cfg, EGL_RENDERABLE_TYPE, &type);
+ (QEglContext::display(), cfg, EGL_RENDERABLE_TYPE, &type);
if (cfgId == id && (type & EGL_OPENVG_BIT) != 0) {
context->setConfig(cfg);
if (!context->createContext()) {
@@ -334,7 +334,7 @@ static void qt_vg_destroy_shared_context(QVGSharedContext *shared)
shared->engine = 0;
shared->context->doneCurrent();
if (shared->surface != EGL_NO_SURFACE) {
- eglDestroySurface(shared->context->display(), shared->surface);
+ eglDestroySurface(QEglContext::display(), shared->surface);
shared->surface = EGL_NO_SURFACE;
}
delete shared->context;
@@ -412,7 +412,7 @@ EGLSurface qt_vg_shared_surface(void)
attribs[4] = EGL_NONE;
}
shared->surface = eglCreatePbufferSurface
- (shared->context->display(), shared->context->config(), attribs);
+ (QEglContext::display(), shared->context->config(), attribs);
}
return shared->surface;
}
@@ -555,7 +555,7 @@ void QVGEGLWindowSurfaceVGImage::beginPaint(QWidget *widget)
context->makeCurrent(mainSurface());
recreateBackBuffer = false;
if (backBufferSurface != EGL_NO_SURFACE) {
- eglDestroySurface(context->display(), backBufferSurface);
+ eglDestroySurface(QEglContext::display(), backBufferSurface);
backBufferSurface = EGL_NO_SURFACE;
}
if (backBuffer != VG_INVALID_HANDLE) {
@@ -568,7 +568,7 @@ void QVGEGLWindowSurfaceVGImage::beginPaint(QWidget *widget)
if (backBuffer != VG_INVALID_HANDLE) {
// Create an EGL surface for rendering into the VGImage.
backBufferSurface = eglCreatePbufferFromClientBuffer
- (context->display(), EGL_OPENVG_IMAGE,
+ (QEglContext::display(), EGL_OPENVG_IMAGE,
(EGLClientBuffer)(backBuffer),
context->config(), NULL);
if (backBufferSurface == EGL_NO_SURFACE) {
@@ -704,7 +704,7 @@ QEglContext *QVGEGLWindowSurfaceDirect::ensureContext(QWidget *widget)
#if defined(QVG_DIRECT_TO_WINDOW)
// Did we get a direct to window rendering surface?
EGLint buffer = 0;
- if (eglQueryContext(context->display(), context->context(),
+ if (eglQueryContext(QEglContext::display(), context->context(),
EGL_RENDER_BUFFER, &buffer) &&
buffer == EGL_SINGLE_BUFFER) {
needToSwap = false;
@@ -714,7 +714,7 @@ QEglContext *QVGEGLWindowSurfaceDirect::ensureContext(QWidget *widget)
// Try to force the surface back buffer to preserve its contents.
if (needToSwap) {
eglGetError(); // Clear error state first.
- eglSurfaceAttrib(context->display(), surface,
+ eglSurfaceAttrib(QEglContext::display(), surface,
EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED);
if (eglGetError() != EGL_SUCCESS) {
qWarning("QVG: could not enable preserved swap");