egl/sfegltest/src/eglrendering.cpp
branchbug235_bringup_0
changeset 204 3f7664f3b0f4
parent 203 71a455a885b7
child 205 c7cc034fd51d
equal deleted inserted replaced
203:71a455a885b7 204:3f7664f3b0f4
    19 
    19 
    20 const TInt KTimerDelay = 0;
    20 const TInt KTimerDelay = 0;
    21 
    21 
    22 
    22 
    23 /** Attributes to be passed into eglChooseConfig */
    23 /** Attributes to be passed into eglChooseConfig */
    24 const EGLint	KColorRGBA8888AttribList[] =
    24 const EGLint	KColorRGB565AttribList[] =
    25 		{
    25 		{
    26 		EGL_RED_SIZE,			8,
    26 		EGL_RED_SIZE,			5,
    27 		EGL_GREEN_SIZE,			8,
    27 		EGL_GREEN_SIZE,			6,
    28 		EGL_BLUE_SIZE,			8,
    28 		EGL_BLUE_SIZE,			5,
    29         EGL_ALPHA_SIZE,         8,
       
    30 		EGL_SURFACE_TYPE,		EGL_WINDOW_BIT,
    29 		EGL_SURFACE_TYPE,		EGL_WINDOW_BIT,
    31 		EGL_RENDERABLE_TYPE, 	EGL_OPENVG_BIT,
    30 		EGL_RENDERABLE_TYPE, 	EGL_OPENVG_BIT,
    32 		EGL_NONE
    31 		EGL_NONE
    33 		};
    32 		};
    34 
    33 
   177 
   176 
   178 	EGLint numConfigs;
   177 	EGLint numConfigs;
   179 	EGLConfig chosenConfig = 0;
   178 	EGLConfig chosenConfig = 0;
   180 
   179 
   181 	// Choose the config to use
   180 	// Choose the config to use
   182 	EGLCheckReturnError(eglChooseConfig(iDisplay, KColorRGBA8888AttribList, &chosenConfig, 1, &numConfigs));
   181 	EGLCheckReturnError(eglChooseConfig(iDisplay, KColorRGB565AttribList, &chosenConfig, 1, &numConfigs));
   183 	RDebug::Printf("CEGLRendering::ConstructL 3");
   182 	RDebug::Printf("CEGLRendering::ConstructL 3");
   184 	if (numConfigs == 0)
   183 	if (numConfigs == 0)
   185 		{
   184 		{
   186 		RDebug::Printf("No matching configs found", eglQueryString(iDisplay, EGL_EXTENSIONS));
   185 		RDebug::Printf("No matching configs found", eglQueryString(iDisplay, EGL_EXTENSIONS));
   187 		User::Leave(KErrNotSupported);
   186 		User::Leave(KErrNotSupported);
   248                             
   247                             
   249     vgAppendPathData(path, sizeof(starSegments), starSegments, starCoords);
   248     vgAppendPathData(path, sizeof(starSegments), starSegments, starCoords);
   250     ASSERT(vgGetError() == VG_NO_ERROR);
   249     ASSERT(vgGetError() == VG_NO_ERROR);
   251     RDebug::Printf("vgAppendPathData");
   250     RDebug::Printf("vgAppendPathData");
   252     
   251     
       
   252     vgSetPaint(strokePaint, VG_STROKE_PATH);
       
   253     
   253     // Draw the star directly using the OpenVG API.
   254     // Draw the star directly using the OpenVG API.
   254     vgDrawPath(path, VG_FILL_PATH | VG_STROKE_PATH);
   255     vgDrawPath(path, VG_FILL_PATH | VG_STROKE_PATH);
   255     ASSERT(vgGetError() == VG_NO_ERROR);
   256     ASSERT(vgGetError() == VG_NO_ERROR);
   256     RDebug::Printf("vgDrawPath");
   257     RDebug::Printf("vgDrawPath");
   257     
   258     
   263 
   264 
   264 /** Update the display */
   265 /** Update the display */
   265 void CEGLRendering::UpdateDisplay()
   266 void CEGLRendering::UpdateDisplay()
   266 	{
   267 	{
   267 	// Flush colour buffer to the window surface
   268 	// Flush colour buffer to the window surface
   268 	CEGLRendering::EGLCheckReturnError(eglSwapBuffers(iDisplay, iSurface));
   269 	//CEGLRendering::EGLCheckReturnError(eglSwapBuffers(iDisplay, iSurface));
   269 	}
   270 	}
   270 
   271 
   271 /** Callback called by refresh timer */
   272 /** Callback called by refresh timer */
   272 TInt CEGLRendering::TimerCallBack(TAny* aDemo)
   273 TInt CEGLRendering::TimerCallBack(TAny* aDemo)
   273 	{
   274 	{