# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1286148711 -10800 # Node ID 18f84489a694f2f899003bdd1e4ee959b32b5d2d # Parent 6a1564a2f3e60d89097b8eea335def781bf9cfba Revision: 201039 Kit: 201039 diff -r 6a1564a2f3e6 -r 18f84489a694 egl/egltest/inc/egltestcommonutils.h --- a/egl/egltest/inc/egltestcommonutils.h Fri Sep 17 08:36:49 2010 +0300 +++ b/egl/egltest/inc/egltestcommonutils.h Mon Oct 04 02:31:51 2010 +0300 @@ -374,6 +374,7 @@ _LIT8(KEglNokiaSwapBuffers,"EGL_NOKIA_swap_buffers"); _LIT8(KEglNokiaImageEndpoint,"EGL_NOK_image_endpoint"); _LIT8(KEglNokiaSurfaceScaling,"EGL_NOK_surface_scaling"); +_LIT8(KEglKhrLockSurface,"EGL_KHR_lock_surface"); #ifndef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE _LIT8(KEglSymbianImagePreserved,"EGL_SYMBIAN_image_preserved"); #endif @@ -391,7 +392,8 @@ KEGL_NOKIA_swap_buffers = 0x40, KEGL_SYMBIAN_image_preserved = 0x80, KEGL_NOK_image_endpoint = 0x100, - KEGL_NOK_surface_scaling = 0x200 + KEGL_NOK_surface_scaling = 0x200, + KEGL_KHR_lock_surface = 0x400 }; const TUid KUidEglTestServer={0x10281B40}; diff -r 6a1564a2f3e6 -r 18f84489a694 egl/egltest/rom/egltest.iby --- a/egl/egltest/rom/egltest.iby Fri Sep 17 08:36:49 2010 +0300 +++ b/egl/egltest/rom/egltest.iby Mon Oct 04 02:31:51 2010 +0300 @@ -34,6 +34,7 @@ #include #include #include +#include //Include the endpoint test suite #include diff -r 6a1564a2f3e6 -r 18f84489a694 egl/egltest/src/egltestcommonsession.cpp --- a/egl/egltest/src/egltestcommonsession.cpp Fri Sep 17 08:36:49 2010 +0300 +++ b/egl/egltest/src/egltestcommonsession.cpp Mon Oct 04 02:31:51 2010 +0300 @@ -1767,6 +1767,14 @@ return EFalse; } } + if(aExtension & KEGL_KHR_lock_surface || extensionName.Compare(KEglKhrLockSurface)==0) + { + TBool bFoundExtensionEGL_KHR_lock_surface = FindExtensionStringL(EIsEGL,KEglKhrLockSurface); + if (!bFoundExtensionEGL_KHR_lock_surface) + { + return EFalse; + } + } return ETrue; } diff -r 6a1564a2f3e6 -r 18f84489a694 egl/egltest/src/egltestcommonstep.cpp --- a/egl/egltest/src/egltestcommonstep.cpp Fri Sep 17 08:36:49 2010 +0300 +++ b/egl/egltest/src/egltestcommonstep.cpp Mon Oct 04 02:31:51 2010 +0300 @@ -724,6 +724,7 @@ TBuf resultFilePath; TBuf xmlFilePath; TInt logMode; + TInt loggerChannel ; TInt logLevel; TRAPD(err,parseTestExecuteIni = CTestExecuteIniData::NewL()); @@ -736,9 +737,11 @@ parseTestExecuteIni->GetKeyValueFromIni(KTEFLogMode, logMode); parseTestExecuteIni->GetKeyValueFromIni(KTEFLogSeverityKey, logLevel); parseTestExecuteIni->GetKeyValueFromIni(KTEFEnableIniAccessLog, IniAccessLog()); + parseTestExecuteIni->GetKeyValueFromIni(KTEFLogChannel, loggerChannel); } else { + TBuf testExecuteLogPath(KTestExecuteLogPath); resultFilePath.Copy(KTestExecuteLogPath); xmlFilePath.Copy(KTestExecuteLogPath); logMode = TLoggerOptions(ELogHTMLOnly); @@ -746,6 +749,7 @@ IniAccessLog() = ETrue; } Logger().SetLoggerOptions(logMode); + Logger().SetLoggerChannel(loggerChannel) ; // Initialise a handle to the file logger User::LeaveIfError(Logger().Connect()); @@ -754,7 +758,7 @@ CleanupClosePushL(fS); RFile file; TBuf xmlLogFile(xmlFilePath); - TBuf logFile; + TBuf logFile; TBuf logFileNameFile(resultFilePath); logFileNameFile.Append(KTestExecuteScheduleTestLogCompatibilityNameFile); if(file.Open(fS,logFileNameFile,EFileRead | EFileShareAny) != KErrNone) @@ -789,7 +793,19 @@ if (logMode == 0 || logMode == 2) { - User::LeaveIfError(Logger().HtmlLogger().CreateLog(logFilePath,RTestExecuteLogServ::ELogModeAppend)); + TRAPD(err1,Logger().HtmlLogger().CreateLog(logFilePath,RTestExecuteLogServ::ELogModeAppend)); + if(err1 != KErrPathNotFound) + { + User::LeaveIfError(err1) ; + } + else + { + _LIT(KHtmExtension,".htm"); + if(logFilePath.Find(KHtmExtension)>-1) + { + User::LeaveIfError(err1) ; + } + } Logger().HtmlLogger().SetLogLevel(TLogSeverity(logLevel)); } if (logMode == 1 || logMode == 2) diff -r 6a1564a2f3e6 -r 18f84489a694 fbs/fontandbitmapserver/sfbs/FBSBMP.CPP --- a/fbs/fontandbitmapserver/sfbs/FBSBMP.CPP Fri Sep 17 08:36:49 2010 +0300 +++ b/fbs/fontandbitmapserver/sfbs/FBSBMP.CPP Mon Oct 04 02:31:51 2010 +0300 @@ -537,7 +537,7 @@ { FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOAD_ENTRY, "> this=0x%08x; file=%S, id=0x%08x; share=%d", (TUint)this, aFileName, aId, aShareIfLoaded);) TInt err = Load(aFileName,aId,aShareIfLoaded,0); - FBS_OST(OstTraceExt2( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOAD_EXIT, "< this=0x%08x; err=%d", (TUint)this, err);) + FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOAD_EXIT, "< this=0x%08x; err=%d; iH=0x%08x; iSH=0x%08x", (TUint)this, err, iHandle, iServerHandle);) return err; } @@ -592,7 +592,7 @@ } } } - FBS_OST(OstTraceExt2( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOAD2_EXIT, "< this=0x%08x; err=%d", (TUint)this, err);) + FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOAD2_EXIT, "< this=0x%08x; err=%d; iH=0x%08x; iSH=0x%08x", (TUint)this, err, iHandle, iServerHandle);) return err; } @@ -612,7 +612,7 @@ { FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOADANDCOMPRESS_ENTRY, "> this=0x%08x; file=%S; id=0x%08x; share=%d", (TUint)this, aFileName, aId, aShareIfLoaded);) TInt ret = LoadAndCompress(aFileName, aId, aShareIfLoaded, 0); - FBS_OST(OstTraceExt2( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOADANDCOMPRESS_EXIT, "< this=0x%08x; err=%d", (TUint)this, ret);) + FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOADANDCOMPRESS_EXIT, "< this=0x%08x; err=%d; iH=0x%08x; iSH=0x%08x", (TUint)this, ret, iHandle, iServerHandle);) return ret; } @@ -638,7 +638,7 @@ err = !(iFlags & EIsRomBitmap) ? Compress() : KErrAccessDenied; FBS_OST_IF(err!=KErrNone, OstTraceExt3( TRACE_ERROR, CFBSBITMAP_LOADANDCOMPRESS2_ERROR, "! this=0x%08x; iFlags=0x%08x; err=%d", (TUint)this, (TUint)iFlags, err);) } - FBS_OST(OstTraceExt2( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOADANDCOMPRESS2_EXIT, "< this=0x%08x; err=%d", (TUint)this, err);) + FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOADANDCOMPRESS2_EXIT, "< this=0x%08x; err=%d; iH=0x%08x; iSH=0x%08x", (TUint)this, err, iHandle, iServerHandle);) return err; } @@ -1832,7 +1832,7 @@ FBS_OST(aFile.FullName(fileName);) FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOAD3_ENTRY, "> this=0x%08x; file=%S; id=0x%08x; share=%d", (TUint)this, fileName, aId, aShareIfLoaded);) TInt ret = Load(aFile,aId,aShareIfLoaded,0); - FBS_OST(OstTraceExt2( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOAD3_EXIT, "< this=0x%08x, ret=%d", (TUint)this, ret);) + FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOAD3_EXIT, "< this=0x%08x; err=%d; iH=0x%08x; iSH=0x%08x", (TUint)this, ret, iHandle, iServerHandle);) return ret; } @@ -1871,7 +1871,7 @@ FBS_OST_IF(err!=KErrNone, OstTraceExt2( TRACE_ERROR, CFBSBITMAP_LOAD4_ERROR2, "! this=0x%08x; DoLoad() returned %d", (TUint)this, err);) } } - FBS_OST(OstTraceExt2( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOAD4_EXIT, "< this=0x%08x; err=%d", (TUint)this, err);) + FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOAD4_EXIT, "< this=0x%08x; err=%d; iH=0x%08x; iSH=0x%08x", (TUint)this, err, iHandle, iServerHandle);) return err; } @@ -1893,7 +1893,7 @@ FBS_OST(aFile.FullName(fileName);) FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOADANDCOMPRESS3_ENTRY, "> this=0x%08x; file=%S; id=0x%08x; share=%d", (TUint)this, fileName, aId, aShareIfLoaded);) TInt ret = LoadAndCompress(aFile,aId,aShareIfLoaded,0); - FBS_OST(OstTraceExt2( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOADANDCOMPRESS3_EXIT, "< this=0x%08x; ret=%d", (TUint)this, ret);) + FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOADANDCOMPRESS3_EXIT, "< this=0x%08x; err=%d; iH=0x%08x; iSH=0x%08x", (TUint)this, ret, iHandle, iServerHandle);) return ret; } diff -r 6a1564a2f3e6 -r 18f84489a694 fbs/fontandbitmapserver/sfbs/SESSION.CPP --- a/fbs/fontandbitmapserver/sfbs/SESSION.CPP Fri Sep 17 08:36:49 2010 +0300 +++ b/fbs/fontandbitmapserver/sfbs/SESSION.CPP Mon Oct 04 02:31:51 2010 +0300 @@ -179,7 +179,7 @@ FBS_OST(OstTrace1(GRAPHICS_CONTROL_FUNCTIONS, RFBSSESSION_DISCONNECT_ENTRY, "> this=0x%08x;", (TUint)thisptr);) if(thisptr) { - TInt tempServerSessionHandle = thisptr->ServerSessionHandle(); + FBS_OST(TInt tempServerSessionHandle = (thisptr->iHelper) ? thisptr->iHelper->iServerSessionHandle : 0;) if(thisptr->iConnections>0) { thisptr->iCallBack.iPtr=NULL; @@ -193,6 +193,7 @@ } thisptr->iConnections--; } + FBS_OST(TInt tempConnectionCount = thisptr->iConnections;) if(thisptr->iConnections==0) { thisptr->iSharedChunk.Close(); @@ -208,7 +209,7 @@ delete thisptr; Dll::FreeTls(); } - FBS_OST(OstTraceExt3(GRAPHICS_CONTROL_SEMANTICS, RFBSSESSION_DISCONNECT_INFO, "# Disconnected from session; this=0x%08x; iConnections=%d; iSSH=0x%08x", (TInt)thisptr, thisptr->iConnections, tempServerSessionHandle);) + FBS_OST(OstTraceExt3(GRAPHICS_CONTROL_SEMANTICS, RFBSSESSION_DISCONNECT_INFO, "# Disconnected from session; this=0x%08x; iConnections=%d; iSSH=0x%08x", (TInt)thisptr, tempConnectionCount, tempServerSessionHandle);) } FBS_OST(OstTrace1(GRAPHICS_CONTROL_FUNCTIONS, RFBSSESSION_DISCONNECT_EXIT2, "< this=0x%08x;", (TUint)thisptr);) } diff -r 6a1564a2f3e6 -r 18f84489a694 fbs/fontandbitmapserver/tfbs/TFBS.CPP --- a/fbs/fontandbitmapserver/tfbs/TFBS.CPP Fri Sep 17 08:36:49 2010 +0300 +++ b/fbs/fontandbitmapserver/tfbs/TFBS.CPP Mon Oct 04 02:31:51 2010 +0300 @@ -2282,7 +2282,7 @@ // In a second thread, send a IPC command to set the font's height with the // bitmap's handle. Should panic with FBServ -6. _LIT(KTestName, "TestInvalidHandlesInIpcCall"); - CreateSecondThreadAndCheckPanicL(SecondThreadPanicInvalidHandleInIpcCallL, KErrArgument, KFbsPanicCategory, KTestName); + CreateSecondThreadAndCheckPanicL(&CTFbs::SecondThreadPanicInvalidHandleInIpcCallL, KErrArgument, KFbsPanicCategory, KTestName); iTs->ReleaseFont(font); delete bmp; diff -r 6a1564a2f3e6 -r 18f84489a694 fbs/fontandbitmapserver/utils/fbsbitmap_memory.pl --- a/fbs/fontandbitmapserver/utils/fbsbitmap_memory.pl Fri Sep 17 08:36:49 2010 +0300 +++ b/fbs/fontandbitmapserver/utils/fbsbitmap_memory.pl Mon Oct 04 02:31:51 2010 +0300 @@ -26,9 +26,6 @@ # and run this script against it. The resulting file can then be imported into # a spreadsheet application to be visually processed. # -# KNOWN DEFECTS: -# Once the log time goes beyond midnight, snapshots will stop being taken. -# use strict; @@ -57,6 +54,7 @@ ## my $heartBeatCount = 0; my $nextHeartBeatMS = -1; +my $logLastLineTimeMS = 0; # A hash of thread names to the amount of bitmap memory they # have used since the start of the trace. @@ -98,14 +96,13 @@ ## Read from the file. ## Read the log into an array line by line. my $TRACE_FILENAME = $ARGV[0]; -open(INPUT_FILE, $TRACE_FILENAME) or die $!; -my @traceLines = ; - +open(INPUT_FILE, '<', $TRACE_FILENAME) or die $!; +binmode(INPUT_FILE); ## ## Parse each line sequentially... ## -foreach my $line (@traceLines) +while ( my $line = ) { my $timeFromMidnightMS; @@ -144,26 +141,35 @@ if ($line =~ /^(\d\d):(\d\d):(\d\d)\.(\d{3})/) { $timeFromMidnightMS = ((($1 * 3600) + ($2 * 60) + $3) * 1000) + $4; - # Set up the time for the first snapshot. if ($nextHeartBeatMS == -1) { - $nextHeartBeatMS = $timeFromMidnightMS + $firstHeartBeatTimeMS; + $nextHeartBeatMS = $firstHeartBeatTimeMS; + $logLastLineTimeMS = $timeFromMidnightMS; } - } + ## We have wrapped around midnight! + ## Add a 1000ms cushion to the comparison to avoid wrapping around + ## midnight if a trace is buffered too slowly. + if (($timeFromMidnightMS+1000) < $logLastLineTimeMS) + { + $timeFromMidnightMS += 86400000; + } + $nextHeartBeatMS -= ($timeFromMidnightMS - $logLastLineTimeMS); + $logLastLineTimeMS = $timeFromMidnightMS; - ## - ## If heartbeat reached, take snapshot of bmp memory per thread - ## and set next heartbeat time. - ## - while ($timeFromMidnightMS >= $nextHeartBeatMS) - { - $nextHeartBeatMS += $heartBeatMS; - # take a snapshot of the current bitmap memory usage per thread - while ((my $thread, my $bmpMemory) = each(%bmpMemoryPerThread)) + ## + ## If heartbeat reached, take snapshot of bmp memory per thread + ## and set next heartbeat time. + ## + while ($nextHeartBeatMS <= 0) { - $arrayOfSnapshots[$heartBeatCount]{$thread} = $bmpMemory; + $nextHeartBeatMS += $heartBeatMS; + # take a snapshot of the current bitmap memory usage per thread + while ((my $thread, my $bmpMemory) = each(%bmpMemoryPerThread)) + { + $arrayOfSnapshots[$heartBeatCount]{$thread} = $bmpMemory; + } + $heartBeatCount++; } - $heartBeatCount++; } ## FBS Client-side traces. diff -r 6a1564a2f3e6 -r 18f84489a694 fbs/fontandbitmapserver/utils/fbsresource_count.pl --- a/fbs/fontandbitmapserver/utils/fbsresource_count.pl Fri Sep 17 08:36:49 2010 +0300 +++ b/fbs/fontandbitmapserver/utils/fbsresource_count.pl Mon Oct 04 02:31:51 2010 +0300 @@ -25,9 +25,6 @@ # FBSCLI OST dictionary. Once tracing is gathered, save trace output as ascii # and run this script against it. The resulting file can then be imported into # a spreadsheet application to be visually processed. -# -# KNOWN DEFECTS: -# Once the log time goes beyond midnight, snapshots will stop being taken. # use strict; @@ -57,6 +54,7 @@ ## my $heartBeatCount = 0; my $nextHeartBeatMS = -1; +my $logLastLineTimeMS = 0; # Hash of FbsSessions to thread IDs. my %SessionThreadMap = (); @@ -92,14 +90,13 @@ ## Read from the file. ## Read the log into an array line by line. my $TRACE_FILENAME = $ARGV[0]; -open(INPUT_FILE, $TRACE_FILENAME) or die $!; -my @traceLines = ; - +open(INPUT_FILE, '<', $TRACE_FILENAME) or die $!; +binmode(INPUT_FILE); ## ## Parse each line sequentially... ## -foreach my $line (@traceLines) +while ( my $line = ) { my $timeFromMidnightMS; @@ -138,26 +135,35 @@ if ($line =~ /^(\d\d):(\d\d):(\d\d)\.(\d{3})/) { $timeFromMidnightMS = ((($1 * 3600) + ($2 * 60) + $3) * 1000) + $4; - # Set up the time for the first snapshot. if ($nextHeartBeatMS == -1) { - $nextHeartBeatMS = $timeFromMidnightMS + $firstHeartBeatTimeMS; + $nextHeartBeatMS = $firstHeartBeatTimeMS; + $logLastLineTimeMS = $timeFromMidnightMS; } - } + ## We have wrapped around midnight! + ## Add a 1000ms cushion to the comparison to avoid wrapping around + ## midnight if a trace is buffered too slowly. + if (($timeFromMidnightMS+1000) < $logLastLineTimeMS) + { + $timeFromMidnightMS += 86400000; + } + $nextHeartBeatMS -= ($timeFromMidnightMS - $logLastLineTimeMS); + $logLastLineTimeMS = $timeFromMidnightMS; - ## - ## If heartbeat reached, take snapshot of bmp memory per thread - ## and set next heartbeat time. - ## - while ($timeFromMidnightMS >= $nextHeartBeatMS) - { - $nextHeartBeatMS += $heartBeatMS; - # take a snapshot of the current bitmap memory usage per thread - while ((my $thread, my $fbsResourceCount) = each(%fbsResourcesPerThread)) + ## + ## If heartbeat reached, take snapshot of bmp memory per thread + ## and set next heartbeat time. + ## + while ($nextHeartBeatMS <= 0) { - $arrayOfSnapshots[$heartBeatCount]{$thread} = $fbsResourceCount; + $nextHeartBeatMS += $heartBeatMS; + # take a snapshot of the current bitmap memory usage per thread + while ((my $thread, my $fbsResourceCount) = each(%fbsResourcesPerThread)) + { + $arrayOfSnapshots[$heartBeatCount]{$thread} = $fbsResourceCount; + } + $heartBeatCount++; } - $heartBeatCount++; } ## FBS Client-side traces. diff -r 6a1564a2f3e6 -r 18f84489a694 graphicsdeviceinterface/gdi/group/gditest_helium.pkg --- a/graphicsdeviceinterface/gdi/group/gditest_helium.pkg Fri Sep 17 08:36:49 2010 +0300 +++ b/graphicsdeviceinterface/gdi/group/gditest_helium.pkg Mon Oct 04 02:31:51 2010 +0300 @@ -36,8 +36,3 @@ ;//script file "\epoc32\data\z\gditest\gditest_T_Rgb.script"-"c:\gditest\gditest_T_Rgb.script" "\epoc32\data\z\gditest\gditest_T_Types.script"-"c:\gditest\gditest_T_Types.script" -"\epoc32\data\z\gditest\gditest_T_BiDiDefect.script"-"c:\gditest\gditest_T_BiDiDefect.script" -"\epoc32\data\z\gditest\gditest_T_LineBreak.script"-"c:\gditest\gditest_T_LineBreak.script" -"\epoc32\data\z\gditest\gditest_T_GlyphSelection.script"-"c:\gditest\gditest_T_GlyphSelection.script" -"\epoc32\data\z\gditest\gditest_T_BiDi.script"-"c:\gditest\gditest_T_BiDi.script" - diff -r 6a1564a2f3e6 -r 18f84489a694 graphicsresourceservices/graphicsresourceimplementation/test/group/sgresourcetest_helium.pkg --- a/graphicsresourceservices/graphicsresourceimplementation/test/group/sgresourcetest_helium.pkg Fri Sep 17 08:36:49 2010 +0300 +++ b/graphicsresourceservices/graphicsresourceimplementation/test/group/sgresourcetest_helium.pkg Mon Oct 04 02:31:51 2010 +0300 @@ -35,7 +35,5 @@ ;//script file "\epoc32\data\z\sgresourcetest\sgresourcetest_t_generic.script"-"c:\sgresourcetest\sgresourcetest_t_generic.script" -;COMMENTED OUT FOR 10T38 ZERO TOLERANCE TEST STRATEGY -;"\epoc32\data\z\sgresourcetest\sgresourcetest_t_internal.script"-"c:\sgresourcetest\sgresourcetest_t_internal.script" -;"\epoc32\data\z\sgresourcetest\sgresourcetest_t_stress_auto.script"-"c:\sgresourcetest\sgresourcetest_t_stress_auto.script" +"\epoc32\data\z\sgresourcetest\sgresourcetest_t_stress_auto.script"-"c:\sgresourcetest\sgresourcetest_t_stress_auto.script" diff -r 6a1564a2f3e6 -r 18f84489a694 graphicsresourceservices/graphicsresourceimplementation/test/group/sgresourcetest_refimp_helium.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graphicsresourceservices/graphicsresourceimplementation/test/group/sgresourcetest_refimp_helium.pkg Mon Oct 04 02:31:51 2010 +0300 @@ -0,0 +1,38 @@ +; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; +; File: sgresourcetest_helium.pkg +; +;*Languages +&EN +; +;*Standard SIS file header. This section specifies the package name, +;application UID, and version/build numbers. Add the package TYPE here if needed. +#{"SgResourceTest"},(0x101FB3E8),1,0,1; +; + +;*Unique (Non-Localized) Vendor name +;This is used in combination with signing to prevent the unauthroized +;upgrade of a a package by someone other than the rightful vendor. +:"Nokia" + +;*Localized Vendor Name +;This specifies the localized vendor name(s) corresponding to language(s). +%{"Nokia Test EN"} + +;*Files To Copy... + +;//script file +"\epoc32\data\z\sgresourcetest\sgresourcetest_t_internal.script"-"c:\sgresourcetest\sgresourcetest_t_internal.script" + diff -r 6a1564a2f3e6 -r 18f84489a694 graphicstest/graphicstestharness/src/tprofiler.cpp --- a/graphicstest/graphicstestharness/src/tprofiler.cpp Fri Sep 17 08:36:49 2010 +0300 +++ b/graphicstest/graphicstestharness/src/tprofiler.cpp Mon Oct 04 02:31:51 2010 +0300 @@ -107,6 +107,7 @@ iResultsInitalised = ETrue; iDiff = 0; iResults.Reset(); + iResultsTimingOrder.Reset(); iSessionId = Math::Random(); if (iSessionId < 1000000) { @@ -204,13 +205,7 @@ { return 0; } - TUint32 result = iResults[0]; - for(TInt i = 0; i < iResults.Count(); i++) - { - if(iResults[i] > result) - result = iResults[i]; - } - return result; + return iResults[iResults.Count()-1]; } /** @@ -222,13 +217,7 @@ { return 0; } - TUint32 result = iResults[0]; - for(TInt i = 0; i < iResults.Count(); i++) - { - if(iResults[i] < result) - result = iResults[i]; - } - return result; + return iResults[0]; } /** diff -r 6a1564a2f3e6 -r 18f84489a694 graphicstest/uibench/group/bld.inf --- a/graphicstest/uibench/group/bld.inf Fri Sep 17 08:36:49 2010 +0300 +++ b/graphicstest/uibench/group/bld.inf Mon Oct 04 02:31:51 2010 +0300 @@ -55,6 +55,23 @@ ../data/dummy z:/plattest/graphics/testdata/dummy_fonts/dummyFont_i ../data/dummy z:/plattest/graphics/testdata/dummy_fonts/dummyFont_bi +// test font file and data for tfbsfontrasterizeperf.cpp +// Note: since this test is for internal use, below files don't exist under ../data +// How to run: +// 1, find and copy font file and data files under ../data; +// 2, uncomment below lines; +// 3, uncomment lines below "REM test font files for tfbsfontrasterizeperf.cpp" in te_uibench.iby +// 4, uncomment "RUN_TEST_STEP 5400 te_uibench tfbsfontrasterizeperf z:\uibench\te_uibench.ini" in te_uibench.script +//../data/S60SC_C.ttf z:/plattest/graphics/testdata/S60SC_C.ttf +//../data/Chinese1.txt z:/plattest/graphics/testdata/Chinese1.txt +//../data/Chinese2.txt z:/plattest/graphics/testdata/Chinese2.txt +//../data/Chinese3.txt z:/plattest/graphics/testdata/Chinese3.txt +//../data/Chinese4.txt z:/plattest/graphics/testdata/Chinese4.txt +//../data/Latin1.txt z:/plattest/graphics/testdata/Latin1.txt +//../data/Latin2.txt z:/plattest/graphics/testdata/Latin2.txt +//../data/Latin3.txt z:/plattest/graphics/testdata/Latin3.txt +//../data/Latin4.txt z:/plattest/graphics/testdata/Latin4.txt + PRJ_MMPFILES PRJ_TESTMMPFILES diff -r 6a1564a2f3e6 -r 18f84489a694 graphicstest/uibench/group/te_uibench.iby --- a/graphicstest/uibench/group/te_uibench.iby Fri Sep 17 08:36:49 2010 +0300 +++ b/graphicstest/uibench/group/te_uibench.iby Mon Oct 04 02:31:51 2010 +0300 @@ -69,6 +69,17 @@ data=DATAZ_\PlatTest\Graphics\TestData\dummy_fonts\dummyFont_i \PlatTest\Graphics\TestData\dummy_fonts\dummyFont_i data=DATAZ_\PlatTest\Graphics\TestData\dummy_fonts\dummyFont_bi \PlatTest\Graphics\TestData\dummy_fonts\dummyFont_bi +REM test font files for tfbsfontrasterizeperf.cpp +//data=DATAZ_\PlatTest\Graphics\TestData\S60SC_C.ttf \PlatTest\Graphics\TestData\S60SC_C.ttf +//data=DATAZ_\PlatTest\Graphics\TestData\Chinese1.txt \PlatTest\Graphics\TestData\Chinese1.txt +//data=DATAZ_\PlatTest\Graphics\TestData\Chinese2.txt \PlatTest\Graphics\TestData\Chinese2.txt +//data=DATAZ_\PlatTest\Graphics\TestData\Chinese3.txt \PlatTest\Graphics\TestData\Chinese3.txt +//data=DATAZ_\PlatTest\Graphics\TestData\Chinese4.txt \PlatTest\Graphics\TestData\Chinese4.txt +//data=DATAZ_\PlatTest\Graphics\TestData\Latin1.txt \PlatTest\Graphics\TestData\Latin1.txt +//data=DATAZ_\PlatTest\Graphics\TestData\Latin2.txt \PlatTest\Graphics\TestData\Latin2.txt +//data=DATAZ_\PlatTest\Graphics\TestData\Latin3.txt \PlatTest\Graphics\TestData\Latin3.txt +//data=DATAZ_\PlatTest\Graphics\TestData\Latin4.txt \PlatTest\Graphics\TestData\Latin4.txt + REM sprite animation dll file for sprite performance tests file=ABI_DIR\DEBUG_DIR\te_spriteanimdll.dll system\libs\te_spriteanimdll.dll diff -r 6a1564a2f3e6 -r 18f84489a694 graphicstest/uibench/group/te_uibench.mmp --- a/graphicstest/uibench/group/te_uibench.mmp Fri Sep 17 08:36:49 2010 +0300 +++ b/graphicstest/uibench/group/te_uibench.mmp Mon Oct 04 02:31:51 2010 +0300 @@ -44,6 +44,7 @@ SOURCE textendedbitmap.cpp SOURCE tfbsglyphdata.cpp SOURCE trenderorientation.cpp +SOURCE tfbsfontrasterizeperf.cpp USERINCLUDE ../src USERINCLUDE ../../../fbs/fontandbitmapserver/inc diff -r 6a1564a2f3e6 -r 18f84489a694 graphicstest/uibench/scripts/te_uibench.script --- a/graphicstest/uibench/scripts/te_uibench.script Fri Sep 17 08:36:49 2010 +0300 +++ b/graphicstest/uibench/scripts/te_uibench.script Mon Oct 04 02:31:51 2010 +0300 @@ -47,7 +47,7 @@ RUN_TEST_STEP 200 te_uibench tspriteperf z:\uibench\te_uibench.ini RUN_TEST_STEP 1000 te_uibench textendedbitmap z:\uibench\te_uibench.ini RUN_TEST_STEP 2000 te_uibench tfbsglyphdata z:\uibench\te_uibench.ini - +//RUN_TEST_STEP 5400 te_uibench tfbsfontrasterizeperf z:\uibench\te_uibench.ini // Performance tests Script for Hindi text rendering RUN_SCRIPT z:\uibench\te_uibench_gdi.script diff -r 6a1564a2f3e6 -r 18f84489a694 graphicstest/uibench/src/te_graphicsperformanceSuiteServer.cpp --- a/graphicstest/uibench/src/te_graphicsperformanceSuiteServer.cpp Fri Sep 17 08:36:49 2010 +0300 +++ b/graphicstest/uibench/src/te_graphicsperformanceSuiteServer.cpp Mon Oct 04 02:31:51 2010 +0300 @@ -41,6 +41,7 @@ #include "tspriteperf.h" #include "textendedbitmap.h" #include "tfbsglyphdata.h" +#include "tfbsfontrasterizeperf.h" /** Same code for Secure and non-secure variants @@ -161,5 +162,7 @@ testStep = new CTExtendedBitmap(); else if(aStepName == KTFbsGlyphData) testStep = new CTFbsGlyphData(); + else if(aStepName == KTFbsFontRasterizePerfName) + testStep = new CTFbsFontRasterizePerf(); return testStep; } diff -r 6a1564a2f3e6 -r 18f84489a694 graphicstest/uibench/src/teventhandlingperf.cpp --- a/graphicstest/uibench/src/teventhandlingperf.cpp Fri Sep 17 08:36:49 2010 +0300 +++ b/graphicstest/uibench/src/teventhandlingperf.cpp Mon Oct 04 02:31:51 2010 +0300 @@ -186,13 +186,13 @@ INFO_PRINTF5(_L("TID: Average time for Single pointer(wait after each event) for 4 events:%i 8 events:%i 16 events:%i 32events:%i"), avg4Events, avg8Events, avg16Events, avg32Events); break; case 1: - INFO_PRINTF5(_L("TID: Average time for Multi pointer(wait after each event) for 4 events:%i 8 events:%i 16 events:%i 32events:%i"), avg4Events, avg8Events, avg16Events, avg32Events); + INFO_PRINTF5(_L("TID: Average time for multipointer(wait after each event) for 4 events:%i 8 events:%i 16 events:%i 32events:%i"), avg4Events, avg8Events, avg16Events, avg32Events); break; case 2: INFO_PRINTF5(_L("TID: Average time for single pointer for 4 events:%i 8 events:%i 16 events:%i 32events:%i"), avg4Events, avg8Events, avg16Events, avg32Events); break; case 3: - INFO_PRINTF5(_L("TID: Average time for Multi pointer for 4 events:%i 8 events:%i 16 events:%i 32events:%i"), avg4Events, avg8Events, avg16Events, avg32Events); + INFO_PRINTF5(_L("TID: Average time for multipointer for 4 events:%i 8 events:%i 16 events:%i 32events:%i"), avg4Events, avg8Events, avg16Events, avg32Events); SetTestStepResult(EPass); break; default: diff -r 6a1564a2f3e6 -r 18f84489a694 graphicstest/uibench/src/tfbsfontrasterizeperf.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graphicstest/uibench/src/tfbsfontrasterizeperf.cpp Mon Oct 04 02:31:51 2010 +0300 @@ -0,0 +1,713 @@ +// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// tfbsfontrasterizeperf.cpp +// +// + +/** + @file + @test + @internalComponent - Internal test code +*/ + +#include +#include "tfbsfontrasterizeperf.h" + +const TPtrC CTFbsFontRasterizePerf::TCacheTestParam::KLangText[] = {_L("Latin"), _L("Chinese")}; + +_LIT(KLatinText, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()_+-=|:;,.> testName; + testName.Format(_L("%S_%S_%d_%d"), &aTestName, &aParam.KLangText[aParam.iLang], aParam.iGlyphBitmapType, aParam.iHeight); + + iProfiler->SetStoreResultInTimingOrder(EFalse); + + iProfiler->InitResults(); + for (TInt count = 0; count < KCount; count++) + { + err = aTs->InstallFile(KChineseFontFileName, fontFileId); + TEST(err == KErrNone); + + err = aTs->GetNearestFontToDesignHeightInPixels(font, fontSpec); + TEST(err == KErrNone); + + for (TInt i = 0; i < aParam.iFrom; i++) // fill cache using the characters before aText[from] + { + const CFont::TCharacterDataAvailability availability = + font->GetCharacterData(aParam.iText[i], metrics, bitmapBytes, bitmapSize); + TEST(availability == CFont::EAllCharacterData); + } + + for (TInt i = aParam.iFrom; i < aParam.iTo; i++) // using characters before aText[to] to avoid using glyphCache/sessionCache + { + iProfiler->StartTimer(); + const CFont::TCharacterDataAvailability availability = + font->GetCharacterData(aParam.iText[i], metrics, bitmapBytes, bitmapSize); + iProfiler->MarkResultSetL(); + TEST(availability == CFont::EAllCharacterData); // May fails due to no enough memory for large size character on emulator + } + + aTs->ReleaseFont(font); // Release font, cache will be released also. + aTs->RemoveFile(fontFileId); + } + iProfiler->ResultsAnalysis(testName, 0, 0, 0, KIters); + } + +void CTFbsFontRasterizePerf::TestItypeRasterizeL() + { + // + // create heap and glyph data + // + RHeap* heap = UserHeap::ChunkHeap(NULL,0x10000,0x10000); + if (NULL == heap) + { + _LIT(KLog,"Not enough memory to create heap for test"); + INFO_PRINTF1(KLog); + User::Leave(KErrNoMemory); + } + + TOpenFontGlyphData* openFontGlyphData = TOpenFontGlyphData::New(heap, 36 * 1024); + TEST(openFontGlyphData != NULL); + + TBuf<48> testName; + RBuf16 ChineseText; + ChineseText.Create(256 * 5); + ChineseText.Append(KChineseText1); + ChineseText.Append(KChineseText2); + ChineseText.Append(KChineseText3); + ChineseText.Append(KChineseText4); + ChineseText.Append(KChineseText5); + ChineseText.CleanupClosePushL(); + + TCacheTestParam cacheTestParams[] = + { + {KFontSizeInPixels[0], AntiAliased::KGlyphBitmapType, TCacheTestParam::ELatin, KLatinText, 0, 0}, + {KFontSizeInPixels[0], MonoChrome::KGlyphBitmapType, TCacheTestParam::ELatin, KLatinText, 0, 0}, + {KFontSizeInPixels[1], AntiAliased::KGlyphBitmapType, TCacheTestParam::ELatin, KLatinText, 0, 0}, + {KFontSizeInPixels[1], MonoChrome::KGlyphBitmapType, TCacheTestParam::ELatin, KLatinText, 0, 0}, + {KFontSizeInPixels[2], AntiAliased::KGlyphBitmapType, TCacheTestParam::ELatin, KLatinText, 0, 0}, + {KFontSizeInPixels[2], MonoChrome::KGlyphBitmapType, TCacheTestParam::ELatin, KLatinText, 0, 0}, + {KFontSizeInPixels[0], AntiAliased::KGlyphBitmapType, TCacheTestParam::EChinese, ChineseText, 0, 0}, + {KFontSizeInPixels[0], MonoChrome::KGlyphBitmapType, TCacheTestParam::EChinese, ChineseText, 0, 0}, + {KFontSizeInPixels[1], AntiAliased::KGlyphBitmapType, TCacheTestParam::EChinese, ChineseText, 0, 0}, + {KFontSizeInPixels[1], MonoChrome::KGlyphBitmapType, TCacheTestParam::EChinese, ChineseText, 0, 0}, + {KFontSizeInPixels[2], AntiAliased::KGlyphBitmapType, TCacheTestParam::EChinese, ChineseText, 0, 0}, + {KFontSizeInPixels[2], MonoChrome::KGlyphBitmapType, TCacheTestParam::EChinese, ChineseText, 0, 0} + }; + + const TInt KNum = sizeof(cacheTestParams) / sizeof(cacheTestParams[0]); + for (TInt i = 0; i < KNum; i++) + { + DoTestItypeRasterizeL(heap, cacheTestParams[i], openFontGlyphData); + } + + CleanupStack::PopAndDestroy(&ChineseText); + heap->Free(openFontGlyphData); + heap->Close(); + } + +void CTFbsFontRasterizePerf::DoTestItypeRasterizeL(RHeap* aHeap, const TCacheTestParam& aParam, TOpenFontGlyphData* aGlyphData) + { + const TInt KCount = 10; + const TInt KIters = aParam.iText.Length() * KCount; + CBitmapFont* font = NULL; + TFontSpec fontSpec(KChineseFontName, aParam.iHeight); + fontSpec.iFontStyle.SetBitmapType(aParam.iGlyphBitmapType); + TBuf<48> testName; + testName.Format(_L("TestItypeRasterizeL_%S_%d_%d"), &aParam.KLangText[aParam.iLang], aParam.iGlyphBitmapType, aParam.iHeight); + + // Perform the iterations to test + iProfiler->InitResults(); + for (TInt count = 0; count < KCount; count++) + { + // + // create CFontStore + // + CFontStore* fontStore = CFontStore::NewL(aHeap); + CleanupStack::PushL(fontStore); + + // + // Install the rasterizer. + // + COpenFontRasterizer* rasterizer = COpenFontRasterizer::NewL(TUid::Uid(0x101F7F5E)); + CleanupStack::PushL(rasterizer); + fontStore->InstallRasterizerL(rasterizer); + CleanupStack::Pop(rasterizer); + + // + // Add font files + // + TInt ret = KErrNone; + TUid id1 = TUid::Uid(0); + TRAP(ret, id1 = fontStore->AddFileL(KChineseFontFileName)); + TEST(ret==KErrNone); + + // + // Create font + TInt err = fontStore->GetNearestFontToDesignHeightInPixels((CFont*&)font, fontSpec); + TEST(err == KErrNone); + + // + // rasterize + // + for (TInt i = 0; i < aParam.iText.Length(); i++) + { + iProfiler->StartTimer(); + font->OpenFont()->RasterizeL(aParam.iText[i], aGlyphData); + iProfiler->MarkResultSetL(); + } + + // + // release resources + // + fontStore->ReleaseFont(font); + CleanupStack::PopAndDestroy(fontStore); + } + iProfiler->ResultsAnalysis(testName, 0, 0, 0, KIters); + REComSession::FinalClose(); //close the ecom session opened by COpenFontRasterizer::NewL() + } + +void CTFbsFontRasterizePerf::TestLoadFontsAtStartupL() + { + const TInt KCount = 100; + RHeap* heap = UserHeap::ChunkHeap(NULL,0x10000,0x10000); + if (NULL == heap) + { + _LIT(KLog,"Not enough memory to create heap for test"); + INFO_PRINTF1(KLog); + User::Leave(KErrNoMemory); + } + + // Perform the iterations to test + iProfiler->InitResults(); + for(TInt count=KCount; count>0; --count) + { + CFontStore* fontStore = CFontStore::NewL(heap); + CleanupStack::PushL(fontStore); + + // Install the rasterizer. + COpenFontRasterizer* rasterizer = COpenFontRasterizer::NewL(TUid::Uid(0x101F7F5E)); + CleanupStack::PushL(rasterizer); + fontStore->InstallRasterizerL(rasterizer); + CleanupStack::Pop(rasterizer); + + iProfiler->StartTimer(); + fontStore->LoadFontsAtStartupL(); + iProfiler->MarkResultSetL(); + + CleanupStack::PopAndDestroy(fontStore); + } + iProfiler->ResultsAnalysis(_L("TestLoadFontsAtStartupL"), 0, 0, 0, KCount); + + REComSession::FinalClose(); //close the ecom session opened by COpenFontRasterizer::NewL() + heap->Close(); + } + +void CTFbsFontRasterizePerf::FontGetCharacterDataMultiSessionL() + { + CFbsTypefaceStore* ts = CFbsTypefaceStore::NewL(NULL); + CleanupStack::PushL(ts); + TInt fontFileId = 0; + TInt err = ts->InstallFile(KChineseFontFileName, fontFileId); + TEST(err == KErrNone); + + TInt PixelHeightInTwips = 0; + TMachineInfoV1Buf machineInfoBuffer; + User::LeaveIfError(UserHal::MachineInfo(machineInfoBuffer)); + const TSize twipSize = machineInfoBuffer().iPhysicalScreenSize; + const TSize pixelSize = machineInfoBuffer().iDisplaySizeInPixels; + if (twipSize.iHeight > 0 && pixelSize.iHeight > 0) + PixelHeightInTwips = twipSize.iHeight * 1000 / pixelSize.iHeight; + INFO_PRINTF2(_L("KPixelHeightInTwips = %d"),PixelHeightInTwips); + + TFontSpec fontSpec(KChineseFontName, 2); + fontSpec.iHeight = 200; + + fontSpec.iFontStyle.SetBitmapType(AntiAliased::KGlyphBitmapType); + INFO_PRINTF1(_L("FontHeight = 200 pixel; BitmapType = AntiAliased - FontGetCharacterDataMultiSession")); + DoFontGetCharacterDataMultiSessionL(fontSpec); + + fontSpec.iFontStyle.SetBitmapType(MonoChrome::KGlyphBitmapType); + INFO_PRINTF1(_L("FontHeight = 200 pixel; BitmapType = MonoChrome - FontGetCharacterDataMultiSession")); + DoFontGetCharacterDataMultiSessionL(fontSpec); + + + fontSpec.iHeight = 50; + + fontSpec.iFontStyle.SetBitmapType(AntiAliased::KGlyphBitmapType); + INFO_PRINTF1(_L("FontHeight = 50 pixel; BitmapType = AntiAliased - FontGetCharacterDataMultiSession")); + DoFontGetCharacterDataMultiSessionL(fontSpec); + + fontSpec.iFontStyle.SetBitmapType(MonoChrome::KGlyphBitmapType); + INFO_PRINTF1(_L("FontHeight = 50 pixel; BitmapType = MonoChrome - FontGetCharacterDataMultiSession")); + DoFontGetCharacterDataMultiSessionL(fontSpec); + + ts->RemoveFile(fontFileId); + CleanupStack::PopAndDestroy(ts); + } + + +void CTFbsFontRasterizePerf::DoFontGetCharacterDataMultiSessionL(TFontSpec& aFontSpec) + { + RArray fileNames; + CleanupClosePushL(fileNames); + fileNames.AppendL(TPtrC(KInputFileLatin1)); + fileNames.AppendL(TPtrC(KInputFileChinese1)); + + const TInt KNumOfThreads = 4; + + TMultiThreadPara paras[KNumOfThreads]; + Mem::FillZ(paras,sizeof(TMultiThreadPara) * KNumOfThreads); + + RThread workers[KNumOfThreads]; + TRequestStatus statusArray[KNumOfThreads]; + + // --- KNumOfThreads Render same input file. (Latin and Chinese) + for(TInt count=0; count < fileNames.Count(); count++) + { + for(TInt i = 0; i < KNumOfThreads; i++) + { + paras[i].iSpec = &aFontSpec; + paras[i].iFileName.Set(fileNames[count]); + User::LeaveIfError(workers[i].Create(KNullDesC,FontGetCharacterDataThread,0x10000,0x1000,0x10000,reinterpret_cast(¶s[i]))); + statusArray[i] = KRequestPending; + workers[i].Logon(statusArray[i]); + } + for(TInt i = 0; i < KNumOfThreads; i++) + { + workers[i].Resume(); + } + + TBool bFinished = EFalse; + do{ + User::WaitForAnyRequest(); + bFinished = ETrue; + for(TInt i = 0; i < KNumOfThreads; i++) + { + if(statusArray[i] == KRequestPending) + { + bFinished = EFalse; + } + else + { + workers[i].Close(); + } + } + }while(!bFinished); + for(TInt i = 0; i < KNumOfThreads; i++) + { + TBuf<128> NameBuf; + NameBuf.AppendFormat(_L("Font-GetCharacterData-MutiSession-%d"),i); + _LIT(KVariantMax,"Max"); + _LIT(KVariantMin,"Min"); + _LIT(KVariantMean,"Mean"); + iProfiler->SqlInsert(&NameBuf,&KVariantMax,&KMicroSeconds,paras[i].iTimeMax); + iProfiler->SqlInsert(&NameBuf,&KVariantMin,&KMicroSeconds,paras[i].iTimeMin); + iProfiler->SqlInsert(&NameBuf,&KVariantMean,&KMicroSeconds,paras[i].iMean); + INFO_PRINTF3(_L("File = %S,Iters = %d"),¶s[i].iFileName, paras[i].iIters); + } + } + + // KNumOfThreads Render different input file. + + Mem::FillZ(paras,sizeof(TMultiThreadPara) * KNumOfThreads); + fileNames.Reset(); + // Append num of the files in same script = KNumOfThreads + fileNames.AppendL(TPtrC(KInputFileLatin1)); + fileNames.AppendL(TPtrC(KInputFileLatin2)); + fileNames.AppendL(TPtrC(KInputFileLatin3)); + fileNames.AppendL(TPtrC(KInputFileLatin4)); + fileNames.AppendL(TPtrC(KInputFileChinese1)); + fileNames.AppendL(TPtrC(KInputFileChinese2)); + fileNames.AppendL(TPtrC(KInputFileChinese3)); + fileNames.AppendL(TPtrC(KInputFileChinese4)); + + for (TInt count = 0; count < 2; count++) + { + for (TInt i = 0; i < KNumOfThreads; i++) + { + paras[i].iSpec = &aFontSpec; + paras[i].iFileName.Set(fileNames[i + count * KNumOfThreads]); + User::LeaveIfError(workers[i].Create(KNullDesC, + FontGetCharacterDataThread, 0x10000, 0x1000, 0x10000, + reinterpret_cast (¶s[i]))); + statusArray[i] = KRequestPending; + workers[i].Logon(statusArray[i]); + } + for (TInt i = 0; i < KNumOfThreads; i++) + { + workers[i].Resume(); + } + + TBool bFinished = EFalse; + do + { + User::WaitForAnyRequest(); + bFinished = ETrue; + for (TInt i = 0; i < KNumOfThreads; i++) + { + if (statusArray[i] == KRequestPending) + { + bFinished = EFalse; + } + else + { + workers[i].Close(); + } + } + } + while (!bFinished); + for (TInt i = 0; i < KNumOfThreads; i++) + { + TBuf<128> NameBuf; + NameBuf.AppendFormat(_L("Font-GetCharacterData-MutiSession-%d"), i); + _LIT(KVariantMax,"Max"); + _LIT(KVariantMin,"Min"); + _LIT(KVariantMean,"Mean"); + iProfiler->SqlInsert(&NameBuf, &KVariantMax, &KMicroSeconds, + paras[i].iTimeMax); + iProfiler->SqlInsert(&NameBuf, &KVariantMin, &KMicroSeconds, + paras[i].iTimeMin); + iProfiler->SqlInsert(&NameBuf, &KVariantMean, &KMicroSeconds, + paras[i].iMean); + INFO_PRINTF3(_L("File = %S,Iters = %d"),¶s[i].iFileName, paras[i].iIters); + } + } + + CleanupStack::PopAndDestroy(); + } + +TInt CTFbsFontRasterizePerf::FontGetCharacterDataThread(TAny * aPtr) + { + // Create cleanup stack + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + + // Create output console + TRAPD(createError, FontGetCharacterDataWorkerL((reinterpret_cast (aPtr)))); + if (createError) + { + delete cleanup; + return createError; + } + + delete cleanup; + __UHEAP_MARKEND; + return KErrNone; + } + +void CTFbsFontRasterizePerf::FontGetCharacterDataWorkerL(TMultiThreadPara *aPara) + { + User::LeaveIfError(RFbsSession::Connect()); + CFbsFont* font = NULL; + CFbsTypefaceStore* ts = CFbsTypefaceStore::NewL(NULL); + CleanupStack::PushL(ts); + + TFontSpec spec = *aPara->iSpec; + + User::LeaveIfError(ts->GetNearestFontToDesignHeightInPixels((CFont*&) font, spec)); + + TUint32 start = 0; + TUint32 end = 0; + TInt freq = 0; + User::LeaveIfError((HAL::Get(HALData::EFastCounterFrequency, freq))); + if(freq == 0) + { + User::Leave(KErrDivideByZero); + } + + // Load text from file + RFs fs; + User::LeaveIfError(fs.Connect()); + CleanupClosePushL(fs); + + RFile in; + User::LeaveIfError(in.Open(fs, aPara->iFileName, EFileShareReadersOnly | EFileStreamText)); + CleanupClosePushL(in); + + TFileText content; + content.Set(in); + + TBool isFirstChar = ETrue; + TInt64 diffsum = 0; + + TBuf<512> buf; + while(KErrNone == content.Read(buf)) + { + TOpenFontCharMetrics metrics; + const TUint8* bitmap; + TSize bitmapSize; + for (TInt i = 0; i < buf.Length(); i++) + { + CFont::TCharacterDataAvailability ret; + start = User::FastCounter(); + ret = font->GetCharacterData(buf[i], metrics, bitmap, bitmapSize); + end = User::FastCounter(); + ASSERT(ret = CFont::EAllCharacterData); + TInt64 diff = (1000000 * (TInt64) (end - start)) / (TInt64) freq; + if(diff == 0) + { + diff = 1; + } + diffsum += diff; + ASSERT(diffsum >= 0); + aPara->iIters++; + if (isFirstChar) + { + aPara->iTimeMax = aPara->iTimeMin = diff; + isFirstChar = EFalse; + } + else + { + if (diff > aPara->iTimeMax) + { + aPara->iTimeMax = diff; + } + if (diff < aPara->iTimeMin) + { + aPara->iTimeMin = diff; + } + } + } + } + + // Write back Iters + if(aPara->iIters != 0) + { + aPara->iMean = diffsum / aPara->iIters; + } + RDebug::Print(_L("diffsum=%Ld"),diffsum); + + ts->ReleaseFont(font); + CleanupStack::PopAndDestroy(3); + RFbsSession::Disconnect(); + } diff -r 6a1564a2f3e6 -r 18f84489a694 graphicstest/uibench/src/tfbsfontrasterizeperf.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graphicstest/uibench/src/tfbsfontrasterizeperf.h Mon Oct 04 02:31:51 2010 +0300 @@ -0,0 +1,89 @@ +// Copyright (c)2010 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// tfbsfontrasterizeperf.h +// +// + +/** + @file + @test + @internalComponent - Internal test code +*/ + +#ifndef __TFBSFONTRASTERIZEPERF_H__ +#define __TFBSFONTRASTERIZEPERF_H__ + +#include "te_graphicsperformanceSuiteStepBase.h" +#include +#include + +class CTFbsFontRasterizePerf : public CTe_graphicsperformanceSuiteStepBase + { +public: + CTFbsFontRasterizePerf(); + +private: + class TCacheTestParam + { + public: + enum TLang + { + ELatin, + EChinese + }; + static const TPtrC KLangText[]; + + TInt iHeight; + TGlyphBitmapType iGlyphBitmapType; + TLang iLang; + const TDesC& iText; + TInt iFrom; + TInt iTo; + }; + + void GlyphCacheNotFullL(); + void GlyphCacheFullLSessionCacheNotFullL(); + void GlyphCacheFullLSessionCacheFullL(); + void DoCacheTestL(CFbsTypefaceStore* aTs, const TCacheTestParam& aParam, const TDesC& aTestName); + void TestItypeRasterizeL(); + void DoTestItypeRasterizeL(RHeap* aHeap, const TCacheTestParam& aParam, TOpenFontGlyphData* aGlyphData); + void TestLoadFontsAtStartupL(); + + struct TMultiThreadPara + { + // Input parameters + TFontSpec * iSpec; + TPtrC iFileName; + + // WriteBack parameters + TUint32 iTimeMax; + TUint32 iTimeMin; + TUint32 iMean; + TUint32 iIters; + }; + + void FontGetCharacterDataMultiSessionL(); + void DoFontGetCharacterDataMultiSessionL(TFontSpec& aFontSpec); + + static TInt FontGetCharacterDataThread(TAny *); + static void FontGetCharacterDataWorkerL(TMultiThreadPara *aPara); + + // From CStepStep + virtual TVerdict doTestStepPreambleL(); + virtual TVerdict doTestStepL(); + }; + +_LIT(KTFbsFontRasterizePerfName,"tfbsfontrasterizeperf"); + +#endif diff -r 6a1564a2f3e6 -r 18f84489a694 m3g/m3gcore11/src/m3g_loader.c --- a/m3g/m3gcore11/src/m3g_loader.c Fri Sep 17 08:36:49 2010 +0300 +++ b/m3g/m3gcore11/src/m3g_loader.c Mon Oct 04 02:31:51 2010 +0300 @@ -781,8 +781,7 @@ isCompatible = M3G_FALSE; break; case M3G_CLASS_MESH: - isCompatible = (objClassID == M3G_CLASS_MESH) - || (objClassID == M3G_CLASS_MORPHING_MESH) + isCompatible = (objClassID == M3G_CLASS_MORPHING_MESH) || (objClassID == M3G_CLASS_SKINNED_MESH); break; default: diff -r 6a1564a2f3e6 -r 18f84489a694 m3g/m3gcore11/src/m3g_vertexbuffer.c --- a/m3g/m3gcore11/src/m3g_vertexbuffer.c Fri Sep 17 08:36:49 2010 +0300 +++ b/m3g/m3gcore11/src/m3g_vertexbuffer.c Mon Oct 04 02:31:51 2010 +0300 @@ -223,7 +223,12 @@ */ static M3Gbool m3gGetVertex(const VertexBuffer *buffer, M3Gint idx, M3GVec3 *v) { - return m3gGetCoordinates(buffer->vertices, 3, idx, &v->x); + M3Gfloat vert[3]; + M3Gbool res = m3gGetCoordinates(buffer->vertices, 3, idx, vert); + if (res == M3G_TRUE) + v->x = vert[0]; v->y = vert[1]; v->z = vert[2]; + + return res; } /*! @@ -238,7 +243,12 @@ */ static M3Gbool m3gGetNormal(const VertexBuffer *buffer, M3Gint idx, M3GVec3 *v) { - return m3gGetCoordinates(buffer->normals, 3, idx, &v->x); + M3Gfloat norm[3]; + M3Gbool res = m3gGetCoordinates(buffer->normals, 3, idx, norm); + if (res == M3G_TRUE) + v->x = norm[0]; v->y = norm[1]; v->z = norm[2]; + + return res; } /*! @@ -255,8 +265,11 @@ */ static M3Gbool m3gGetTexCoord(const VertexBuffer *buffer, M3Gint idx, M3Gint unit, M3GVec3 *v) { - M3Gbool res; - res = m3gGetCoordinates(buffer->texCoords[unit], 2, idx, &v->x); + M3Gfloat texcoord[2]; + M3Gbool res = m3gGetCoordinates(buffer->texCoords[unit], 2, idx, texcoord); + + if (res == M3G_TRUE) + v->x = texcoord[0]; v->y = texcoord[1]; v->x = m3gMul(v->x, buffer->texCoordScale[unit]); v->y = m3gMul(v->y, buffer->texCoordScale[unit]); diff -r 6a1564a2f3e6 -r 18f84489a694 windowing/windowserver/SERVER/w32cmd.h --- a/windowing/windowserver/SERVER/w32cmd.h Fri Sep 17 08:36:49 2010 +0300 +++ b/windowing/windowserver/SERVER/w32cmd.h Mon Oct 04 02:31:51 2010 +0300 @@ -262,7 +262,6 @@ EWsClOpSendEffectCommand, EWsClOpRegisterTFXEffectBuf, EWsClOpRegisterTFXEffectIPC, - EWsClOpUnregisterTFXEffect, EWsClOpUnregisterAllTFXEffect, EWsClOpOverrideEffectBuf, EWsClOpOverrideEffectIPC, @@ -440,6 +439,7 @@ EWsWinOpSendEffectCommand, EWsWinOpOverrideEffectBuf, EWsWinOpOverrideEffectIPC, + EWsWinOpSetPointerAcceptanceRegion, EWsWinOpTestLowPriorityRedraw=0x2000, //Specific opcode for testing redraw queue priorities }; @@ -988,13 +988,6 @@ TUint tfxAppUid; TBitFlags tfxFlags; }; -struct TWsClCmdUnRegisterEffect - { - inline TWsClCmdUnRegisterEffect(TInt aAction, TInt aPurpose, TUint aAppUid); - TInt tfxAction; - TInt tfxPurpose; - TUint tfxAppUid; - }; struct TWsClCmdOverrideEffect { inline TWsClCmdOverrideEffect(TInt aAction, TInt aPurpose, TInt aDirStrSize, TInt aPhase1StrSize, TInt aPhase2StrSize, TBitFlags aFlags); @@ -1058,7 +1051,6 @@ const TWsClCmdCreateDrawableSource* CreateDrawableSource; const TWsClCmdSendEffectCommand* SendEffectCommand; const TWsClCmdRegisterEffect* RegisterEffect; - const TWsClCmdUnRegisterEffect* UnRegisterEffect; const TWsClCmdOverrideEffect* OverrideEffect; const TRenderOrientation* Orientation; }; @@ -2289,9 +2281,6 @@ inline TWsClCmdRegisterEffect::TWsClCmdRegisterEffect(TInt aAction, TInt aPurpose, TInt aDirStrSize, TInt aPhase1StrSize, TInt aPhase2StrSize, TUint aAppUid, TBitFlags aFlags) : tfxAction(aAction), tfxPurpose(aPurpose), tfxDirStrSize(aDirStrSize), tfxPhase1StrSize(aPhase1StrSize), tfxPhase2StrSize(aPhase2StrSize), tfxAppUid(aAppUid), tfxFlags(aFlags) {} -inline TWsClCmdUnRegisterEffect::TWsClCmdUnRegisterEffect(TInt aAction, TInt aPurpose, TUint aAppUid) : - tfxAction(aAction), tfxPurpose(aPurpose), tfxAppUid(aAppUid) - {} inline TWsClCmdOverrideEffect::TWsClCmdOverrideEffect(TInt aAction, TInt aPurpose, TInt aDirStrSize, TInt aPhase1StrSize, TInt aPhase2StrSize, TBitFlags aFlags) : tfxAction(aAction), tfxPurpose(aPurpose), tfxDirStrSize(aDirStrSize), tfxPhase1StrSize(aPhase1StrSize), tfxPhase2StrSize(aPhase2StrSize), tfxFlags(aFlags) {} diff -r 6a1564a2f3e6 -r 18f84489a694 windowing/windowserver/bwins/WS322U.DEF --- a/windowing/windowserver/bwins/WS322U.DEF Fri Sep 17 08:36:49 2010 +0300 +++ b/windowing/windowserver/bwins/WS322U.DEF Mon Oct 04 02:31:51 2010 +0300 @@ -583,7 +583,8 @@ ?RegisterEffect@RWsSession@@QAEXHHABV?$TBuf@$0BAA@@@00IV?$TBitFlagsT@K@@@Z @ 582 NONAME ; void RWsSession::RegisterEffect(int, int, class TBuf<256> const &, class TBuf<256> const &, class TBuf<256> const &, unsigned int, class TBitFlagsT) ?OverrideEffects@RWindowBase@@QAEXHABV?$TBuf@$0BAA@@@00V?$TBitFlagsT@K@@@Z @ 583 NONAME ; void RWindowBase::OverrideEffects(int, class TBuf<256> const &, class TBuf<256> const &, class TBuf<256> const &, class TBitFlagsT) ?OverrideEffects@RWsSession@@QAEXHHABV?$TBuf@$0BAA@@@00V?$TBitFlagsT@K@@@Z @ 584 NONAME ; void RWsSession::OverrideEffects(int, int, class TBuf<256> const &, class TBuf<256> const &, class TBuf<256> const &, class TBitFlagsT) - ?UnregisterEffect@RWsSession@@QAEXHHI@Z @ 585 NONAME ; void RWsSession::UnregisterEffect(int, int, unsigned int) + ?UnregisterEffect@RWsSession@@QAEXHHI@Z @ 585 NONAME ABSENT ; void RWsSession::UnregisterEffect(int, int, unsigned int) ?UnregisterAllEffects@RWsSession@@QAEXXZ @ 586 NONAME ; void RWsSession::UnregisterAllEffects(void) ?IndicateAppOrientation@RWsSession@@QAEXW4TRenderOrientation@@@Z @ 587 NONAME ; void RWsSession::IndicateAppOrientation(enum TRenderOrientation) + ?SetPointerAcceptanceRegion@RWindowBase@@QAEHABVTRegion@@@Z @ 588 NONAME ; int RWindowBase::SetPointerAcceptanceRegion(class TRegion const &) diff -r 6a1564a2f3e6 -r 18f84489a694 windowing/windowserver/bwins/ws32switchu.def --- a/windowing/windowserver/bwins/ws32switchu.def Fri Sep 17 08:36:49 2010 +0300 +++ b/windowing/windowserver/bwins/ws32switchu.def Mon Oct 04 02:31:51 2010 +0300 @@ -427,8 +427,8 @@ call_vector_426 @ 426 NONAME ; void RBlankWindow::SetColor(void) call_vector_427 @ 427 NONAME ; int RWsSession::SetClientCursorMode(enum TPointerCursorMode) call_vector_428 @ 428 NONAME ; class TRect RDrawableWindow::GetDrawRect(void) const - call_vector_429 @ 429 NONAME - call_vector_430 @ 430 NONAME + call_vector_429 @ 429 NONAME + call_vector_430 @ 430 NONAME call_vector_431 @ 431 NONAME ; void CWindowGc::Reserved_CWindowGc_3(void) call_vector_432 @ 432 NONAME ; void CWindowGc::Reserved_CWindowGc_4(void) call_vector_433 @ 433 NONAME ; void CWindowGc::Reserved_CWindowGc_5(void) @@ -512,20 +512,20 @@ call_vector_511 @ 511 NONAME ; int RWsSession::DebugInfo(int, int) const call_vector_512 @ 512 NONAME ; unsigned long RWindowTreeNode::ClientHandle(void) const call_vector_513 @ 513 NONAME ; int RWindowBase::SetBackgroundSurface(class TSurfaceId const &) - call_vector_514 @ 514 NONAME + call_vector_514 @ 514 NONAME call_vector_515 @ 515 NONAME ; class TRgb RWindowBase::KeyColor(void) const - call_vector_516 @ 516 NONAME - call_vector_517 @ 517 NONAME - call_vector_518 @ 518 NONAME - call_vector_519 @ 519 NONAME - call_vector_520 @ 520 NONAME + call_vector_516 @ 516 NONAME + call_vector_517 @ 517 NONAME + call_vector_518 @ 518 NONAME + call_vector_519 @ 519 NONAME + call_vector_520 @ 520 NONAME call_vector_521 @ 521 NONAME ; int RWindowBase::GetBackgroundSurface(class TSurfaceConfiguration &) const - call_vector_522 @ 522 NONAME + call_vector_522 @ 522 NONAME call_vector_523 @ 523 NONAME ; int RWsSession::PreferredSurfaceConfigurationSize(void) const call_vector_524 @ 524 NONAME ; int RWsSession::RegisterSurface(int, class TSurfaceId const &) - call_vector_525 @ 525 NONAME + call_vector_525 @ 525 NONAME call_vector_526 @ 526 NONAME ; void RWindowBase::RemoveBackgroundSurface(int) - call_vector_527 @ 527 NONAME + call_vector_527 @ 527 NONAME call_vector_528 @ 528 NONAME ; int RWindowBase::SetBackgroundSurface(class TSurfaceConfiguration const &, int) call_vector_529 @ 529 NONAME ; void RWsSession::UnregisterSurface(int, class TSurfaceId const &) call_vector_530 @ 530 NONAME ; void RWindow::ClearRedrawStore(void) @@ -586,4 +586,5 @@ call_vector_585 @ 585 NONAME ; void RWsSession::UnregisterEffect(int, int, unsigned int) call_vector_586 @ 586 NONAME ; void RWsSession::UnregisterAllEffects(void) call_vector_587 @ 587 NONAME ; void RWsSession::IndicateAppOrientation(enum TRenderOrientation) + call_vector_588 @ 588 NONAME ; int RWindowBase::SetPointerAcceptanceRegion(class TRegion const &) diff -r 6a1564a2f3e6 -r 18f84489a694 windowing/windowserver/debuglog/DECODER.CPP --- a/windowing/windowserver/debuglog/DECODER.CPP Fri Sep 17 08:36:49 2010 +0300 +++ b/windowing/windowserver/debuglog/DECODER.CPP Mon Oct 04 02:31:51 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 1995-2010 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available // under the terms of "Eclipse Public License v1.0" @@ -1398,6 +1398,13 @@ aText.AppendFormat(LogWinClearRedrawStore); } break; + case EWsWinOpSetPointerAcceptanceRegion: + { + _LIT(LogWinSetPointerRegion,"SetPointerAcceptanceRegion()"); + aText.AppendFormat(LogWinSetPointerRegion); + } + break; + default: UnKnownOpcode(aText, aOpcode); break; diff -r 6a1564a2f3e6 -r 18f84489a694 windowing/windowserver/eabi/WS322U.DEF --- a/windowing/windowserver/eabi/WS322U.DEF Fri Sep 17 08:36:49 2010 +0300 +++ b/windowing/windowserver/eabi/WS322U.DEF Mon Oct 04 02:31:51 2010 +0300 @@ -656,8 +656,9 @@ _ZN11RWindowBase17SendEffectCommandEiRK6TDesC8 @ 655 NONAME _ZN10RWsSession14RegisterEffectEiiRK4TBufILi256EES3_S3_j10TBitFlagsTImE @ 656 NONAME _ZN10RWsSession15OverrideEffectsEiiRK4TBufILi256EES3_S3_10TBitFlagsTImE @ 657 NONAME - _ZN10RWsSession16UnregisterEffectEiij @ 658 NONAME + _ZN10RWsSession16UnregisterEffectEiij @ 658 NONAME ABSENT _ZN10RWsSession20UnregisterAllEffectsEv @ 659 NONAME _ZN11RWindowBase15OverrideEffectsEiRK4TBufILi256EES3_S3_10TBitFlagsTImE @ 660 NONAME _ZN10RWsSession22IndicateAppOrientationE18TRenderOrientation @ 661 NONAME + _ZN11RWindowBase26SetPointerAcceptanceRegionERK7TRegion @ 662 NONAME diff -r 6a1564a2f3e6 -r 18f84489a694 windowing/windowserver/inc/W32STD.H --- a/windowing/windowserver/inc/W32STD.H Fri Sep 17 08:36:49 2010 +0300 +++ b/windowing/windowserver/inc/W32STD.H Mon Oct 04 02:31:51 2010 +0300 @@ -1536,7 +1536,6 @@ // Registering/Unregistering of TFX effect, to allow animations to be associated with each transition IMPORT_C void RegisterEffect(TInt aAction, TInt aPurpose, const TFileName& aResourceDir, const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TUint aAppUid=0, TBitFlags aFlags=0); - IMPORT_C void UnregisterEffect(TInt aAction, TInt aPurpose, TUint aAppUid=0); IMPORT_C void UnregisterAllEffects(); IMPORT_C void OverrideEffects(TInt aAction, TInt aPurpose, const TFileName& aResourceDir, const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TBitFlags aFlags=0); @@ -1735,6 +1734,7 @@ IMPORT_C void OverrideEffects(TInt aAction, const TFileName& aResourceDir, const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TBitFlags aFlags=0); IMPORT_C TInt FixNativeOrientation(); IMPORT_C TSize SizeForEgl() const; + IMPORT_C TInt SetPointerAcceptanceRegion(const TRegion &aRegion); protected: TInt construct(const RWindowTreeNode &parent,TUint32 aHandle, TInt aType, TDisplayMode aDisplayMode); }; diff -r 6a1564a2f3e6 -r 18f84489a694 windowing/windowserver/nga/CLIENT/RWINDOW.CPP --- a/windowing/windowserver/nga/CLIENT/RWINDOW.CPP Fri Sep 17 08:36:49 2010 +0300 +++ b/windowing/windowserver/nga/CLIENT/RWINDOW.CPP Mon Oct 04 02:31:51 2010 +0300 @@ -1009,7 +1009,7 @@ be sent to that window. Please note that the pointer grab works separately for each pointer present in the system -(for example, separately for each finger touching the multi-touch screen). +(for example, separately for each finger touching the multipointer screen). Pointer grab can be used for drag-and-drop or other situations when you want the events delivered to the same window even though the pen will be dragged @@ -1087,7 +1087,7 @@ // Due to the inclusion of the pointer number, which could be out of range or similar, this ClaimPointerGrab // overload needs to return an error code. // Returning this error code requires a flush of the command buffer (to avoid deadlocking the client/server) - // so this cannot be done for the older non-multitouch API as it would be a compatibility break; + // so this cannot be done for the older non-multipointer API as it would be a compatibility break; grabControlFlags |= TWsWinCmdGrabControl::ESendReply; TWsWinCmdGrabControl params(aPointerNumber, grabControlFlags); return(WriteReply(¶ms,sizeof(params),EWsWinOpClaimPointerGrab)); @@ -1185,6 +1185,32 @@ return(WriteReplyByProvidingRemoteReadAccess(®ionCount,sizeof(regionCount),&ptrRect,EWsWinOpSetShape)); } +/** Sets a region of a window that can receive pointer events. + +Once this region is set, pointer events must be within both this region and the window's base area to be received. +If an empty pointer acceptance region is set, then no pointer events will be received by this window. +Pointer events that fall outside of this region will be processed for any windows underneath. +Prior to calling this API the whole base area of the window can receive pointer events. + +If a window is moved, the pointer acceptance region will move with it. + +If a window is re-sized, the pointer region will NOT change shape/size automatically ( though it +will still be clipped by the window's base area ). +The new size/shape must be set explicitly from the client/application side using this API. + +This function always causes a flush of the window server buffer. + +@param aRegion Region defining the pointer acceptance region shape in window relative coordinates. +@return KErrNone if successful, otherwise one of the system-wide error codes. +*/ +EXPORT_C TInt RWindowBase::SetPointerAcceptanceRegion(const TRegion &aRegion) + { + __ASSERT_DEBUG(!aRegion.CheckError(),Panic(EW32PanicInvalidRegion)); + const TInt regionCount=aRegion.Count(); + TPtrC8 ptrRect(reinterpret_cast(aRegion.RectangleList()),regionCount*sizeof(TRect)); + return(WriteReplyByProvidingRemoteReadAccess(®ionCount,sizeof(regionCount),&ptrRect,EWsWinOpSetPointerAcceptanceRegion)); + } + /** This method has been deprecated. Windows can no longer be associated with a display mode other than the system display mode. This method no longer has any effect and will @@ -1322,7 +1348,7 @@ // Due to the inclusion of the pointer number, which could be out of range or similar, this ClaimPointerGrab // overload needs to return an error code. // Returning this error code requires a flush of the command buffer (to avoid deadlocking the client/server) - // so this cannot be done for the older non-multitouch API as it would be a compatibility break; + // so this cannot be done for the older non-multipointer API as it would be a compatibility break; TWsWinCmdRequestPointerRepeatEvent params(aTime,aRect,aPointerNumber,TWsWinCmdRequestPointerRepeatEvent::ERepeatFlagsSendReply); return WriteReply(¶ms,sizeof(params),EWsWinOpRequestPointerRepeatEvent); } @@ -1345,7 +1371,7 @@ // Due to the inclusion of the pointer number, which could be out of range or similar, this ClaimPointerGrab // overload needs to return an error code. // Returning this error code requires a flush of the command buffer (to avoid deadlocking the client/server) - // so this cannot be done for the older non-multitouch API as it would be a compatibility break; + // so this cannot be done for the older non-multipointer API as it would be a compatibility break; TWsWinCmdCancelPointerRepeatEventRequest params(aPointerNumber, TWsWinCmdCancelPointerRepeatEventRequest::ECancelRepeatFlagsSendReply); errNo = WriteReply(¶ms,sizeof(params),EWsWinOpCancelPointerRepeatEventRequest); } @@ -1410,7 +1436,7 @@ and then delivers the entire buffer when it is full. If there are multiple pointers available in the system (for example there is -a multi-touch screen present), for compatibility reasons only events coming from the +a multipointer screen present), for compatibility reasons only events coming from the single emulated pointer will be stored in a pointer buffer. For more information about emulated pointer please refer to the comment of RWindowBase::EnableAdvancedPointers() method. diff -r 6a1564a2f3e6 -r 18f84489a694 windowing/windowserver/nga/CLIENT/RWS.CPP --- a/windowing/windowserver/nga/CLIENT/RWS.CPP Fri Sep 17 08:36:49 2010 +0300 +++ b/windowing/windowserver/nga/CLIENT/RWS.CPP Mon Oct 04 02:31:51 2010 +0300 @@ -1956,7 +1956,7 @@ It always causes a flush of the window server buffer. -Please note that on devices with multiple pointers (for example with multi-touch screen) +Please note that on devices with multiple pointers (for example with multipointer screen) the pointer cursor's position will be equal to the last known position of the emulated pointer. More information about the emulated pointer can be found in description of method RWindowBase::EnableAdvancedPointers(). @@ -2535,23 +2535,6 @@ tfxEffect.RegisterTFXEffect(aAction, aPurpose, aResourceDir, aFilenameOutgoing, aFilenameIncoming, aAppUid, aFlags); } -EXPORT_C void RWsSession::UnregisterEffect(TInt aAction, TInt aPurpose, TUint aAppUid) -/** -Unregister already set animation for a particular transition effect - -@param aAction Particular transition to unregister the animation for. -@param aPurpose The purpose of the window. -@param aAppUid The Application UID this effect applies to. Set to 0 to specify the default effect will be unregistered. - -@capability WriteDeviceData This API does nothing if the client does not possess required Capability - -@publishedPartner -*/ - { - TWsClCmdUnRegisterEffect unregisterEffect(aAction, aPurpose, aAppUid); - Write(&unregisterEffect, sizeof(unregisterEffect), EWsClOpUnregisterTFXEffect); - } - EXPORT_C void RWsSession::UnregisterAllEffects() /** Unregister animation for all transition effects. diff -r 6a1564a2f3e6 -r 18f84489a694 windowing/windowserver/nga/CLIENT/advancedpointerevent.cpp --- a/windowing/windowserver/nga/CLIENT/advancedpointerevent.cpp Fri Sep 17 08:36:49 2010 +0300 +++ b/windowing/windowserver/nga/CLIENT/advancedpointerevent.cpp Mon Oct 04 02:31:51 2010 +0300 @@ -12,7 +12,7 @@ // // Description: // TAdvancedPointerEvent encapsulates additional information to that contained in TPointerEvent. -// For multi-touch, pressure and proximity. +// For multipointer, pressure and proximity. // // diff -r 6a1564a2f3e6 -r 18f84489a694 windowing/windowserver/nga/SERVER/ROOTWIN.CPP --- a/windowing/windowserver/nga/SERVER/ROOTWIN.CPP Fri Sep 17 08:36:49 2010 +0300 +++ b/windowing/windowserver/nga/SERVER/ROOTWIN.CPP Mon Oct 04 02:31:51 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 1995-2010 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available // under the terms of "Eclipse Public License v1.0" @@ -125,8 +125,8 @@ CWsClientWindow *win=group->Child(); while(win!=NULL) { - const TRegion *baseArea=win->BaseArea(); - if (win->IsVisible() && baseArea->Contains(aInPos)) + + if (win->IsVisible() && win->PointerHit(aInPos)) { aOriginalWinItIsIn=win; winItIsInGroup=group; @@ -152,14 +152,13 @@ CWsClientWindow *win=group->Child(); while(win!=NULL) { - const TRegion *baseArea=win->BaseArea(); const TBool underTheSameGroup=winItIsInGroup==group; if (win->IsVisible() && ((win->iFlags&EFlagPointerCaptured && ((!underTheSameGroup && win->iFlags&EFlagPointerCaptureAllGroups) || (winItIsInGroup==NULL && group==CWsTop::FocusWindowGroup()) || (underTheSameGroup && win->iPointerCapturePriority>=aOriginalWinItIsIn->iPointerCapturePriority))) - || baseArea->Contains(aInPos))) + || win->PointerHit(aInPos))) { winItIsIn=win; win=win->Child(); diff -r 6a1564a2f3e6 -r 18f84489a694 windowing/windowserver/nga/SERVER/openwfc/cliwin.cpp --- a/windowing/windowserver/nga/SERVER/openwfc/cliwin.cpp Fri Sep 17 08:36:49 2010 +0300 +++ b/windowing/windowserver/nga/SERVER/openwfc/cliwin.cpp Mon Oct 04 02:31:51 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 1995-2010 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available // under the terms of "Eclipse Public License v1.0" @@ -511,6 +511,10 @@ RecalcChildAbs(&offset); // Also calls UpdateElementExtent(offset) TWalkWindowTreeOffsetTransparentRegions offsetTransparent(offset); WalkWindowTree(offsetTransparent, EWalkChildren); + + // move the pointer region + if(iPointerRegion) + iPointerRegion->Offset(offset); } if (sizeChanged) @@ -644,6 +648,7 @@ // CWsWindow::Shutdown(); DeleteBaseArea(); + DeletePointerRegion(); CWsPointerBuffer::Disconnect(this); iFlags&=~EFlagShutDownInProgress; } @@ -1028,7 +1033,22 @@ windowTreeObserver->FlagChanged(*this, MWsWindowTreeObserver::EAlphaChannelTransparencyEnabled, ETrue); } break; - } + case EWsWinOpSetPointerAcceptanceRegion: + { + TInt recs=*pData.Int; + + // Use cases + // No Region => normal behaviour using window rect ( but how can we delete an existing region? ) + // Empty Region => no pointer events will hit + // Non-Empty region => pointer events must hit the defined region + + // allow for 0 rects, empty region implies no pointer events will hit + RWsRegion* region=recs>0 ? GetRegionFromClientL(iWsOwner,recs) : new(ELeave) RWsRegion; + + // CWsClientWindow takes ownership of returned region + SetPointerAcceptanceRegion(region); + } + break; default: if (iRedraw->CommandL(aOpcode,pData)==EFalse) { @@ -1394,11 +1414,90 @@ { return iOriginalSrcElementRect; } + TRect CWsClientWindow::GetOriginalDestElementRect() const { return iOriginalDestElementRect; } + +/** Sets a region of a window that can receive pointer events. + +Once this region is set, pointer events must be within both this region and the window's base area to be received. +If an empty pointer acceptance region is set, then no pointer events will be received. +Prior to calling this API the whole base area of the window can receive pointer events. + +If a window is moved, the pointer acceptance region will move with it. + +If a window changes shape, and the pointer acceptance region should also change shape with it, +then the client must use this API to re-set the pointer acceptance region. + +This function always causes a flush of the window server buffer. + +@param aRegion Region defining the pointer acceptance region shape in window relative coordinates, CWsClientWindow takes ownership of this. +*/ +void CWsClientWindow::SetPointerAcceptanceRegion(RWsRegion* aRegion) + { +#ifdef LOG_WSERV_EVENTS + if(aRegion) + { + TRect boundingRect = aRegion->BoundingRect(); + RDebug::Printf("_WSEVENT: CWsClientWindow::SetPointerRegion Rect Count=%d, bounding rect (%d,%d),(%d,%d)", + aRegion->Count(), + boundingRect.iTl.iX, boundingRect.iTl.iY, + boundingRect.iBr.iX, boundingRect.iBr.iY); + } + else + { + // This should probably NEVER be seen because the client side RWindowBase API takes a reference. + RDebug::Printf("_WSEVENT: CWsClientWindow::SetPointerRegion aRegion is NULL"); + } +#endif + DeletePointerRegion(); + + // take ownership + iPointerRegion = aRegion; + // move it to the same absolute origin as the window + if(iPointerRegion) + iPointerRegion->Offset(Origin()); + // N.B. Does NOT need to be clipped while iBaseArea is also used. + } + +void CWsClientWindow::DeletePointerRegion() + { + if (iPointerRegion) + { + iPointerRegion->Destroy(); + iPointerRegion = NULL; + } + } + +/* Checks if a point is should be considered to be within this window or not. + +For a hit Point must be within the window's base area, and also within the pointer acceptance region if it exists. + +@param aPoint The coordinates to test for a hit +@return ETrue for a hit, EFalse for a miss +*/ +TBool CWsClientWindow::PointerHit(const TPoint& aPoint) const + { + TBool isHit = EFalse; + + if(iBaseArea->Contains(aPoint)) + { + if(iPointerRegion) + { + isHit = iPointerRegion->TRegion::Contains(aPoint); + } + else + { + // there is no pointer region, so default to using the base area only + isHit = ETrue; + } + } + return isHit; + } + // // Code for CWsTopClientWindow, a client window that connects to a group window // // diff -r 6a1564a2f3e6 -r 18f84489a694 windowing/windowserver/nga/SERVER/openwfc/cliwin.h --- a/windowing/windowserver/nga/SERVER/openwfc/cliwin.h Fri Sep 17 08:36:49 2010 +0300 +++ b/windowing/windowserver/nga/SERVER/openwfc/cliwin.h Mon Oct 04 02:31:51 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available // under the terms of "Eclipse Public License v1.0" @@ -116,13 +116,15 @@ TBool IsDSAHost() const; TBool IsActivated() const; + void SetPointerAcceptanceRegion(RWsRegion* aRegion); + TBool PointerHit(const TPoint& aPoint) const; private: void GetBaseAreaOfNode(RWsRegion& aRegion) const; void GetOpaqueBaseAreaOfNode(RWsRegion& aRegion) const; TInt GetNonOpaqueBaseAreaOfNode(RWsRegion& aRegion) const; void ClipRegionToBaseArea(RWsRegion& aRegion) const; void ClipRegionToOpaqueBaseArea(RWsRegion& aRegion) const; - + void DeletePointerRegion(); private: TInt iCornerData; @@ -142,6 +144,7 @@ TRect iOriginalSrcElementRect; TRect iOriginalDestElementRect; + RWsRegion* iPointerRegion; }; class CWsTopClientWindow : public CWsClientWindow diff -r 6a1564a2f3e6 -r 18f84489a694 windowing/windowserver/nonnga/CLIENT/RWINDOW.CPP --- a/windowing/windowserver/nonnga/CLIENT/RWINDOW.CPP Fri Sep 17 08:36:49 2010 +0300 +++ b/windowing/windowserver/nonnga/CLIENT/RWINDOW.CPP Mon Oct 04 02:31:51 2010 +0300 @@ -1721,6 +1721,11 @@ ASSERT(0); } +EXPORT_C TInt RWindowBase::SetPointerAcceptanceRegion(const TRegion& /*aRegion*/) + { + ASSERT(0); + } + //////////////////////////// RDrawableWindow //////////////////////////////// void RDrawableWindow::doScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect, TInt aOpcode) diff -r 6a1564a2f3e6 -r 18f84489a694 windowing/windowserver/nonnga/CLIENT/RWS.CPP --- a/windowing/windowserver/nonnga/CLIENT/RWS.CPP Fri Sep 17 08:36:49 2010 +0300 +++ b/windowing/windowserver/nonnga/CLIENT/RWS.CPP Mon Oct 04 02:31:51 2010 +0300 @@ -2403,13 +2403,6 @@ ASSERT(0); } -EXPORT_C void RWsSession::UnregisterEffect(TInt /*aAction*/, TInt /*aPurpose*/, TUint /*aAppUid*/) -/** Dummy implementation in order to preserve compatibility with WSERV NGA. - @internalComponent */ - { - ASSERT(0); - } - EXPORT_C void RWsSession::UnregisterAllEffects() /** Dummy implementation in order to preserve compatibility with WSERV NGA. @internalComponent */ diff -r 6a1564a2f3e6 -r 18f84489a694 windowing/windowserver/test/TClick/multiptrclick.cpp --- a/windowing/windowserver/test/TClick/multiptrclick.cpp Fri Sep 17 08:36:49 2010 +0300 +++ b/windowing/windowserver/test/TClick/multiptrclick.cpp Mon Oct 04 02:31:51 2010 +0300 @@ -11,7 +11,7 @@ // Contributors: // // Description: -// Test Multi Pointer Click Plug-In DLL +// Test Multipointer Click Plug-In DLL // // diff -r 6a1564a2f3e6 -r 18f84489a694 windowing/windowserver/test/tauto/TEVENT.H --- a/windowing/windowserver/test/tauto/TEVENT.H Fri Sep 17 08:36:49 2010 +0300 +++ b/windowing/windowserver/test/tauto/TEVENT.H Mon Oct 04 02:31:51 2010 +0300 @@ -327,10 +327,10 @@ void AddExpectedEvent(TInt aEventCode); void AddExpectedEvent(TInt aEventCode,RWindowGroup* aWindow); void AddExpectedErrorMessage(TWsErrorMessage::TErrorCategory aCategory, TInt aError); - void CalculatePointerEvent(TWsEvent& aEvent,TPointerEvent::TType aType, TPoint aPos); + void CalculatePointerEvent(TWsEvent& aEvent,TPointerEvent::TType aType, TPoint aPos, TInt aWindowHandle=0); void CalculatePointerCaptureEvent(TWsEvent& aEvent,TPointerEvent::TType aType, TPoint aPos, TInt aHandle=0); - void AddExpectedPointer(TPointerEvent::TType aType, TPoint aPos); - void AddExpectedPointerCapture(TPointerEvent::TType aType, TPoint aPos, TInt aHandle=0); + void AddExpectedPointer(TPointerEvent::TType aType, TPoint aPos, TInt aWindowHandle=0); + void AddExpectedPointerCapture(TPointerEvent::TType aType, TPoint aPos, TInt aWindowHandle=0); void AddExpectedPointerClick(TPointerEvent::TType aType, TPoint aPos); void AddExpectedPointerDownUp(TPoint aPos); inline void AddExpectedPointerScr(TPointerEvent::TType aType, TPoint aPos); @@ -344,6 +344,7 @@ inline void SimulatePointerWin(TRawEvent::TType aType, TInt aX, TInt aY); inline void SimulatePointerDownUpWin(TInt aX, TInt aY); inline void SimulatePointer(TRawEvent::TType aType, TInt aX, TInt aY); + inline void SimulatePointer(TRawEvent::TType aType, TPoint& aPoint); void doSendEvent(TWsEvent &aEvent); void SendKey(TInt aEventCode, TInt aScanCode, TInt aCode=0, TInt iRepeats=0); void SendEvent(TInt aEventCode); @@ -373,6 +374,7 @@ #ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA void SpawnCaptureAppL(RProcess& aProcess); #endif + void SetPointerAcceptanceRegion_NextSetOfEventsL(); private: CTBlankWindow* iBlankWin; RBlankWindow iBackingWindow; diff -r 6a1564a2f3e6 -r 18f84489a694 windowing/windowserver/test/tauto/TEvent.CPP --- a/windowing/windowserver/test/tauto/TEvent.CPP Fri Sep 17 08:36:49 2010 +0300 +++ b/windowing/windowserver/test/tauto/TEvent.CPP Mon Oct 04 02:31:51 2010 +0300 @@ -908,14 +908,30 @@ iQueueClient->AddExpectedEvent(event); } -void CTEventTest::CalculatePointerEvent(TWsEvent& aEvent,TPointerEvent::TType aType, TPoint aPos) +/* Populates the provided TWsEvent using the other parameters provided + +This is used to generate the events that will be compared to those received from Wserv + +@param aEvent Output, the event to be populated +@param aType Input, the type of the event +@param aPos Input, the position of the event +@param aWindowHandle Input, the window handle where the event should be received ( or 0 to calculate this ) + */ +void CTEventTest::CalculatePointerEvent(TWsEvent& aEvent,TPointerEvent::TType aType, TPoint aPos, TInt aWindowHandle) { #if !defined(TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA) TAdvancedPointerEvent& ptrEvent=*aEvent.Pointer(); aEvent.SetType(EEventPointer); ptrEvent.iParentPosition=aPos; // SetHandle must be done after iParentPosition is set, but before iPosition is set. - aEvent.SetHandle(reinterpret_cast(iQueueClient->GetHandle(aPos))); + if(!aWindowHandle) + { + aEvent.SetHandle(reinterpret_cast(iQueueClient->GetHandle(aPos))); + } + else + { + aEvent.SetHandle(aWindowHandle); + } const TPoint3D point3D(aPos.iX, aPos.iY, 0); const TInt pointerEventModifiers=0; const TUint8 pointerNumber=0; @@ -972,17 +988,25 @@ } } -void CTEventTest::AddExpectedPointerCapture(TPointerEvent::TType aType, TPoint aPos, TInt aHandle) +void CTEventTest::AddExpectedPointerCapture(TPointerEvent::TType aType, TPoint aPos, TInt aWindowHandle) { TPckgBuf evtPkg; - CalculatePointerCaptureEvent(evtPkg(),aType,aPos,aHandle); + CalculatePointerCaptureEvent(evtPkg(),aType,aPos,aWindowHandle); iQueueClient->AddExpectedEvent(evtPkg()); } -void CTEventTest::AddExpectedPointer(TPointerEvent::TType aType, TPoint aPos) +/* Queues a TWsEvent which is populated using the other parameters provided + +This is used to generate the events that will be compared to those received from Wserv + +@param aType Input, the type of the event +@param aPos Input, the position of the event +@param aWindowHandle Input, the window handle where the event should be received ( or 0 to calculate this ) + */ +void CTEventTest::AddExpectedPointer(TPointerEvent::TType aType, TPoint aPos, TInt aWindowHandle) { TPckgBuf evtPkg; - CalculatePointerEvent(evtPkg(),aType,aPos); + CalculatePointerEvent(evtPkg(),aType,aPos,aWindowHandle); iQueueClient->AddExpectedEvent(evtPkg()); if (iAddToClick) { @@ -1088,6 +1112,22 @@ iTest->SimulatePointerDownUp(EWinPositionX+aX,EWinPositionY+aY+iYOffset); } +/* Injects an event in to window server to emulate the event arriving from the pointing device driver + +@param aType Input, the event type +@param aPoint Input, the event coordinates + */ +void CTEventTest::SimulatePointer(TRawEvent::TType aType, TPoint& aPoint) + { + SimulatePointer(aType, aPoint.iX, aPoint.iY); + } + +/* Injects an event in to window server to emulate the event arriving from the pointing device driver + +@param aType Input, the event type +@param aX Input, the event x coordinate +@param aY Input, the event y coordinate + */ void CTEventTest::SimulatePointer(TRawEvent::TType aType, TInt aX, TInt aY) { iTest->SimulatePointer(aType,aX,aY+iYOffset); @@ -1216,7 +1256,12 @@ case 34: SurfaceVisibilityChanged3_NextSetOfEventsL(); break; -#endif // SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS + case 35: + // This test does not actually require QT_Effects code, so could be outside of the QT_Effect #ifdef + // BUT, this causes excessive complexity for the case numbers ( i.e. this could be, say 35 or 28 depending on the build ) + SetPointerAcceptanceRegion_NextSetOfEventsL(); + break; +#endif // SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS #endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA default: @@ -1874,6 +1919,196 @@ TheClient->iWs.Flush(); } +/** Functional verification of SetPointerAcceptanceRegion API + +GRAPHICS-WSERV-0755, GRAPHICS-WSERV-0756, GRAPHICS-WSERV-0757, GRAPHICS-WSERV-0758 + +Actions :- +1) 0755 Set up two windows at the same coordinates, configure a pionter acceptance region for the + top most window +2) 0756 Simulate events inside and outside of the acceptance region. +3) 0757 Move the window and simulate events inside and outside of the acceptance region. +4) 0758 Re-define the pointer acceptance region and simulate events inside and outside of the + acceptance region. + +ExpectedResults +Pointer events inside the acceptance region get delivered to the topmost window, pointer events + outside get delivered to the window below. +The pointer acceptance region moves with the window. +*/ +void CTEventTest::SetPointerAcceptanceRegion_NextSetOfEventsL() + { +#if defined(LOGGING) + TLogMessageText logMessageText; + _LIT(KSet,"SetPointerAcceptanceRegion: %d (last=4)"); + logMessageText.Format(KSet,iEventSet); + INFO_PRINTF1(logMessageText); +#endif + + const TPoint newPos(iQueueClient->ChildTopLeft().iX + iQueueClient->ChildSize().iWidth, + iQueueClient->ChildTopLeft().iY + iQueueClient->ChildSize().iHeight); + + switch(iEventSet++) + { + case 0: + { + // Create two top client windows of same group, same size and position + // Check that we can set up a pointer acceptance region + iVisWins1=new (ELeave) CTBlankWindow; + iVisWins2=new (ELeave) CTBlankWindow; + iVisWins1->ConstructL(*iQueueClient->iGroup); + iVisWins2->ConstructL(*iQueueClient->iGroup); + iVisWins1->SetColor(KRgbBlue); + iVisWins1->SetExt(iQueueClient->ChildTopLeft(),iQueueClient->ChildSize()); + iVisWins1->Activate(); + iVisWins2->SetColor(KRgbGreen); + iVisWins2->SetExt(iQueueClient->ChildTopLeft(),iQueueClient->ChildSize()); + + RRegion region; + // pointer region = quarter of window by the origin + region.AddRect(TRect(0,0,iQueueClient->ChildSize().iWidth>>1,iQueueClient->ChildSize().iHeight>>1)); + CleanupClosePushL(region); + User::LeaveIfError(iVisWins2->BaseWin()->SetPointerAcceptanceRegion(region)); + + // pop region + CleanupStack::PopAndDestroy(1, ®ion); + + // make sure this is in front + iVisWins2->Activate(); + iQueueClient->iWs.Flush(); + AddExpectedEvent(EEventFocusGained); + } + break; + case 1: + { + // middle of the acceptance region + TPoint p1( iQueueClient->ChildTopLeft().iX + iQueueClient->ChildSize().iWidth/4, + iQueueClient->ChildTopLeft().iY + iQueueClient->ChildSize().iHeight/4); + // opposite p1, out of the acceptance region + TPoint p2( iQueueClient->ChildTopLeft().iX + 3*iQueueClient->ChildSize().iWidth/4, + iQueueClient->ChildTopLeft().iY + 3*iQueueClient->ChildSize().iHeight/4); + + SimulatePointer(TRawEvent::EButton1Down,p1); + SimulatePointer(TRawEvent::EButton1Up,p1); + SimulatePointer(TRawEvent::EButton1Down,p2); + SimulatePointer(TRawEvent::EButton1Up,p2); + iQueueClient->iWs.Flush(); + + p1-=iVisWins2->BaseWin()->AbsPosition(); + p2-=iVisWins1->BaseWin()->AbsPosition(); + + AddExpectedPointer(TPointerEvent::EButton1Down,p1,(TInt)iVisWins2); + AddExpectedPointer(TPointerEvent::EButton1Up,p1,(TInt)iVisWins2); + AddExpectedPointer(TPointerEvent::EButton1Down,p2,(TInt)iVisWins1); + AddExpectedPointer(TPointerEvent::EButton1Up,p2,(TInt)iVisWins1); + } + break; + + case 2: + { + // move the windows, check that the pointer region moves with it + iVisWins1->SetExtL(newPos,iQueueClient->ChildSize()); + iVisWins2->SetExtL(newPos,iQueueClient->ChildSize()); + + // middle of the acceptance region + TPoint p1( newPos.iX + iQueueClient->ChildSize().iWidth/4, + newPos.iY + iQueueClient->ChildSize().iHeight/4); + // opposite p2, out of the acceptance region + TPoint p2( newPos.iX + 3*iQueueClient->ChildSize().iWidth/4, + newPos.iY + 3*iQueueClient->ChildSize().iHeight/4); + + SimulatePointer(TRawEvent::EButton1Down,p1); + SimulatePointer(TRawEvent::EButton1Up,p1); + SimulatePointer(TRawEvent::EButton1Down,p2); + SimulatePointer(TRawEvent::EButton1Up,p2); + iQueueClient->iWs.Flush(); + + p1-=iVisWins2->BaseWin()->AbsPosition(); + p2-=iVisWins1->BaseWin()->AbsPosition(); + + AddExpectedPointer(TPointerEvent::EButton1Down,p1,(TInt)iVisWins2); + AddExpectedPointer(TPointerEvent::EButton1Up,p1,(TInt)iVisWins2); + AddExpectedPointer(TPointerEvent::EButton1Down,p2,(TInt)iVisWins1); + AddExpectedPointer(TPointerEvent::EButton1Up,p2,(TInt)iVisWins1); + } + break; + + case 3: + { + // re-set the pointer region + RRegion region; + // pointer region = quarter of window opposite the origin + region.AddRect(TRect( iQueueClient->ChildSize().iWidth>>1,iQueueClient->ChildSize().iHeight>>1, + iQueueClient->ChildSize().iWidth,iQueueClient->ChildSize().iHeight)); + CleanupClosePushL(region); + User::LeaveIfError(iVisWins2->BaseWin()->SetPointerAcceptanceRegion(region)); + + // pop region + CleanupStack::PopAndDestroy(1, ®ion); + + // opposite p1, out of the acceptance region + TPoint p1( newPos.iX + iQueueClient->ChildSize().iWidth/4, + newPos.iY + iQueueClient->ChildSize().iHeight/4); + // middle of the acceptance region + TPoint p2( newPos.iX + 3*iQueueClient->ChildSize().iWidth/4, + newPos.iY + 3*iQueueClient->ChildSize().iHeight/4); + + SimulatePointer(TRawEvent::EButton1Down,p1); + SimulatePointer(TRawEvent::EButton1Up,p1); + SimulatePointer(TRawEvent::EButton1Down,p2); + SimulatePointer(TRawEvent::EButton1Up,p2); + iQueueClient->iWs.Flush(); + + p1-=iVisWins2->BaseWin()->AbsPosition(); + p2-=iVisWins1->BaseWin()->AbsPosition(); + + AddExpectedPointer(TPointerEvent::EButton1Down,p1,(TInt)iVisWins1); + AddExpectedPointer(TPointerEvent::EButton1Up,p1,(TInt)iVisWins1); + AddExpectedPointer(TPointerEvent::EButton1Down,p2,(TInt)iVisWins2); + AddExpectedPointer(TPointerEvent::EButton1Up,p2,(TInt)iVisWins2); + } + break; + + case 4: + { + // re-set the pointer region to empty + RRegion region; + CleanupClosePushL(region); + User::LeaveIfError(iVisWins2->BaseWin()->SetPointerAcceptanceRegion(region)); + CleanupStack::PopAndDestroy(1, ®ion); + + TPoint p1( newPos.iX + iQueueClient->ChildSize().iWidth/4, + newPos.iY + iQueueClient->ChildSize().iHeight/4); + TPoint p2( newPos.iX + 3*iQueueClient->ChildSize().iWidth/4, + newPos.iY + 3*iQueueClient->ChildSize().iHeight/4); + + SimulatePointer(TRawEvent::EButton1Down,p1); + SimulatePointer(TRawEvent::EButton1Up,p1); + SimulatePointer(TRawEvent::EButton1Down,p2); + SimulatePointer(TRawEvent::EButton1Up,p2); + iQueueClient->iWs.Flush(); + + p1-=iVisWins2->BaseWin()->AbsPosition(); + p2-=iVisWins1->BaseWin()->AbsPosition(); + + AddExpectedPointer(TPointerEvent::EButton1Down,p1,(TInt)iVisWins1); + AddExpectedPointer(TPointerEvent::EButton1Up,p1,(TInt)iVisWins1); + AddExpectedPointer(TPointerEvent::EButton1Down,p2,(TInt)iVisWins1); + AddExpectedPointer(TPointerEvent::EButton1Up,p2,(TInt)iVisWins1); + } + break; + + default: + delete iVisWins1; + delete iVisWins2; + iVisWins1=NULL; + iVisWins2=NULL; + CActiveScheduler::Stop(); + break; + } + TheClient->iWs.Flush(); + } + void CTEventTest::InvisibleWindow_NextSetOfEvents() { switch(iEventSet++) @@ -6996,8 +7231,9 @@ _LIT(KTest34,"Transparent Surface Visibility Changed Events 3"); #endif // SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS #endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA - _LIT(KTest35A,"Initialize Queue Size without inactive queue"); - _LIT(KTest35B,"Initialize Queue Size with inactive queue"); + _LIT(KTest35,"SetPointerAcceptanceRegion"); + _LIT(KTest36A,"Initialize Queue Size without inactive queue"); + _LIT(KTest36B,"Initialize Queue Size with inactive queue"); if (!TestBase()->ConfigurationSupportsPointerEventTesting()) { @@ -7760,9 +7996,31 @@ iTest->LogSubTest(KTest34); RunTestsL(); break; +/** +@SYMTestCaseID GRAPHICS-WSERV-0755, GRAPHICS-WSERV-0756, GRAPHICS-WSERV-0757, GRAPHICS-WSERV-0758 +@SYMDEF ou1cimx1#553048 +@SYMTestCaseDesc Functional verification of SetPointerAcceptanceRegion API + +@SYMTestPriority 2 +@SYMPrerequisites + +@SYMTestActions 0755 Set up two windows at the same coordinates, configure a pionter acceptance region for the top most window + 0756 Simulate events inside and outside of the acceptance region. + 0757 Move the window and simulate events inside and outside of the acceptance region. + 0758 Re-define the pointer acceptance region and simulate events inside and outside of the acceptance region. +@SYMTestExpectedResults Pointer events inside the acceptance region get delivered to the topmost window, pointer events outside + get delivered to the window below. + The pointer acceptance region moves with the window. +*/ + case 35: + ((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0755, 0756, 0757, 0758")); + iTest->LogSubTest(KTest35); + RunTestsL(); + break; + #endif // SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS #endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA - + /** @SYMTestCaseID GRAPHICS-WSERV-0559 @SYMDEF INC140850 @@ -7775,20 +8033,20 @@ */ #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA - case 28: + case 29: #else #ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS - case 35: + case 36: #else - case 32: + case 31: #endif #endif // This test was moved to be the last test in the test suite, because it sometimes leaves events in the event queue, //it can affect the results of other tests. This test case should be the last test in the test suite. ((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0484")); - iTest->LogSubTest(KTest35A); + iTest->LogSubTest(KTest36A); InitializeQueueSizeTestL(EFalse); - iTest->LogSubTest(KTest35B); + iTest->LogSubTest(KTest36B); InitializeQueueSizeTestL(ETrue); break; diff -r 6a1564a2f3e6 -r 18f84489a694 windowing/windowserver/test/tauto/tmultiptrevent.cpp --- a/windowing/windowserver/test/tauto/tmultiptrevent.cpp Fri Sep 17 08:36:49 2010 +0300 +++ b/windowing/windowserver/test/tauto/tmultiptrevent.cpp Mon Oct 04 02:31:51 2010 +0300 @@ -11,7 +11,7 @@ // Contributors: // // Description: -// Multi pointer and Z-coordinate test code +// Multipointer and Z-coordinate test code // // @@ -1463,7 +1463,7 @@ @SYMPREQ PREQ1226 @SYMREQ REQ9677,REQ9683, @SYMTestPriority High -@SYMTestCaseDesc Checks Wserv supports Capturing in case of multi pointer events. +@SYMTestCaseDesc Checks Wserv supports Capturing in case of multipointer events. @SYMTestStatus Implemented @SYMTestActions Create a window with group window as its parent. @@ -1482,8 +1482,8 @@ */ void CTMultiPtrEventTest::CapturingMultiPointerEvents() { - // Test Capturing of multi pointer events - // 1. Test Wserv supports Capturing in case of multi-pointer events + // Test Capturing of multipointer events + // 1. Test Wserv supports Capturing in case of multipointer events // 2. Test pointer events are delivered correctly when Capturing is disabled. TLogMessageText logText; _LIT(KSet, "CapturingMultiPtrEvents SetOfEvents: %d of 3"); @@ -1513,12 +1513,12 @@ } break; case 1: - INFO_PRINTF1(_L("Check Wserv supports Capturing in case of multi-pointer events, within window group")); + INFO_PRINTF1(_L("Check Wserv supports Capturing in case of multipointer events, within window group")); iMultiPtrEventClient->ChildWin()->BaseWin()->SetPointerCapture(RWindowBase::TCaptureEnabled); TestCapturingForMultiPointer(EFalse); break; case 2: - INFO_PRINTF1(_L("Check Wserv supports Capturing in case of multi-pointer events, from different window groups")); + INFO_PRINTF1(_L("Check Wserv supports Capturing in case of multipointer events, from different window groups")); TRAPD(err, CreateGroupWinForCapturingL()); // it cannot leave so trap and fail if (err != KErrNone) { @@ -2864,7 +2864,7 @@ @SYMPREQ PREQ1226 @SYMREQ REQ9677 @SYMTestPriority High -@SYMTestCaseDesc Checks Wserv supports Double click events for multi pointer events. +@SYMTestCaseDesc Checks Wserv supports Double click events for multipointer events. @SYMTestStatus Implemented @SYMTestActions Simulate double click events from different pointers @@ -2913,7 +2913,7 @@ @SYMPREQ PREQ1226 @SYMREQ REQ9677 @SYMTestPriority High -@SYMTestCaseDesc Checks Wserv supports Virtual keyboard for multi pointer events. +@SYMTestCaseDesc Checks Wserv supports Virtual keyboard for multipointer events. @SYMTestStatus Implemented @SYMTestActions Create virtual keyboard by AddKeyRect() to a window and simulate pointer events from all pointers @@ -2972,7 +2972,7 @@ @SYMPREQ PREQ1226 @SYMREQ REQ9677,REQ9683, @SYMTestPriority High -@SYMTestCaseDesc Checks Wserv supports Grabbing in case of multi pointer events. +@SYMTestCaseDesc Checks Wserv supports Grabbing in case of multipointer events. @SYMTestStatus Implemented @SYMTestActions Simulate EButton1Down events on iParentWin. Simulate Drag and Button1Up events on iChildWin. @@ -2982,8 +2982,8 @@ */ void CTMultiPtrEventTest::GrabbingMultiPointerEvents() { - // Test Grabbing of multi pointer events - // 1. Test Wserv supports Grabbing in case of multi-pointer events + // Test Grabbing of multipointer events + // 1. Test Wserv supports Grabbing in case of multipointer events // 2. Test pointer events are delivered correctly when Grabbing is disabled. TLogMessageText logText; _LIT(KSet, "GrabbingMultiPtrEvents SetOfEvents: %d of 2"); @@ -3002,7 +3002,7 @@ switch(iEventSet++) { case 0: - INFO_PRINTF1(_L("Check Wserv supports Grabbing in case of multi-pointer events")); + INFO_PRINTF1(_L("Check Wserv supports Grabbing in case of multipointer events")); // Check pointer events are delivered to the window where the EButton1Down event occured, // even if subsequent events are simulated outside this window. AddExpectedWsEvent(EEventFocusGained); @@ -3028,7 +3028,7 @@ @SYMPREQ PREQ1226 @SYMREQ REQ9677,REQ9683, @SYMTestPriority High -@SYMTestCaseDesc Checks Wserv supports Filtering in case of multi pointer events. +@SYMTestCaseDesc Checks Wserv supports Filtering in case of multipointer events. @SYMTestStatus Implemented @SYMTestActions Simulate Move and Drag events. Add only Button1Up and Button1Down to TWsEvent buffer. @@ -3038,7 +3038,7 @@ */ void CTMultiPtrEventTest::FilteringMultiPointerEvents() { - // Test Filtering of multi pointer events + // Test Filtering of multipointer events // 1. Test pointer move and drag events are filtered correctly by Wserv // 2. Test pointer events are delivered correctly when Filtered is disabled. TLogMessageText logText; @@ -3058,7 +3058,7 @@ switch(iEventSet++) { case 0: - INFO_PRINTF1(_L("Check pointer move and drag events are filtered with multi-pointer events")); + INFO_PRINTF1(_L("Check pointer move and drag events are filtered with multipointer events")); // Check pointer move and drag events are filtered by Wserv AddExpectedWsEvent(EEventFocusGained); @@ -3068,7 +3068,7 @@ TestFilteringForMultiPointer(ETrue); break; case 1: - INFO_PRINTF1(_L("Check pointer move and drag events are not filtered, with multi-pointer events, when filtering is disabled")); + INFO_PRINTF1(_L("Check pointer move and drag events are not filtered, with multipointer events, when filtering is disabled")); // Check move and drag events are not filtered by Wserv when filtering is disabled // Enable Drag and Move events @@ -3123,10 +3123,10 @@ @SYMPREQ PREQ1226 @SYMREQ REQ9677, REQ9683 @SYMTestPriority High -@SYMTestCaseDesc To check Wserv sends multi pointer events in Different screen modes +@SYMTestCaseDesc To check Wserv sends multipointer events in Different screen modes @SYMTestStatus Implemented -@SYMTestActions Simulate multi pointer events in Different screenmodes +@SYMTestActions Simulate multipointer events in Different screenmodes @SYMTestExpectedResults The received events must match the simulated raw events */ void CTMultiPtrEventTest::MultiPointerEventsInDiffScreenModes() @@ -3136,7 +3136,7 @@ // For each screen mode check these events on diffferent rotation that screen mode supports // During the last switch case increment the screenmode TLogMessageText logText; - _LIT(KSet, "Multi pointer events in screenmode(%d): %d of 2"); + _LIT(KSet, "Multipointer events in screenmode(%d): %d of 2"); logText.AppendFormat(KSet, iCurrentScreenMode+1, iEventSet); LOG_MESSAGE(logText); @@ -3508,16 +3508,16 @@ @SYMPREQ PREQ1226 @SYMREQ REQ9677, REQ9683 @SYMTestPriority High -@SYMTestCaseDesc To check Wserv sends multi pointer events to PointerClickPlugin +@SYMTestCaseDesc To check Wserv sends multipointer events to PointerClickPlugin @SYMTestStatus Implemented -@SYMTestActions Simulate multi pointer events for PointerClickPlugin +@SYMTestActions Simulate multipointer events for PointerClickPlugin @SYMTestExpectedResults The received events must match the simulated raw events */ void CTMultiPtrEventTest::MultiPointerEventsForPointerClickL() { TLogMessageText logText; - _LIT(KSet, "Multi pointer events for PointerClickPlugin: %d of 4"); + _LIT(KSet, "Multipointer events for PointerClickPlugin: %d of 4"); logText.AppendFormat(KSet, iEventSet); LOG_MESSAGE(logText); @@ -3646,10 +3646,10 @@ @SYMPREQ PREQ1226 @SYMREQ REQ9677,REQ9674, @SYMTestPriority High -@SYMTestCaseDesc To check Wserv sends Multi Pointer events to correct clients +@SYMTestCaseDesc To check Wserv sends multipointer events to correct clients @SYMTestStatus Implemented -@SYMTestActions Simulate multi pointer events on windows from different client. +@SYMTestActions Simulate multipointer events on windows from different client. @SYMTestExpectedResults The received events must match the simulated raw events */ void CTMultiPtrEventTest::MultiClientMultiPointerEvents() @@ -3661,7 +3661,7 @@ // Before running next set of events, get all the events from secondary client // If test fails on any client make sure both active scheduler are stopped TLogMessageText logText; - _LIT(KSet, "Multi pointer events for Multi client: %d of 5"); + _LIT(KSet, "Multipointer events for Multi client: %d of 5"); logText.AppendFormat(KSet, iEventSet); LOG_MESSAGE(logText); @@ -3937,10 +3937,10 @@ @SYMPREQ PREQ1226 @SYMREQ REQ9677,REQ9683, @SYMTestPriority High -@SYMTestCaseDesc To check Wserv sends Multi Pointer events to Anims +@SYMTestCaseDesc To check Wserv sends multipointer events to Anims @SYMTestStatus Implemented -@SYMTestActions Simulate multi pointer events for anims +@SYMTestActions Simulate multipointer events for anims @SYMTestExpectedResults The received events must match the simulated raw events */ void CTMultiPtrEventTest::MultiPointerEventsForAnimsL() @@ -3951,7 +3951,7 @@ // Simulate those events and check simulated events are same as required at server side // If any test fail, error description is got from server and displayed in the log file TLogMessageText logText; - _LIT(KSet, "Multi pointer events for Anims: %d of 3"); + _LIT(KSet, "Multipointer events for Anims: %d of 3"); logText.AppendFormat(KSet, iEventSet); LOG_MESSAGE(logText); _LIT(KEventsChecked, "Events checked at server side = %d"); @@ -4051,7 +4051,7 @@ @SYMPREQ PREQ1226 @SYMREQ REQ9677,REQ9683, @SYMTestPriority High -@SYMTestCaseDesc To check Wserv purges multi pointer events with standard rules +@SYMTestCaseDesc To check Wserv purges multipointer events with standard rules @SYMTestStatus Implemented @SYMTestActions Simulate raw events to be purged @@ -4059,14 +4059,14 @@ */ void CTMultiPtrEventTest::PurgingMultiPointerEvents() { - // Test purging of multi pointer events + // Test purging of multipointer events // 1. Test down/up pairs are purged // 2. Test moves events are purged // 3. Test drag events are purged // 4. Test lone down events are purged // 5. And finally test lone up events are also purged TLogMessageText logText; - _LIT(KSet, "Purging of multi pointer events: %d of 6"); + _LIT(KSet, "Purging of multipointer events: %d of 6"); logText.AppendFormat(KSet, iEventSet); LOG_MESSAGE(logText); @@ -4205,7 +4205,7 @@ } break; case 5: - // Check PurgePointerEvents works with multi pointer events + // Check PurgePointerEvents works with multipointer events ptrPos.iX = xInc; ptrPos.iY = yInc; for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++) @@ -4255,7 +4255,7 @@ @SYMPREQ PREQ1226 @SYMREQ REQ9674,REQ9687, @SYMTestPriority High - @SYMTestCaseDesc Checks Wserv sends multi touch pointer events received by it + @SYMTestCaseDesc Checks Wserv sends multipointer pointer events received by it @SYMTestStatus Implemented @SYMTestActions Simulate raw events from different pointers @@ -4279,7 +4279,7 @@ @SYMPREQ PREQ1226 @SYMREQ REQ9674,REQ9687, @SYMTestPriority High - @SYMTestCaseDesc To check Wserv sends simultaneous multi touch pointer events + @SYMTestCaseDesc To check Wserv sends simultaneous multipointer pointer events @SYMTestStatus Implemented @SYMTestActions Simulate simultaneous raw events from different pointers @@ -4311,7 +4311,7 @@ @SYMPREQ PREQ1226 @SYMREQ REQ9676 @SYMTestPriority High - @SYMTestCaseDesc To check Wserv sends the multi touch pointer events received + @SYMTestCaseDesc To check Wserv sends the multipointer pointer events received by it along with the Pressure or Proximity @SYMTestStatus Implemented diff -r 6a1564a2f3e6 -r 18f84489a694 windowing/windowserver/wins_switching/ws32_stubs.h --- a/windowing/windowserver/wins_switching/ws32_stubs.h Fri Sep 17 08:36:49 2010 +0300 +++ b/windowing/windowserver/wins_switching/ws32_stubs.h Mon Oct 04 02:31:51 2010 +0300 @@ -5301,6 +5301,15 @@ _asm jmp common_dispatch } +__declspec(dllexport) +__declspec(naked) +void call_vector_588 () + { + // ; int RWindowBase::SetPointerAcceptanceRegion(class TRegion const &) + _asm mov eax, 588 + _asm jmp common_dispatch + } + } -#define MAX_ORDINAL 588 - +#define MAX_ORDINAL 589 +