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.
sl@0
     1
// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
#include <e32hal.h>
sl@0
    17
#include <e32std.h>
sl@0
    18
#include <e32test.h>
sl@0
    19
#include <f32file.h>
sl@0
    20
#include <bitstd.h>
sl@0
    21
#include <bitdev.h>
sl@0
    22
#include <hal.h>
sl@0
    23
#include "tbmp.h"
sl@0
    24
#include "TClip.h"
sl@0
    25
#include <graphics/fbsdefs.h>
sl@0
    26
sl@0
    27
//TClip test app runs only uncompressed bitmaps tests - part of original TClip test app.
sl@0
    28
//The change was made because the original TClip test app took too much time (over 0.5 hour)
sl@0
    29
//and usually was terminated with a TIMEOUT on LUBBOCK device.
sl@0
    30
// main function
sl@0
    31
TInt E32Main()
sl@0
    32
	{
sl@0
    33
	FbsStartup();
sl@0
    34
	__UHEAP_MARK;
sl@0
    35
	RFbsSession::Connect();
sl@0
    36
	CTrapCleanup* tc=CTrapCleanup::New();
sl@0
    37
sl@0
    38
	CFbsScreenDevice* dev=NULL;
sl@0
    39
	CFbsBitGc* con=NULL;
sl@0
    40
	CFbsFont* font=NULL;
sl@0
    41
	CFbsFont* largefont=NULL;
sl@0
    42
	::CreateTestEnvironment(dev, con, font, largefont);
sl@0
    43
sl@0
    44
	RTest test(_L("TCLIP"));
sl@0
    45
	test.Title();
sl@0
    46
	test.Start(_L("Uncompressed"));
sl@0
    47
sl@0
    48
	// Uncompressed
sl@0
    49
	CFbsBitmap* bmp=new CFbsBitmap;
sl@0
    50
	if(bmp==NULL)
sl@0
    51
		User::Panic(_L("Bitmap not created"),KErrGeneral);
sl@0
    52
	TInt ret=bmp->Load(_L("z:\\system\\data\\tbmp.mbm"),EMbmTbmpTbmp,EFalse);
sl@0
    53
	if(ret!=KErrNone)
sl@0
    54
		User::Panic(_L("Bitmap not loaded"),ret);
sl@0
    55
	
sl@0
    56
	TestClip* clip=new TestClip(0, &test, dev, con, bmp, font, largefont);
sl@0
    57
	clip->Construct();
sl@0
    58
	clip->TestRgn();
sl@0
    59
	delete bmp;
sl@0
    60
	delete clip;
sl@0
    61
	
sl@0
    62
	test.End();
sl@0
    63
	test.Close();
sl@0
    64
sl@0
    65
	::DestroyTestEnvironment(dev, con, font, largefont);
sl@0
    66
sl@0
    67
	delete tc;
sl@0
    68
	RFbsSession::Disconnect();
sl@0
    69
	__UHEAP_MARKEND;
sl@0
    70
	return 0;
sl@0
    71
	}
sl@0
    72