summaryrefslogtreecommitdiffstats
path: root/src/openvg
diff options
context:
space:
mode:
authorJason Barron <jason.barron@nokia.com>2010-09-14 12:21:25 (GMT)
committerJason Barron <jason.barron@nokia.com>2010-09-14 12:42:05 (GMT)
commit7ee144ed7d88d4de010608d3a433e1b47343cd17 (patch)
tree3ceb050ec7513f082f6c172ed21c5bcfc6ddab2c /src/openvg
parent2d4566e81cf8263af2fec781e6e0d2e200064618 (diff)
downloadQt-7ee144ed7d88d4de010608d3a433e1b47343cd17.zip
Qt-7ee144ed7d88d4de010608d3a433e1b47343cd17.tar.gz
Qt-7ee144ed7d88d4de010608d3a433e1b47343cd17.tar.bz2
Remove redundant code in SgImage -> VGImage conversion on Symbian.
Calling the various Khronos getError() functions here is inefficient since it involves a round trip to the GPU and gains nothing since the null handle can be used to test for error conditions at no cost. Also no need to open the RSgDriver because we don't actually need to call any functions on RSgImage, just convert it. Reviewed-by: Alessandro Portale Reviewed-by: Jani Hautakangas
Diffstat (limited to 'src/openvg')
-rw-r--r--src/openvg/qvg_symbian.cpp31
1 files changed, 2 insertions, 29 deletions
diff --git a/src/openvg/qvg_symbian.cpp b/src/openvg/qvg_symbian.cpp
index 0e6e773..ef0160c 100644
--- a/src/openvg/qvg_symbian.cpp
+++ b/src/openvg/qvg_symbian.cpp
@@ -112,25 +112,8 @@ static VGImage sgImageToVGImage(QEglContext *context, const RSgImage &sgImage)
VGImage vgImage = VG_INVALID_HANDLE;
- TInt err = 0;
-
- RSgDriver driver;
- err = driver.Open();
- if (err != KErrNone) {
- return vgImage;
- }
-
- if (sgImage.IsNull()) {
- driver.Close();
- return vgImage;
- }
-
- TSgImageInfo sgImageInfo;
- err = sgImage.GetInfo(sgImageInfo);
- if (err != KErrNone) {
- driver.Close();
+ if (sgImage.IsNull())
return vgImage;
- }
const EGLint KEglImageAttribs[] = {EGL_IMAGE_PRESERVED_SYMBIAN, EGL_TRUE, EGL_NONE};
EGLImageKHR eglImage = QEgl::eglCreateImageKHR(QEgl::display(),
@@ -139,22 +122,12 @@ static VGImage sgImageToVGImage(QEglContext *context, const RSgImage &sgImage)
(EGLClientBuffer)&sgImage,
(EGLint*)KEglImageAttribs);
- if (!eglImage || eglGetError() != EGL_SUCCESS) {
- driver.Close();
+ if (!eglImage)
return vgImage;
- }
vgImage = QVG::vgCreateEGLImageTargetKHR(eglImage);
- if (!vgImage || vgGetError() != VG_NO_ERROR) {
- QEgl::eglDestroyImageKHR(QEgl::display(), eglImage);
- driver.Close();
- return vgImage;
- }
- //setSerialNumber(++qt_vg_pixmap_serial);
- // release stuff
QEgl::eglDestroyImageKHR(QEgl::display(), eglImage);
- driver.Close();
return vgImage;
}
#endif