1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
18 @test |
18 @test |
19 */ |
19 */ |
20 |
20 |
21 #include "egltest_image.h" |
21 #include "egltest_image.h" |
22 |
22 |
23 #ifndef __INIPARSER_H__ |
23 #include <iniparser.h> |
24 #include <cinidata.h> |
|
25 #endif // __INIPARSER_H__ |
|
26 #include <test/tefunit.h> // for ASSERT macros |
24 #include <test/tefunit.h> // for ASSERT macros |
27 |
25 |
28 #include <test/egltestcommonconversion.h> |
26 #include <test/egltestcommonconversion.h> |
29 #include <test/egltestcommoninisettings.h> |
27 #include <test/egltestcommoninisettings.h> |
30 #include <test/egltestcommonsgimageinfo.h> |
28 #include <test/egltestcommonsgimageinfo.h> |
144 TUint8* address = reinterpret_cast<TUint8*>(bitmap->DataAddress()); |
142 TUint8* address = reinterpret_cast<TUint8*>(bitmap->DataAddress()); |
145 TInt stride = bitmap->DataStride(); |
143 TInt stride = bitmap->DataStride(); |
146 address += (bitmapSize.iHeight - 1) * stride; |
144 address += (bitmapSize.iHeight - 1) * stride; |
147 vgWritePixels(address, -stride, KDefaultSurfaceFormat,0,0, bitmapSize.iWidth, bitmapSize.iHeight); |
145 vgWritePixels(address, -stride, KDefaultSurfaceFormat,0,0, bitmapSize.iWidth, bitmapSize.iHeight); |
148 ASSERT_TRUE(vgGetError()==VG_NO_ERROR); |
146 ASSERT_TRUE(vgGetError()==VG_NO_ERROR); |
|
147 eglWaitClient(); // wait for writing to finish |
149 ASSERT_EGL_TRUE(eglDestroySurface(iDisplay, surface)); //Destroying Surface handle |
148 ASSERT_EGL_TRUE(eglDestroySurface(iDisplay, surface)); //Destroying Surface handle |
150 |
149 |
151 INFO_PRINTF1(_L("Create a EGLImage out of the SgImage")); |
150 INFO_PRINTF1(_L("Create a EGLImage out of the SgImage")); |
152 EGLImageKHR imageKHR = iEglSess->eglCreateImageKhrL(iDisplay,EGL_NO_CONTEXT,EGL_NATIVE_PIXMAP_KHR,&sgImage,KEglImageAttribsPreservedTrue); |
151 EGLImageKHR imageKHR = iEglSess->eglCreateImageKhrL(iDisplay,EGL_NO_CONTEXT,EGL_NATIVE_PIXMAP_KHR,&sgImage,KEglImageAttribsPreservedTrue); |
153 ASSERT_EGL_TRUE(imageKHR != EGL_NO_IMAGE_KHR); |
152 ASSERT_EGL_TRUE(imageKHR != EGL_NO_IMAGE_KHR); |