fbs/fontandbitmapserver/tfbs/TBitmap.h
changeset 0 5d03bc08d59c
child 11 fed1595b188e
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // This file contains test bitmap file names for TBitmap test app.
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef __TBITMAP_H__
       
    19 #define __TBITMAP_H__
       
    20 
       
    21 #include <gdi.h>
       
    22 #include "TFBS.H"
       
    23 #include "TGraphicsHarness.h"
       
    24 #include "../sfbs/fbsbitmapasyncstreamer.h"
       
    25 
       
    26 //The main test class. Add your test methods here.
       
    27 class CTBitmap : public CTGraphicsBase
       
    28 	{
       
    29 public:
       
    30 	CTBitmap(CTestStep* aStep);
       
    31 	~CTBitmap();
       
    32 	void DeleteScanLineBuffer();
       
    33 protected:
       
    34 //from 	CTGraphicsStep
       
    35 	virtual void RunTestCaseL(TInt aCurTestCase);
       
    36 
       
    37 private:
       
    38 	void CheckScanlineL();
       
    39 	void StreamBitmap();
       
    40 	void StreamRectangle();
       
    41 	void GetScanline();
       
    42 	void SetScanline();
       
    43 	void StretchScanline();
       
    44 	void LoadInSegments();
       
    45 	void SaveInSegments();
       
    46 	void MonoDetect();
       
    47 	void ChunkPileL();
       
    48 	void LargeBitmaps();
       
    49 	void HugeBitmaps();
       
    50 	void Resize();
       
    51 	void BitmapUtil();
       
    52 	void BitmapTiming();
       
    53 	void InvalidBitmap();
       
    54 	void SaveAndLoad();
       
    55 	void SaveAndLoadFast();
       
    56 	void Color256BitmapUtil();
       
    57 	void HardwareBitmaps();
       
    58 	void Compress();
       
    59 	void INC036062L();
       
    60 	void PerformanceTest_INC036062L();
       
    61 	void INC037474L();
       
    62 	void DEF038286L();
       
    63 	void DEF038286_2L();
       
    64 	void MonohromeL();
       
    65 	void GetVerticalScanLineL();
       
    66 	void GetVerticalScanLinePerformanceL();
       
    67 	void TwoComprLines();
       
    68 	void DEF071843_16MAL();
       
    69 	void DEF071843_16MUL();
       
    70 	void DEF071843_16ML();
       
    71 	void DEF074623_16MAL();
       
    72 #ifdef _DEBUG
       
    73 	void DEF095361_16MAL();
       
    74 #endif	
       
    75 	void TestPaletteCompressionL() ;
       
    76 	void TestSynchronousBackgroundPaletteCompressionL() ;
       
    77 	void TestAsynchronousBackgroundPaletteCompressionL() ;
       
    78 	void CompareColourLikeness(const TRgb& aSrc, const TRgb& aDest, TInt aDifference=0);
       
    79 	void GetAllBitmapsIdsL();
       
    80 	void CheckBadBmp();
       
    81 	void CheckSetDisplayModeL();
       
    82 	void MultiThreadedTestsL();
       
    83 	void MultiThreadedResizeTestL();
       
    84 	void MultiThreadedCompressTestL();
       
    85 	void DoMultiThreadedTestL(const TDesC& aThreadName, TInt (*aBitmapFunction)(CFbsBitmap*), TBool (*aCheckFunction)(const CFbsBitmap*));
       
    86 #ifdef SYMBIAN_DEBUG_FBS_LOCKHEAP
       
    87 	void MultiThreadedLockHeapTestL();
       
    88 #endif
       
    89 	void TestBgCompressL();
       
    90 	void TestBgCompressInUseL();
       
    91 	void TestDisconnectWithBitmapL();
       
    92 	void TestTouchedAndVolatileL();
       
    93 	void TestBitmapWhiteFillL();
       
    94 private:
       
    95 	void DoStreamBitmapSizes(TDisplayMode aDispMode);
       
    96 	void DoStreamBitmap(const TSize& aSize,TDisplayMode aDispMode,TBool aBlank);
       
    97 	void DoStreamRectangle(TDisplayMode aDispMode,TBool aBlank);
       
    98 	void DoGetScanline(const TSize& aSize,TDisplayMode aDispMode);
       
    99 	void DoGetScanlineCheck1(CFbsBitmap& aBitmap,CFbsBitmap& aReference,const TSize& aSize,TDisplayMode aDispMode);
       
   100 	void DoGetScanlineCheck2(CFbsBitmap& aBitmap,CFbsBitmap& aReference,const TSize& aSize,TDisplayMode aDispMode);
       
   101 	void DoGetScanlineCheck3(CFbsBitmap& aBitmap,TDisplayMode aDispMode);
       
   102 	void DoGetScanlineAlt(TDisplayMode aDispMode);
       
   103 	void DoSetScanline(TDisplayMode aDispMode);
       
   104 	void DoStretchScanline(const TSize& aSize,TDisplayMode aDispMode);
       
   105 	void DoMonoDetect(TDisplayMode aDisplayMode);
       
   106 	void DoLargeBitmaps(const TSize& aSize,TDisplayMode aDisplayMode);
       
   107 	void DoHugeBitmaps(const TSize& aSize,TDisplayMode aDisplayMode);
       
   108 	void DoResize(TDisplayMode aDispMode);
       
   109 	void DoBitmapUtil(const TSize& aSize,TDisplayMode aDispMode);
       
   110 	void DoSaveAndLoad(const TSize& aSize,TDisplayMode aDispMode,TBool aBlank);
       
   111 	void FuzzyCompareBitmapsColor256(CFbsBitmapEx& aBmp1,CFbsBitmapEx& aBmp2,TUint aDifLimit=7);
       
   112 	void CheckScanLine(CFbsBitmapEx& aBitmap,CFbsBitmapEx& aReference,TDisplayMode aDispMode);
       
   113 	void CheckWhite(TUint8* aData,TInt aDataLength,TDisplayMode aDispMode);
       
   114 	void CompareBitmaps(CFbsBitmapEx& aBmp1,CFbsBitmapEx& aBmp2,TDisplayMode aDispMode);
       
   115 	void DoCompareBitmaps(CFbsBitmapEx& aBmp1,CFbsBitmapEx& aBmp2,TDisplayMode aDispMode, TPoint aLineOrigin, TSize aBmpSize);
       
   116 	void CopyBitmap(CFbsBitmapEx& aBmp1,const CFbsBitmapEx& aBmp2);
       
   117 	void BlankBitmap(CFbsBitmapEx& aBitmap);
       
   118 	void FillBitmap(CFbsBitmapEx& aBitmap);
       
   119 	void StripeBitmap(CFbsBitmapEx& aBitmap);
       
   120 	TRgb ExtractRgb(TUint8* aBuffer,TInt aPixelOffset,TDisplayMode aDispMode);
       
   121 
       
   122 	static TInt BmpLoadCallBack(TAny* aPtr);
       
   123 	static TInt BmpSaveCallBack(TAny* aPtr);
       
   124 	CFbsBitmap* CreateBitmapLC(const TSize& aSize, TDisplayMode aMode);
       
   125 	CFbsBitmap* CreateBitmapLC(const TSize& aSize, TDisplayMode aMode, const CFbsBitmap* aSrcBmp);
       
   126 	CFbsBitmap* LoadBitmapLC(const TDesC& aFileName);
       
   127 	void LoadAndCompressBitmapLC(CFbsBitmap*& aBmp, const TDesC& aBmpFile);
       
   128 	void LoadAndNotCompressBitmapLC(CFbsBitmap*& aBmp, const TDesC& aBmpFile);
       
   129 	void TestAssortedBPPandColourDepthL(const TDesC& aFilename, RFbsSession* aFbs);
       
   130 	void DoStretchScanline(const TSize& aSize,TDisplayMode aSrcMode, TDisplayMode aDstMode, TBool aUseCompareLikeness);
       
   131 	TInt ColorDifference(TDisplayMode aMode,TInt aAlpha=0xff);
       
   132 private:
       
   133 	CFbsBitmapAsyncStreamer* iBmpHandler;
       
   134 	CFbsBitmap* iBitmap;
       
   135 	CActiveScheduler* iAs;
       
   136 	RFs iFs;
       
   137 	TFileName iTestBitmapName;
       
   138 	TBool iSkipRomBitmapTests;
       
   139 	};
       
   140 
       
   141 
       
   142 class CTBitmapStep : public CTGraphicsStep
       
   143 	{
       
   144 public:
       
   145 	CTBitmapStep();
       
   146 protected:	
       
   147 	//from CTGraphicsStep
       
   148 	virtual CTGraphicsBase* CreateTestL();
       
   149 	virtual void TestSetupL();
       
   150 	virtual void TestClose();
       
   151 	};
       
   152 
       
   153 _LIT(KTBitmapStep,"TBitmap");
       
   154 
       
   155 #endif//__TBITMAP_H__