os/graphics/graphicsdeviceinterface/bitgdi/tbit/TClipMain.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2003-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 //
    15 
    16 #include <e32hal.h>
    17 #include <e32std.h>
    18 #include <e32test.h>
    19 #include <f32file.h>
    20 #include <bitstd.h>
    21 #include <bitdev.h>
    22 #include <hal.h>
    23 #include "tbmp.h"
    24 #include "TClip.h"
    25 #include <graphics/fbsdefs.h>
    26 
    27 //TClip test app runs only uncompressed bitmaps tests - part of original TClip test app.
    28 //The change was made because the original TClip test app took too much time (over 0.5 hour)
    29 //and usually was terminated with a TIMEOUT on LUBBOCK device.
    30 // main function
    31 TInt E32Main()
    32 	{
    33 	FbsStartup();
    34 	__UHEAP_MARK;
    35 	RFbsSession::Connect();
    36 	CTrapCleanup* tc=CTrapCleanup::New();
    37 
    38 	CFbsScreenDevice* dev=NULL;
    39 	CFbsBitGc* con=NULL;
    40 	CFbsFont* font=NULL;
    41 	CFbsFont* largefont=NULL;
    42 	::CreateTestEnvironment(dev, con, font, largefont);
    43 
    44 	RTest test(_L("TCLIP"));
    45 	test.Title();
    46 	test.Start(_L("Uncompressed"));
    47 
    48 	// Uncompressed
    49 	CFbsBitmap* bmp=new CFbsBitmap;
    50 	if(bmp==NULL)
    51 		User::Panic(_L("Bitmap not created"),KErrGeneral);
    52 	TInt ret=bmp->Load(_L("z:\\system\\data\\tbmp.mbm"),EMbmTbmpTbmp,EFalse);
    53 	if(ret!=KErrNone)
    54 		User::Panic(_L("Bitmap not loaded"),ret);
    55 	
    56 	TestClip* clip=new TestClip(0, &test, dev, con, bmp, font, largefont);
    57 	clip->Construct();
    58 	clip->TestRgn();
    59 	delete bmp;
    60 	delete clip;
    61 	
    62 	test.End();
    63 	test.Close();
    64 
    65 	::DestroyTestEnvironment(dev, con, font, largefont);
    66 
    67 	delete tc;
    68 	RFbsSession::Disconnect();
    69 	__UHEAP_MARKEND;
    70 	return 0;
    71 	}
    72