os/graphics/fbs/fontandbitmapserver/tfbs/TBitmap.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 2004-2010 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 "test/TGraphicsHarness.h"
    24 #include "fbsbitmapasyncstreamer.h"
    25 
    26 
    27 //The main test class. Add your test methods here.
    28 class CTBitmap : public CTGraphicsBase
    29 	{
    30 public:
    31 	CTBitmap(CTestStep* aStep);
    32 	~CTBitmap();
    33 	void DeleteScanLineBuffer();
    34 protected:
    35 //from 	CTGraphicsStep
    36 	virtual void RunTestCaseL(TInt aCurTestCase);
    37 
    38 private:
    39 	void CheckScanlineL();
    40 	void StreamBitmap();
    41 	void StreamRectangle();
    42 	void GetScanline();
    43 	void SetScanline();
    44 	void StretchScanline();
    45 	void LoadInSegments();
    46 	void SaveInSegments();
    47 	void MonoDetect();
    48 	void ChunkPileL();
    49 	void LargeBitmaps();
    50 	void HugeBitmaps();
    51 	void Resize();
    52 	void BitmapUtil();
    53 	void BitmapTiming();
    54 	void InvalidBitmap();
    55 	void SaveAndLoad();
    56 	void SaveAndLoadFast();
    57 	void Color256BitmapUtil();
    58 	void HardwareBitmaps();
    59 	void Compress();
    60 	void INC036062L();
    61 	void PerformanceTest_INC036062L();
    62 	void INC037474L();
    63 	void DEF038286L();
    64 	void DEF038286_2L();
    65 	void MonohromeL();
    66 	void GetVerticalScanLineL();
    67 	void GetVerticalScanLinePerformanceL();
    68 	void TwoComprLines();
    69 	void DEF071843_16MAL();
    70 	void DEF071843_16MUL();
    71 	void DEF071843_16ML();
    72 	void DEF074623_16MAL();
    73 #ifdef _DEBUG
    74 	void DEF095361_16MAL();
    75 #endif	
    76 	void TestPaletteCompressionL() ;
    77 	void TestSynchronousBackgroundPaletteCompressionL() ;
    78 	void TestAsynchronousBackgroundPaletteCompressionL() ;
    79 	void CompareColourLikeness(const TRgb& aSrc, const TRgb& aDest, TInt aDifference=0);
    80 	void GetAllBitmapsIdsL();
    81 	void CheckBadBmp();
    82 	void CheckSetDisplayModeL();
    83 	void MultiThreadedTestsL();
    84 	void MultiThreadedResizeTestL();
    85 	void MultiThreadedCompressTestL();
    86 	void DoMultiThreadedTestL(const TDesC& aThreadName, TInt (*aBitmapFunction)(CFbsBitmap*), TBool (*aCheckFunction)(const CFbsBitmap*));
    87 #ifdef SYMBIAN_DEBUG_FBS_LOCKHEAP
    88 	void MultiThreadedLockHeapTestL();
    89 #endif
    90 	void TestBgCompressL();
    91 	void TestBgCompressInUseL();
    92 	void TestDisconnectWithBitmapL();
    93 	void TestTouchedAndVolatileL();
    94 	void TestBitmapWhiteFillL();
    95 #ifdef _DEBUG
    96 	void TestBitmapUtilWithUnsupportedBitmap(const TDesC& aThreadName, TAny* aFunctionPtr);
    97 	void TestBitmapUtilWithUnsupportedBitmaps();
    98 #endif
    99 private:
   100 	void DoStreamBitmapSizes(TDisplayMode aDispMode);
   101 	void DoStreamBitmap(const TSize& aSize,TDisplayMode aDispMode,TBool aBlank);
   102 	void DoStreamRectangle(TDisplayMode aDispMode,TBool aBlank);
   103 	void DoGetScanline(const TSize& aSize,TDisplayMode aDispMode);
   104 	void DoGetScanlineCheck1(CFbsBitmap& aBitmap,CFbsBitmap& aReference,const TSize& aSize,TDisplayMode aDispMode);
   105 	void DoGetScanlineCheck2(CFbsBitmap& aBitmap,CFbsBitmap& aReference,const TSize& aSize,TDisplayMode aDispMode);
   106 	void DoGetScanlineCheck3(CFbsBitmap& aBitmap,TDisplayMode aDispMode);
   107 	void DoGetScanlineAlt(TDisplayMode aDispMode);
   108 	void DoSetScanline(TDisplayMode aDispMode);
   109 	void DoStretchScanline(const TSize& aSize,TDisplayMode aDispMode);
   110 	void DoMonoDetect(TDisplayMode aDisplayMode);
   111 	void DoLargeBitmaps(const TSize& aSize,TDisplayMode aDisplayMode);
   112 	void DoHugeBitmaps(const TSize& aSize,TDisplayMode aDisplayMode);
   113 	void DoResize(TDisplayMode aDispMode);
   114 	void DoBitmapUtil(const TSize& aSize,TDisplayMode aDispMode);
   115 	void DoSaveAndLoad(const TSize& aSize,TDisplayMode aDispMode,TBool aBlank);
   116 	void FuzzyCompareBitmapsColor256(CFbsBitmapEx& aBmp1,CFbsBitmapEx& aBmp2,TUint aDifLimit=7);
   117 	void CheckScanLine(CFbsBitmapEx& aBitmap,CFbsBitmapEx& aReference,TDisplayMode aDispMode);
   118 	void CheckWhite(TUint8* aData,TInt aDataLength,TDisplayMode aDispMode);
   119 	void CompareBitmaps(CFbsBitmapEx& aBmp1,CFbsBitmapEx& aBmp2,TDisplayMode aDispMode);
   120 	void DoCompareBitmaps(CFbsBitmapEx& aBmp1,CFbsBitmapEx& aBmp2,TDisplayMode aDispMode, TPoint aLineOrigin, TSize aBmpSize);
   121 	void CopyBitmap(CFbsBitmapEx& aBmp1,const CFbsBitmapEx& aBmp2);
   122 	void BlankBitmap(CFbsBitmapEx& aBitmap);
   123 	void FillBitmap(CFbsBitmapEx& aBitmap);
   124 	void StripeBitmap(CFbsBitmapEx& aBitmap);
   125 	TRgb ExtractRgb(TUint8* aBuffer,TInt aPixelOffset,TDisplayMode aDispMode);
   126 
   127 	static TInt BmpLoadCallBack(TAny* aPtr);
   128 	static TInt BmpSaveCallBack(TAny* aPtr);
   129 	CFbsBitmap* CreateBitmapLC(const TSize& aSize, TDisplayMode aMode);
   130 	CFbsBitmap* CreateBitmapLC(const TSize& aSize, TDisplayMode aMode, const CFbsBitmap* aSrcBmp);
   131 	CFbsBitmap* LoadBitmapLC(const TDesC& aFileName);
   132 	void LoadAndCompressBitmapLC(CFbsBitmap*& aBmp, const TDesC& aBmpFile);
   133 	void LoadAndNotCompressBitmapLC(CFbsBitmap*& aBmp, const TDesC& aBmpFile);
   134 	void TestAssortedBPPandColourDepthL(const TDesC& aFilename, RFbsSession* aFbs);
   135 	void DoStretchScanline(const TSize& aSize,TDisplayMode aSrcMode, TDisplayMode aDstMode, TBool aUseCompareLikeness);
   136 	TInt ColorDifference(TDisplayMode aMode,TInt aAlpha=0xff);
   137 private:
   138 	CFbsBitmapAsyncStreamer* iBmpHandler;
   139 	CFbsBitmap* iBitmap;
   140 	CActiveScheduler* iAs;
   141 	RFs iFs;
   142 	TFileName iTestBitmapName;
   143 	TBool iSkipRomBitmapTests;
   144 	};
   145 
   146 
   147 class CTBitmapStep : public CTGraphicsStep
   148 	{
   149 public:
   150 	CTBitmapStep();
   151 protected:	
   152 	//from CTGraphicsStep
   153 	virtual CTGraphicsBase* CreateTestL();
   154 	virtual void TestSetupL();
   155 	virtual void TestClose();
   156 	};
   157 
   158 _LIT(KTBitmapStep,"TBitmap");
   159 
   160 #endif//__TBITMAP_H__