sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #include "tvgimagecache.h" sl@0: #include sl@0: sl@0: _LIT(KRomBitmap, "z:\\system\\data\\dgdi32bit.mbm"); sl@0: sl@0: CTVgImageCache::CTVgImageCache() sl@0: { sl@0: SetTestStepName(KTDirectGdiVgImageCacheStep); sl@0: } sl@0: sl@0: CTVgImageCache::~CTVgImageCache() sl@0: { sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID sl@0: GRAPHICS-DIRECTGDI-VGIMAGECACHE-0001 sl@0: sl@0: @SYMPREQ sl@0: PREQ39 sl@0: sl@0: @SYMREQ sl@0: REQ9195 sl@0: REQ9201 sl@0: REQ9202 sl@0: REQ9222 sl@0: REQ9223 sl@0: REQ9236 sl@0: REQ9237 sl@0: sl@0: @SYMTestCaseDesc sl@0: Test entries are added to the cache. sl@0: sl@0: @SYMTestStatus sl@0: Implemented sl@0: sl@0: @SYMTestPriority sl@0: High sl@0: sl@0: @SYMTestActions sl@0: 1. Create bitmaps and bitmap masks. Blit them so that they are stored in the cache. sl@0: Check the VGImages created from the bitmaps are stored in the cache. sl@0: 2. Blit the bitmaps again in a different order. sl@0: Check the order that the bitmaps are stored in the cache. sl@0: sl@0: @SYMTestExpectedResults sl@0: 1. There are entries for each bitmap and bitmap mask. sl@0: 2. The bitmaps are stored in the cache in order of most-recently used to least-recently used. sl@0: */ sl@0: void CTVgImageCache::TestAddEntriesL() sl@0: { sl@0: _LIT(KTestName, "Test Bitmaps Are Added To Cache"); sl@0: if(!iRunningOomTests) sl@0: { sl@0: INFO_PRINTF1(KTestName); sl@0: } sl@0: CFbsBitmap* romBitmap = new(ELeave) CFbsBitmap; sl@0: TInt err = romBitmap->Load(KRomBitmap); sl@0: TESTNOERRORL(err); sl@0: CleanupStack::PushL(romBitmap); sl@0: sl@0: TSize bitmapSize(48,48); sl@0: TRect bitmapRect(TPoint(0,0), bitmapSize); sl@0: CFbsBitmap* bitmap1 = CreateCheckedBoardBitmapL(iTestParams.iSourcePixelFormat, bitmapSize, TSize (20, 20)); sl@0: TESTL(bitmap1 != NULL); sl@0: CleanupStack::PushL(bitmap1); sl@0: CFbsBitmap* bitmap2 = CreateCheckedBoardBitmapL(iTestParams.iSourcePixelFormat, bitmapSize, TSize (10, 10)); sl@0: TESTL(bitmap2 != NULL); sl@0: CleanupStack::PushL(bitmap2); sl@0: CFbsBitmap* bitmap3 = CreateCheckedBoardBitmapL(iTestParams.iSourcePixelFormat, bitmapSize, TSize (8, 8)); sl@0: TESTL(bitmap3 != NULL); sl@0: CleanupStack::PushL(bitmap3); sl@0: CFbsBitmap* mask1 = CreateCheckedBoardBitmapL(iTestParams.iSourcePixelFormat, bitmapSize, TSize (4, 4)); sl@0: TESTL(mask1 != NULL); sl@0: CleanupStack::PushL(mask1); sl@0: CFbsBitmap* mask2 = CreateCheckedBoardBitmapL(iTestParams.iSourcePixelFormat, bitmapSize, TSize (2, 2)); sl@0: TESTL(mask2 != NULL); sl@0: CleanupStack::PushL(mask2); sl@0: sl@0: ResetGc(); sl@0: CleanupStack::PushL(TCleanupItem(ResetCache, iVgImageCache)); sl@0: sl@0: iGc->BitBlt(TPoint(0,0), *romBitmap); sl@0: iGc->DrawBitmap(bitmapRect, *bitmap1); sl@0: iGc->BitBltMasked(TPoint(0,0), *bitmap2, bitmapRect, *mask1, EFalse); sl@0: iGc->DrawBitmapMasked(bitmapRect, *bitmap3, bitmapRect, *mask2, EFalse); sl@0: sl@0: // Check bitmaps added sl@0: TInt numEntries = iVgImageCache->NumEntries(); sl@0: TEST(numEntries == 6); sl@0: // The following tests must leave if they fail, sl@0: // otherwise a panic will occur in the ordered cache entry test sl@0: TESTL(iVgImageCache->IsInCache(romBitmap->SerialNumber())); sl@0: TESTL(iVgImageCache->IsInCache(bitmap1->SerialNumber())); sl@0: TESTL(iVgImageCache->IsInCache(bitmap2->SerialNumber())); sl@0: TESTL(iVgImageCache->IsInCache(bitmap3->SerialNumber())); sl@0: TESTL(iVgImageCache->IsInCache(mask1->SerialNumber())); sl@0: TESTL(iVgImageCache->IsInCache(mask2->SerialNumber())); sl@0: sl@0: //Blit a few more times and check order of items in cache sl@0: iGc->BitBlt(TPoint(0,0), *bitmap3); sl@0: iGc->BitBlt(TPoint(0,0), *bitmap1); sl@0: iGc->BitBlt(TPoint(0,0), *romBitmap); sl@0: iGc->BitBlt(TPoint(0,0), *mask2); sl@0: iGc->BitBlt(TPoint(0,0), *bitmap2); sl@0: sl@0: // Expect the most recently used to be at the head of the list sl@0: // i.e. bitmap2, mask2, romBitmap, bitmap1, bitmap3, mask1 sl@0: TInt64* serialNumList = new TInt64[numEntries]; sl@0: TESTL(serialNumList != NULL); sl@0: iVgImageCache->GetOrderedCacheEntries(*serialNumList,numEntries); sl@0: TEST(serialNumList[0] == bitmap2->SerialNumber()); sl@0: TEST(serialNumList[1] == mask2->SerialNumber()); sl@0: TEST(serialNumList[2] == romBitmap->SerialNumber()); sl@0: TEST(serialNumList[3] == bitmap1->SerialNumber()); sl@0: TEST(serialNumList[4] == bitmap3->SerialNumber()); sl@0: TEST(serialNumList[5] == mask1->SerialNumber()); sl@0: delete[] serialNumList; sl@0: sl@0: CleanupStack::PopAndDestroy(7, romBitmap); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID sl@0: GRAPHICS-DIRECTGDI-VGIMAGECACHE-0002 sl@0: sl@0: @SYMPREQ sl@0: PREQ39 sl@0: sl@0: @SYMREQ sl@0: REQ9195 sl@0: REQ9201 sl@0: REQ9202 sl@0: REQ9222 sl@0: REQ9223 sl@0: REQ9236 sl@0: REQ9237 sl@0: sl@0: @SYMTestCaseDesc sl@0: Test entries are added to the cache. sl@0: sl@0: @SYMTestStatus sl@0: Implemented sl@0: sl@0: @SYMTestPriority sl@0: High sl@0: sl@0: @SYMTestActions sl@0: Create a bitmap. Blit it so that it is stored in the cache. sl@0: Check there is an entry for that bitmap in the cache. sl@0: Resize the bitmap (so that the bitmap's touch count is increased). sl@0: Blit the bitmap again. sl@0: Check the value of the touch count stored in the cache. sl@0: sl@0: @SYMTestExpectedResults sl@0: Entry exists for bitmap and touch count value stored in cache sl@0: is same as the bitmap after it was resized. sl@0: sl@0: */ sl@0: void CTVgImageCache::TestBitmapResizedL() sl@0: { sl@0: _LIT(KTestName, "Test That Images In Cache Are Updated When Associated Bitmap Is Resized"); sl@0: if(!iRunningOomTests) sl@0: { sl@0: INFO_PRINTF1(KTestName); sl@0: } sl@0: TSize bitmapSize(48,48); sl@0: CFbsBitmap* bitmap = CreateCheckedBoardBitmapL(iTestParams.iSourcePixelFormat, bitmapSize, TSize (8, 8)); sl@0: TESTL(bitmap != NULL); sl@0: sl@0: ResetGc(); sl@0: sl@0: iGc->BitBlt(TPoint(0,0), *bitmap); sl@0: TInt64 serialNumber = bitmap->SerialNumber(); sl@0: // Check bitmaps added sl@0: TEST(iVgImageCache->IsInCache(serialNumber)); sl@0: TInt oldTouchCount = iVgImageCache->TouchCount(serialNumber); sl@0: TEST(oldTouchCount == bitmap->TouchCount()); sl@0: sl@0: //Resize bitmap sl@0: TESTNOERROR(bitmap->Resize(TSize(80,24))); sl@0: iGc->BitBlt(TPoint(0,0), *bitmap); sl@0: TEST(iVgImageCache->TouchCount(serialNumber) != oldTouchCount); sl@0: TEST(iVgImageCache->TouchCount(serialNumber) == bitmap->TouchCount()); sl@0: sl@0: delete bitmap; sl@0: iVgImageCache->ResetCache(); sl@0: } sl@0: sl@0: sl@0: /** sl@0: @SYMTestCaseID sl@0: GRAPHICS-DIRECTGDI-VGIMAGECACHE-0003 sl@0: sl@0: @SYMPREQ sl@0: PREQ39 sl@0: sl@0: @SYMREQ sl@0: REQ9195 sl@0: REQ9201 sl@0: REQ9202 sl@0: REQ9222 sl@0: REQ9223 sl@0: REQ9236 sl@0: REQ9237 sl@0: sl@0: @SYMTestCaseDesc sl@0: Test entries are added to the cache. sl@0: sl@0: @SYMTestStatus sl@0: Implemented sl@0: sl@0: @SYMTestPriority sl@0: High sl@0: sl@0: @SYMTestActions sl@0: Create a bitmap. Blit it so that it is stored in the cache. sl@0: Check there is an entry for that bitmap in the cache. sl@0: Swap the width and height of the bitmap (so that the bitmap's touch count is increased). sl@0: Blit the bitmap again. sl@0: Check the value of the touch count stored in the cache. sl@0: sl@0: @SYMTestExpectedResults sl@0: Entry exists for bitmap and touch count value stored in cache sl@0: is same as the bitmap after its width and height were swapped. sl@0: sl@0: */ sl@0: void CTVgImageCache::TestBitmapSwapWidthAndHeightL() sl@0: { sl@0: _LIT(KTestName, "Test That Images In Cache Are Updated When Associated Bitmap Swaps Height and Width"); sl@0: if(!iRunningOomTests) sl@0: { sl@0: INFO_PRINTF1(KTestName); sl@0: } sl@0: TSize bitmapSize(40,60); sl@0: CFbsBitmap* bitmap = CreateCheckedBoardBitmapL(iTestParams.iSourcePixelFormat, bitmapSize, TSize (8, 8)); sl@0: TESTL(bitmap != NULL); sl@0: sl@0: ResetGc(); sl@0: iVgImageCache->ResetCache(); sl@0: sl@0: iGc->BitBlt(TPoint(0,0), *bitmap); sl@0: // Check bitmap is added to cache sl@0: TEST(iVgImageCache->IsInCache(bitmap->SerialNumber())); sl@0: TInt oldTouchCount = bitmap->TouchCount(); sl@0: TEST(oldTouchCount == iVgImageCache->TouchCount(bitmap->SerialNumber())); sl@0: sl@0: // Swap width & height of bitmap within a Begin/End bounds sl@0: // so that touch count increases sl@0: TESTNOERROR(bitmap->SwapWidthAndHeight()); sl@0: TInt newTouchCount = bitmap->TouchCount(); sl@0: iGc->BitBlt(TPoint(0,0), *bitmap); sl@0: // Check touch count is now different sl@0: TEST(newTouchCount != oldTouchCount); sl@0: // Expect cache to update entry for bitmap sl@0: TEST(iVgImageCache->TouchCount(bitmap->SerialNumber()) == newTouchCount); sl@0: sl@0: delete bitmap; sl@0: iVgImageCache->ResetCache(); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID sl@0: GRAPHICS-DIRECTGDI-VGIMAGECACHE-0004 sl@0: sl@0: @SYMPREQ sl@0: PREQ39 sl@0: sl@0: @SYMREQ sl@0: REQ9195 sl@0: REQ9201 sl@0: REQ9202 sl@0: REQ9222 sl@0: REQ9223 sl@0: REQ9236 sl@0: REQ9237 sl@0: sl@0: @SYMTestCaseDesc sl@0: Test entries are not added to the cache for volatile bitmaps. sl@0: sl@0: @SYMTestStatus sl@0: Implemented sl@0: sl@0: @SYMTestPriority sl@0: High sl@0: sl@0: @SYMTestActions sl@0: Create Font Image Storage. In the cycle request Glyph Image entry for particular Glyph sl@0: code and font ID. sl@0: Delete Glyph Storage. sl@0: sl@0: @SYMTestExpectedResults sl@0: No entry exists for the bitmap in the cache. sl@0: sl@0: */ sl@0: void CTVgImageCache::TestVolatileBitmapL() sl@0: { sl@0: _LIT(KTestName, "Test That Volatile Bitmaps Are not Stored In Cache"); sl@0: if(!iRunningOomTests) sl@0: { sl@0: INFO_PRINTF1(KTestName); sl@0: } sl@0: TSize bitmapSize(40,60); sl@0: CFbsBitmap* bitmap = CreateCheckedBoardBitmapL(iTestParams.iSourcePixelFormat, bitmapSize, TSize (8, 8)); sl@0: TESTL(bitmap != NULL); sl@0: sl@0: ResetGc(); sl@0: iVgImageCache->ResetCache(); sl@0: sl@0: // Make bitmap volatile sl@0: bitmap->DataAddress(); sl@0: iGc->BitBlt(TPoint(0,0), *bitmap); sl@0: // Check bitmap is added to cache sl@0: TEST(!iVgImageCache->IsInCache(bitmap->SerialNumber())); sl@0: sl@0: delete bitmap; sl@0: iVgImageCache->ResetCache(); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID sl@0: GRAPHICS-DIRECTGDI-VGIMAGECACHE-0005 sl@0: sl@0: @SYMPREQ sl@0: PREQ39 sl@0: sl@0: @SYMREQ sl@0: REQ9195 sl@0: REQ9201 sl@0: REQ9202 sl@0: REQ9222 sl@0: REQ9223 sl@0: REQ9236 sl@0: REQ9237 sl@0: sl@0: @SYMTestCaseDesc sl@0: Test least recently used entries are deleted when the cache is full and a new entry is added to the cache. sl@0: sl@0: @SYMTestStatus sl@0: Implemented sl@0: sl@0: @SYMTestPriority sl@0: High sl@0: sl@0: @SYMTestActions sl@0: Fill the cache up (by blitting many different bitmaps). sl@0: Blit one more bitmap so that the cache has to delete an entry. sl@0: Get the driver's MDirectGdiDriverCacheSize extension interface. sl@0: Check that a new maximum cache size cannot be set that is smaller sl@0: than the existing cache size. sl@0: sl@0: @SYMTestExpectedResults sl@0: An entry was deleted and that entry was the least recently used. sl@0: A cache size cannot be set that is smaller than the existing cache size. sl@0: */ sl@0: void CTVgImageCache::TestFullCacheL() sl@0: { sl@0: _LIT(KTestName, "Test Adding Image to Cache when Cache is Full"); sl@0: if(!iRunningOomTests) sl@0: { sl@0: INFO_PRINTF1(KTestName); sl@0: } sl@0: sl@0: ResetGc(); sl@0: iVgImageCache->ResetCache(); sl@0: CleanupStack::PushL(TCleanupItem(ResetCache, iVgImageCache)); sl@0: TInt maxCacheSize = iVgImageCache->MaxCacheSize(); sl@0: sl@0: TSize bitmapSize(200,200); sl@0: TInt dataStride = CFbsBitmap::ScanLineLength(bitmapSize.iWidth, TDisplayModeMapping::MapPixelFormatToDisplayMode(iTestParams.iSourcePixelFormat)); sl@0: TInt imageSizeInBytes = bitmapSize.iHeight * dataStride; sl@0: TSize checksPerAxis(1,1); sl@0: // Create the first bitmap to be added to the cache. sl@0: // This is also be the bitmap to be removed from the cache when full. sl@0: CFbsBitmap* firstBitmap = CreateCheckedBoardBitmapL(iTestParams.iSourcePixelFormat, bitmapSize, checksPerAxis); sl@0: TESTL(firstBitmap != NULL); sl@0: CleanupStack::PushL(firstBitmap); sl@0: iGc->BitBlt(TPoint(0,0), *firstBitmap); sl@0: TEST(iVgImageCache->IsInCache(firstBitmap->SerialNumber())); sl@0: sl@0: // Fill the cache up. sl@0: while(imageSizeInBytes + iVgImageCache->CacheSizeInBytes() < maxCacheSize) sl@0: { sl@0: CFbsBitmap* bitmap = CreateCheckedBoardBitmapL(iTestParams.iSourcePixelFormat, bitmapSize, checksPerAxis); sl@0: TESTL(bitmap != NULL); sl@0: iGc->BitBlt(TPoint(0,0), *bitmap); sl@0: delete bitmap; sl@0: } sl@0: sl@0: // Add one more entry to the cache sl@0: CFbsBitmap* bitmap = CreateCheckedBoardBitmapL(iTestParams.iSourcePixelFormat, bitmapSize, checksPerAxis); sl@0: TESTL(bitmap != NULL); sl@0: TEST(!iVgImageCache->IsInCache(bitmap->SerialNumber())); sl@0: TEST(iVgImageCache->IsInCache(firstBitmap->SerialNumber())); sl@0: iGc->BitBlt(TPoint(0,0), *bitmap); sl@0: sl@0: // firstBitmap should now have been removed from the cache as it was the least recently used. sl@0: TEST(!iVgImageCache->IsInCache(firstBitmap->SerialNumber())); sl@0: // last bitmap should be in cache sl@0: TEST(iVgImageCache->IsInCache(bitmap->SerialNumber())); sl@0: sl@0: // get the driver's MDirectGdiDriverCacheSize extension interface and attempt sl@0: // to set the maximum cache size to be smaller than the existing cache size sl@0: CDirectGdiDriver* driver = CDirectGdiDriver::Static(); sl@0: TESTL(driver != NULL); sl@0: MDirectGdiDriverCacheSize* driverCacheSize = NULL; sl@0: TInt res = driver->GetInterface(TUid::Uid(KDirectGdiDriverCacheSizeUid), (TAny*&)driverCacheSize); sl@0: TESTNOERRORL(res); sl@0: // save the original cache size sl@0: TInt originalCacheSize = driverCacheSize->MaxImageCacheSize(); sl@0: // setting the cache size to a size smaller than the existing cache should fail sl@0: res = driverCacheSize->SetMaxImageCacheSize(iVgImageCache->CacheSizeInBytes()-1); sl@0: TEST(res == KErrArgument); sl@0: // setting the cache size to the same size as the existing cache should pass sl@0: res = driverCacheSize->SetMaxImageCacheSize(iVgImageCache->CacheSizeInBytes()); sl@0: TESTNOERROR(res); sl@0: TEST(iVgImageCache->CacheSizeInBytes() == driverCacheSize->MaxImageCacheSize()); sl@0: // reset the original driver cache size sl@0: res = driverCacheSize->SetMaxImageCacheSize(originalCacheSize); sl@0: TESTNOERROR(res); sl@0: sl@0: delete bitmap; sl@0: CleanupStack::PopAndDestroy(firstBitmap); sl@0: CleanupStack::PopAndDestroy(iVgImageCache); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID sl@0: GRAPHICS-DIRECTGDI-VGIMAGECACHE-0006 sl@0: sl@0: @SYMPREQ sl@0: PREQ39 sl@0: sl@0: @SYMREQ sl@0: REQ9195 sl@0: REQ9201 sl@0: REQ9202 sl@0: REQ9222 sl@0: REQ9223 sl@0: REQ9236 sl@0: REQ9237 sl@0: sl@0: @SYMTestCaseDesc sl@0: Test adding a bitmap larger than maximum size of cache. sl@0: sl@0: @SYMTestStatus sl@0: Implemented sl@0: sl@0: @SYMTestPriority sl@0: High sl@0: sl@0: @SYMTestActions. sl@0: Blit a small bitmap which is added to the cache. sl@0: Blit a bitmap whose size in pixels is more than the maximum size of the cache. sl@0: sl@0: @SYMTestExpectedResults sl@0: An entry for the large bitmap should not appear in the cache. sl@0: An entry for the small bitmap should appear in the cache. sl@0: sl@0: */ sl@0: void CTVgImageCache::TestImageLargerThanCacheL() sl@0: { sl@0: _LIT(KTestName, "Test Adding Image Larger Than Cache"); sl@0: if(!iRunningOomTests) sl@0: { sl@0: INFO_PRINTF1(KTestName); sl@0: } sl@0: sl@0: ResetGc(); sl@0: iVgImageCache->ResetCache(); sl@0: TInt maxCacheSize = iVgImageCache->MaxCacheSize(); sl@0: sl@0: // Calculate height of bitmap whose width is 512 pixels so that the total size in bytes of the bitmap sl@0: // is the same as the maximum cache size. sl@0: TInt dataStride = CFbsBitmap::ScanLineLength(512, TDisplayModeMapping::MapPixelFormatToDisplayMode(iTestParams.iSourcePixelFormat)); sl@0: TInt largeBitmapHeight = maxCacheSize / dataStride; sl@0: // Want bitmap with a larger size in bytes than cache, sl@0: // so create a bitmap with width of 550 pixels and largeBitmapHeight sl@0: TSize largeBitmapSize(550,largeBitmapHeight); sl@0: sl@0: TSize smallBitmapSize(200,200); sl@0: sl@0: TSize checksPerAxis(1,1); sl@0: sl@0: // Create a small bitmap to be added to the cache. sl@0: CFbsBitmap* smallBitmap = CreateCheckedBoardBitmapL(iTestParams.iSourcePixelFormat, smallBitmapSize, checksPerAxis); sl@0: TESTL(smallBitmap != NULL); sl@0: CleanupStack::PushL(smallBitmap); sl@0: // Create large bitmap which is too large to fit in cache sl@0: CFbsBitmap* largeBitmap = CreateCheckedBoardBitmapL(iTestParams.iSourcePixelFormat, largeBitmapSize, checksPerAxis); sl@0: TESTL(largeBitmap != NULL); sl@0: sl@0: // Add small bitmap to cache sl@0: iGc->BitBlt(TPoint(0,0), *smallBitmap); sl@0: TEST(iVgImageCache->IsInCache(smallBitmap->SerialNumber())); sl@0: sl@0: // Blit large bitmap sl@0: iGc->BitBlt(TPoint(0,0), *largeBitmap); sl@0: TEST(!iVgImageCache->IsInCache(largeBitmap->SerialNumber())); sl@0: TEST(iVgImageCache->IsInCache(smallBitmap->SerialNumber())); sl@0: sl@0: delete largeBitmap; sl@0: CleanupStack::PopAndDestroy(smallBitmap); sl@0: iVgImageCache->ResetCache(); sl@0: } sl@0: sl@0: /** sl@0: Override of base class virtual sl@0: @leave Gets system wide error code sl@0: @return - TVerdict code sl@0: */ sl@0: TVerdict CTVgImageCache::doTestStepPreambleL() sl@0: { sl@0: CTDirectGdiStepBase::doTestStepPreambleL(); sl@0: return TestStepResult(); sl@0: } sl@0: sl@0: /** sl@0: Override of base class pure virtual sl@0: Our implementation only gets called if the base class doTestStepPreambleL() did sl@0: not leave. That being the case, the current test result value will be EPass. sl@0: @leave Gets system wide error code sl@0: @return TVerdict code sl@0: */ sl@0: TVerdict CTVgImageCache::doTestStepL() sl@0: { sl@0: if (iUseDirectGdi) sl@0: { sl@0: // Test independent of target pixel formats, so just use first. sl@0: iTestParams.iTargetPixelFormat = iTargetPixelFormatArray[0]; sl@0: // Test needs a VG compatible source pixel format. sl@0: iTestParams.iSourcePixelFormat = EUidPixelFormatRGB_565; sl@0: SetTargetL(iTestParams.iTargetPixelFormat); sl@0: if (!iUseSwDirectGdi) sl@0: { sl@0: RunTestsL(); sl@0: RunOomTestsL(); sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("SW DirectGDI has no image cache to test!")); sl@0: } sl@0: sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("BitGDI has no image cache to test!")); sl@0: } sl@0: return TestStepResult(); sl@0: } sl@0: sl@0: /** sl@0: Override of base class pure virtual sl@0: Lists the tests to be run sl@0: */ sl@0: void CTVgImageCache::RunTestsL() sl@0: { sl@0: SetTestStepID(_L("GRAPHICS-DIRECTGDI-VGIMAGECACHE-0001")); sl@0: TestAddEntriesL(); sl@0: RecordTestResultL(); sl@0: SetTestStepID(_L("GRAPHICS-DIRECTGDI-VGIMAGECACHE-0005")); sl@0: TestFullCacheL(); sl@0: RecordTestResultL(); sl@0: SetTestStepID(_L("GRAPHICS-DIRECTGDI-VGIMAGECACHE-0006")); sl@0: TestImageLargerThanCacheL(); sl@0: RecordTestResultL(); sl@0: SetTestStepID(_L("GRAPHICS-DIRECTGDI-VGIMAGECACHE-0002")); sl@0: TestBitmapResizedL(); sl@0: RecordTestResultL(); sl@0: SetTestStepID(_L("GRAPHICS-DIRECTGDI-VGIMAGECACHE-0003")); sl@0: TestBitmapSwapWidthAndHeightL(); sl@0: RecordTestResultL(); sl@0: SetTestStepID(_L("GRAPHICS-DIRECTGDI-VGIMAGECACHE-0004")); sl@0: TestVolatileBitmapL(); sl@0: RecordTestResultL(); sl@0: }