1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/graphicsdeviceinterface/bitgdi/tbit/TClipMain.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,72 @@
1.4 +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#include <e32hal.h>
1.20 +#include <e32std.h>
1.21 +#include <e32test.h>
1.22 +#include <f32file.h>
1.23 +#include <bitstd.h>
1.24 +#include <bitdev.h>
1.25 +#include <hal.h>
1.26 +#include "tbmp.h"
1.27 +#include "TClip.h"
1.28 +#include <graphics/fbsdefs.h>
1.29 +
1.30 +//TClip test app runs only uncompressed bitmaps tests - part of original TClip test app.
1.31 +//The change was made because the original TClip test app took too much time (over 0.5 hour)
1.32 +//and usually was terminated with a TIMEOUT on LUBBOCK device.
1.33 +// main function
1.34 +TInt E32Main()
1.35 + {
1.36 + FbsStartup();
1.37 + __UHEAP_MARK;
1.38 + RFbsSession::Connect();
1.39 + CTrapCleanup* tc=CTrapCleanup::New();
1.40 +
1.41 + CFbsScreenDevice* dev=NULL;
1.42 + CFbsBitGc* con=NULL;
1.43 + CFbsFont* font=NULL;
1.44 + CFbsFont* largefont=NULL;
1.45 + ::CreateTestEnvironment(dev, con, font, largefont);
1.46 +
1.47 + RTest test(_L("TCLIP"));
1.48 + test.Title();
1.49 + test.Start(_L("Uncompressed"));
1.50 +
1.51 + // Uncompressed
1.52 + CFbsBitmap* bmp=new CFbsBitmap;
1.53 + if(bmp==NULL)
1.54 + User::Panic(_L("Bitmap not created"),KErrGeneral);
1.55 + TInt ret=bmp->Load(_L("z:\\system\\data\\tbmp.mbm"),EMbmTbmpTbmp,EFalse);
1.56 + if(ret!=KErrNone)
1.57 + User::Panic(_L("Bitmap not loaded"),ret);
1.58 +
1.59 + TestClip* clip=new TestClip(0, &test, dev, con, bmp, font, largefont);
1.60 + clip->Construct();
1.61 + clip->TestRgn();
1.62 + delete bmp;
1.63 + delete clip;
1.64 +
1.65 + test.End();
1.66 + test.Close();
1.67 +
1.68 + ::DestroyTestEnvironment(dev, con, font, largefont);
1.69 +
1.70 + delete tc;
1.71 + RFbsSession::Disconnect();
1.72 + __UHEAP_MARKEND;
1.73 + return 0;
1.74 + }
1.75 +