summaryrefslogtreecommitdiffstats
path: root/src/openvg
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvg')
-rw-r--r--src/openvg/qpaintengine_vg.cpp9
-rw-r--r--src/openvg/qvg_p.h5
-rw-r--r--src/openvg/qvg_symbian.cpp12
-rw-r--r--src/openvg/qvgfontglyphcache_p.h6
4 files changed, 20 insertions, 12 deletions
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index f6d2435..ce9d11a 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -61,11 +61,6 @@
QT_BEGIN_NAMESPACE
-// vgDrawGlyphs() only exists in OpenVG 1.1 and higher.
-#if !defined(OPENVG_VERSION_1_1) && !defined(QVG_NO_DRAW_GLYPHS)
-#define QVG_NO_DRAW_GLYPHS 1
-#endif
-
// vgRenderToMask() only exists in OpenVG 1.1 and higher.
// Also, disable masking completely if we are using the scissor to clip.
#if !defined(OPENVG_VERSION_1_1) && !defined(QVG_NO_RENDER_TO_MASK)
@@ -75,11 +70,11 @@ QT_BEGIN_NAMESPACE
#define QVG_NO_RENDER_TO_MASK 1
#endif
-#if !defined(QVG_NO_DRAW_GLYPHS)
-
// use the same rounding as in qrasterizer.cpp (6 bit fixed point)
static const qreal aliasedCoordinateDelta = 0.5 - 0.015625;
+#if !defined(QVG_NO_DRAW_GLYPHS)
+
Q_DECL_IMPORT extern int qt_defaultDpiX();
Q_DECL_IMPORT extern int qt_defaultDpiY();
diff --git a/src/openvg/qvg_p.h b/src/openvg/qvg_p.h
index 51abbee..94d1eae 100644
--- a/src/openvg/qvg_p.h
+++ b/src/openvg/qvg_p.h
@@ -55,6 +55,11 @@
// We mean it.
//
+// vgDrawGlyphs() only exists in OpenVG 1.1 and higher.
+#if !defined(OPENVG_VERSION_1_1) && !defined(QVG_NO_DRAW_GLYPHS)
+#define QVG_NO_DRAW_GLYPHS 1
+#endif
+
#include <QtGui/qimage.h>
#if !defined(QT_NO_EGL)
diff --git a/src/openvg/qvg_symbian.cpp b/src/openvg/qvg_symbian.cpp
index ef0160c..41b35fc 100644
--- a/src/openvg/qvg_symbian.cpp
+++ b/src/openvg/qvg_symbian.cpp
@@ -185,10 +185,11 @@ void QVGPixmapData::fromNativeType(void* pixmap, NativeType type)
QImage::Format format = qt_TDisplayMode2Format(displayMode);
TSize size = bitmap->SizeInPixels();
+ int bytesPerLine = bitmap->ScanLineLength(size.iWidth, displayMode);
bitmap->BeginDataAccess();
uchar *bytes = (uchar*)bitmap->DataAddress();
- QImage img = QImage(bytes, size.iWidth, size.iHeight, format);
+ QImage img = QImage(bytes, size.iWidth, size.iHeight, bytesPerLine, format);
img = img.copy();
bitmap->EndDataAccess();
@@ -228,7 +229,7 @@ void* QVGPixmapData::toNativeType(NativeType type)
sgInfo.iSizeInPixels.SetSize(w, h);
sgInfo.iUsage = ESgUsageBitOpenVgImage | ESgUsageBitOpenVgSurface;
- RSgImage *sgImage = q_check_ptr(new RSgImage());
+ QScopedPointer<RSgImage> sgImage(new RSgImage());
err = sgImage->Create(sgInfo, NULL, NULL);
if (err != KErrNone) {
driver.Close();
@@ -239,7 +240,7 @@ void* QVGPixmapData::toNativeType(NativeType type)
EGLImageKHR eglImage = QEgl::eglCreateImageKHR(QEgl::display(),
EGL_NO_CONTEXT,
EGL_NATIVE_PIXMAP_KHR,
- (EGLClientBuffer)sgImage,
+ (EGLClientBuffer)sgImage.data(),
(EGLint*)KEglImageAttribs);
if (!eglImage || eglGetError() != EGL_SUCCESS) {
sgImage->Close();
@@ -261,13 +262,14 @@ void* QVGPixmapData::toNativeType(NativeType type)
if (vgGetError() != VG_NO_ERROR) {
sgImage->Close();
- sgImage = 0;
+ sgImage.reset();
}
+
// release stuff
vgDestroyImage(dstVgImage);
QEgl::eglDestroyImageKHR(QEgl::display(), eglImage);
driver.Close();
- return reinterpret_cast<void*>(sgImage);
+ return reinterpret_cast<void*>(sgImage.take());
#endif
} else if (type == QPixmapData::FbsBitmap) {
CFbsBitmap *bitmap = q_check_ptr(new CFbsBitmap);
diff --git a/src/openvg/qvgfontglyphcache_p.h b/src/openvg/qvgfontglyphcache_p.h
index b32a873..8bcdcc7 100644
--- a/src/openvg/qvgfontglyphcache_p.h
+++ b/src/openvg/qvgfontglyphcache_p.h
@@ -56,10 +56,14 @@
#include <QtCore/qvarlengtharray.h>
#include <QtGui/private/qfontengine_p.h>
+#include <qvg_p.h>
+
QT_BEGIN_NAMESPACE
class QVGPaintEnginePrivate;
+#ifndef QVG_NO_DRAW_GLYPHS
+
class QVGFontGlyphCache
{
public:
@@ -90,6 +94,8 @@ public:
};
#endif
+#endif
+
QT_END_NAMESPACE
#endif // QVGFONTGLYPHCACHE_H