common/tools/ats/smoketest/graphics/gdi/src/T_DataBitmapContext.cpp
author victorp@symbian.org
Wed, 03 Feb 2010 16:06:24 +0000
changeset 872 17498133d9ad
parent 833 6ffc235847d0
permissions -rw-r--r--
adding EPL headers to smoke test
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
833
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     1
/*
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
872
17498133d9ad adding EPL headers to smoke test
victorp@symbian.org
parents: 833
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
833
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
872
17498133d9ad adding EPL headers to smoke test
victorp@symbian.org
parents: 833
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
833
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     8
*
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    11
*
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    12
* Contributors:
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    13
*
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    14
* Description:
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    15
*
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    16
*/
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    17
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    18
/**
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    19
@test
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    20
@internalComponent
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    21
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    22
This contains CT_DataGraphicsContext
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    23
*/
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    24
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    25
#include "T_DataBitmapContext.h"
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    26
#include "T_GraphicsUtil.h"
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    27
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    28
/*@{*/
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    29
///	Commands
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    30
_LIT(KCmdAlphaBlendBitmaps,							"AlphaBlendBitmaps");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    31
_LIT(KCmdBitBlt,									"BitBlt");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    32
_LIT(KCmdBitBltMasked,								"BitBltMasked");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    33
_LIT(KCmdClear,										"Clear");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    34
_LIT(KCmdCopyRect,									"CopyRect");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    35
_LIT(KCmdSetFaded,									"SetFaded");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    36
_LIT(KCmdSetFadingParameters,						"SetFadingParameters");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    37
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    38
///	Fields
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    39
_LIT(KFldAlphaBmp,									"alphabmp");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    40
_LIT(KFldAlphaPt,									"alphapt");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    41
_LIT(KFldBitmap,									"bitmap");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    42
_LIT(KFldBlackMap,									"blackmap");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    43
_LIT(KFldDestination,								"destination");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    44
_LIT(KFldDestPt,									"destpt");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    45
_LIT(KFldFaded,										"faded");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    46
_LIT(KFldInvertMask,								"invertmask");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    47
_LIT(KFldMaskBitmap,								"maskbitmap");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    48
_LIT(KFldOffset,									"offset");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    49
_LIT(KFldPoint,										"point");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    50
_LIT(KFldRect,										"rect");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    51
_LIT(KFldSource,									"source");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    52
_LIT(KFldSourceRect,								"sourcerect");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    53
_LIT(KFldSrcBmp,									"srcbmp");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    54
_LIT(KFldSrcRect,									"srcrect");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    55
_LIT(KFldSrcWsBmp,									"srcwsbmp");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    56
_LIT(KFldWhiteMap,									"whitemap");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    57
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    58
///	Logging
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    59
_LIT(KLogError,										"Error=%d");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    60
_LIT(KLogMissingParameter,							"Missing parameter '%S'");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    61
/*@}*/
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    62
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    63
/**
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    64
* Constructor. First phase construction
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    65
*/
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    66
CT_DataBitmapContext::CT_DataBitmapContext()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    67
:	CT_DataGraphicsContext()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    68
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    69
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    70
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    71
/**
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    72
* Process a command read from the ini file
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    73
*
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    74
* @param aDataWrapper	test step requiring command to be processed
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    75
* @param aCommand	the command to process
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    76
* @param aSection		the entry in the ini file requiring the command to be processed
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    77
*
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    78
* @return ETrue if the command is processed
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    79
*/
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    80
TBool CT_DataBitmapContext::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    81
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    82
	TBool	ret=ETrue;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    83
	if ( aCommand==KCmdAlphaBlendBitmaps )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    84
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    85
		DoCmdAlphaBlendBitmapsL(aSection);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    86
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    87
	else if ( aCommand==KCmdBitBlt )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    88
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    89
		DoCmdBitBltL(aSection);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    90
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    91
	else if ( aCommand==KCmdBitBltMasked )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    92
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    93
		DoCmdBitBltMaskedL(aSection);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    94
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    95
	else if ( aCommand==KCmdClear )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    96
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    97
		DoCmdClear(aSection);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    98
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    99
	else if ( aCommand==KCmdCopyRect )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   100
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   101
		DoCmdCopyRect(aSection);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   102
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   103
	else if ( aCommand==KCmdSetFaded )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   104
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   105
		DoCmdSetFaded(aSection);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   106
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   107
	else if ( aCommand==KCmdSetFadingParameters )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   108
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   109
		DoCmdSetFadingParameters(aSection);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   110
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   111
	else
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   112
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   113
		ret=CT_DataGraphicsContext::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   114
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   115
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   116
	return ret;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   117
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   118
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   119
void CT_DataBitmapContext::DoCmdAlphaBlendBitmapsL(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   120
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   121
	TBool	dataOk=ETrue;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   122
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   123
	TPoint	destinationPoint;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   124
	if ( !GetPointFromConfig(aSection, KFldDestPt, destinationPoint) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   125
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   126
		dataOk=EFalse;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   127
		ERR_PRINTF2(KLogMissingParameter, &KFldDestPt());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   128
		SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   129
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   130
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   131
	TRect	sourceRect;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   132
	if ( !GetRectFromConfig(aSection, KFldSrcRect, sourceRect) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   133
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   134
		dataOk=EFalse;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   135
		ERR_PRINTF2(KLogMissingParameter, &KFldSrcRect());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   136
		SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   137
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   138
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   139
	TPoint	alphaPoint;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   140
	if ( !GetPointFromConfig(aSection, KFldAlphaPt, alphaPoint) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   141
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   142
		dataOk=EFalse;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   143
		ERR_PRINTF2(KLogMissingParameter, &KFldAlphaPt());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   144
		SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   145
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   146
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   147
	if ( dataOk )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   148
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   149
		TInt		err=KErrNone;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   150
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   151
		CWsBitmap*	wsBitmap=NULL;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   152
		if ( CT_GraphicsUtil::GetWsBitmapL(*this, aSection, KFldSrcWsBmp, wsBitmap) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   153
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   154
			CWsBitmap*	alphaBitmap=NULL;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   155
			if ( !CT_GraphicsUtil::GetWsBitmapL(*this, aSection, KFldAlphaBmp, alphaBitmap) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   156
				{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   157
				ERR_PRINTF2(KLogMissingParameter, &KFldAlphaBmp());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   158
				SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   159
				}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   160
			else
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   161
				{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   162
				INFO_PRINTF1(_L("execute AlphaBlendBitmaps(TPoint, CWsBitmap*, TRect, CWsBitmap*, TPoint)"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   163
				err=GetBitmapContext()->AlphaBlendBitmaps(destinationPoint, wsBitmap, sourceRect, alphaBitmap, alphaPoint);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   164
				}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   165
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   166
		else
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   167
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   168
			CFbsBitmap*	fbsBitmap=NULL;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   169
			if ( CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFldSrcBmp, fbsBitmap) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   170
				{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   171
				CFbsBitmap*	alphaBitmap=NULL;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   172
				if ( !CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFldAlphaBmp, alphaBitmap) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   173
					{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   174
					ERR_PRINTF2(KLogMissingParameter, &KFldAlphaBmp());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   175
					SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   176
					}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   177
				else
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   178
					{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   179
					INFO_PRINTF1(_L("execute AlphaBlendBitmaps(TPoint, CFbsBitmap*, TRect, CFbsBitmap*, TPoint)"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   180
					err=GetBitmapContext()->AlphaBlendBitmaps(destinationPoint, fbsBitmap, sourceRect, alphaBitmap, alphaPoint);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   181
					}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   182
				}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   183
			else
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   184
				{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   185
				ERR_PRINTF2(KLogMissingParameter, &KFldSrcWsBmp());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   186
				ERR_PRINTF2(KLogMissingParameter, &KFldSrcBmp());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   187
				SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   188
				}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   189
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   190
		if ( err!=KErrNone )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   191
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   192
			ERR_PRINTF2(KLogError, err);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   193
			SetError(err);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   194
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   195
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   196
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   197
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   198
void CT_DataBitmapContext::DoCmdBitBltL(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   199
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   200
	TBool	dataOk=ETrue;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   201
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   202
	CFbsBitmap*	bitmap=NULL;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   203
	if ( !CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFldBitmap, bitmap) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   204
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   205
		dataOk=EFalse;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   206
		ERR_PRINTF2(KLogMissingParameter, &KFldBitmap());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   207
		SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   208
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   209
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   210
	TPoint		point;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   211
	if ( GetPointFromConfig(aSection, KFldPoint, point) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   212
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   213
		if ( dataOk )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   214
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   215
			// Execute command and log parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   216
			INFO_PRINTF1(_L("execute BitBlt(TPoint, CFbsBitmap*)"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   217
			GetBitmapContext()->BitBlt(point, bitmap);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   218
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   219
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   220
	else
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   221
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   222
		TPoint	destination;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   223
		if ( !GetPointFromConfig(aSection, KFldDestination, destination) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   224
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   225
			dataOk=EFalse;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   226
			ERR_PRINTF2(KLogMissingParameter, &KFldDestination());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   227
			SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   228
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   229
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   230
		TRect	source;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   231
		if ( !GetRectFromConfig(aSection, KFldSource, source) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   232
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   233
			dataOk=EFalse;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   234
			ERR_PRINTF2(KLogMissingParameter, &KFldSource());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   235
			SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   236
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   237
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   238
		if ( dataOk )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   239
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   240
			// Execute command and log parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   241
			INFO_PRINTF1(_L("execute BitBlt(TRect, CFbsBitmap*, TRect)"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   242
			GetBitmapContext()->BitBlt(destination, bitmap, source);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   243
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   244
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   245
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   246
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   247
void CT_DataBitmapContext::DoCmdBitBltMaskedL(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   248
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   249
	TBool	dataOk=ETrue;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   250
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   251
	// Get test data for command input parameter(s)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   252
	TPoint	point;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   253
	if ( !GetPointFromConfig(aSection, KFldPoint, point) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   254
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   255
		dataOk=EFalse;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   256
		ERR_PRINTF2(KLogMissingParameter, &KFldPoint());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   257
		SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   258
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   259
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   260
	TRect	sourceRect;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   261
	if ( !GetRectFromConfig(aSection, KFldSourceRect, sourceRect) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   262
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   263
		dataOk=EFalse;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   264
		ERR_PRINTF2(KLogMissingParameter, &KFldSourceRect());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   265
		SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   266
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   267
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   268
	TBool	invertMask;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   269
	if ( !GetBoolFromConfig(aSection, KFldInvertMask, invertMask) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   270
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   271
		dataOk=EFalse;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   272
		ERR_PRINTF2(KLogMissingParameter, &KFldInvertMask());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   273
		SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   274
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   275
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   276
	CFbsBitmap*	bitmap=NULL;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   277
	if ( !CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFldBitmap, bitmap) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   278
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   279
		dataOk=EFalse;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   280
		ERR_PRINTF2(KLogMissingParameter, &KFldBitmap());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   281
		SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   282
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   283
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   284
	if ( dataOk )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   285
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   286
		CFbsBitmap*	maskBitmap=NULL;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   287
		CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFldMaskBitmap, maskBitmap);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   288
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   289
		// Execute command and log parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   290
		INFO_PRINTF1(_L("execute BitBltMasked(TPoint, CFbsBitmap*, TRect, CFbsBitmap*, TBool)"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   291
		GetBitmapContext()->BitBltMasked(point, bitmap, sourceRect, maskBitmap, invertMask);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   292
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   293
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   294
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   295
void CT_DataBitmapContext::DoCmdClear(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   296
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   297
	// Get test data for command input parameter(s)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   298
	TRect	rect;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   299
	if ( GetRectFromConfig(aSection, KFldRect, rect) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   300
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   301
		// Execute command and log parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   302
		INFO_PRINTF1(_L("execute Clear(TRect)"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   303
		GetBitmapContext()->Clear(rect);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   304
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   305
	else
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   306
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   307
		// Execute command and log parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   308
		INFO_PRINTF1(_L("execute Clear()"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   309
		GetBitmapContext()->Clear();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   310
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   311
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   312
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   313
void CT_DataBitmapContext::DoCmdCopyRect(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   314
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   315
	TBool	dataOk=ETrue;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   316
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   317
	// Get test data for command input parameter(s)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   318
	TPoint	offset;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   319
	if ( !GetPointFromConfig(aSection, KFldOffset, offset) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   320
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   321
		dataOk=EFalse;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   322
		ERR_PRINTF2(KLogMissingParameter, &KFldOffset());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   323
		SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   324
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   325
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   326
	TRect	rect;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   327
	if ( !GetRectFromConfig(aSection, KFldRect, rect) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   328
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   329
		dataOk=EFalse;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   330
		ERR_PRINTF2(KLogMissingParameter, &KFldRect());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   331
		SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   332
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   333
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   334
	if ( dataOk )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   335
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   336
		// Execute command and log parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   337
		INFO_PRINTF1(_L("execute CopyRect(TPoint, TRect)"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   338
		GetBitmapContext()->CopyRect(offset, rect);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   339
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   340
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   341
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   342
void CT_DataBitmapContext::DoCmdSetFaded(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   343
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   344
	TBool	faded=ETrue;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   345
	if(	!GetBoolFromConfig(aSection, KFldFaded(), faded))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   346
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   347
		ERR_PRINTF2(KLogMissingParameter, &KFldFaded());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   348
		SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   349
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   350
	else
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   351
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   352
		// Execute command and log parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   353
		INFO_PRINTF1(_L("execute SetFaded(TBool)"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   354
		GetBitmapContext()->SetFaded(faded);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   355
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   356
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   357
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   358
void CT_DataBitmapContext::DoCmdSetFadingParameters(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   359
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   360
	TBool	dataOk=ETrue;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   361
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   362
	TInt	blackMap=0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   363
	if(	!GetIntFromConfig(aSection, KFldBlackMap(), blackMap) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   364
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   365
		dataOk=EFalse;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   366
		ERR_PRINTF2(KLogMissingParameter, &KFldBlackMap());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   367
		SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   368
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   369
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   370
	TInt	whiteMap=255;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   371
	if(	!GetIntFromConfig(aSection, KFldWhiteMap(), whiteMap) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   372
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   373
		dataOk=EFalse;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   374
		ERR_PRINTF2(KLogMissingParameter, &KFldWhiteMap());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   375
		SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   376
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   377
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   378
	if ( dataOk )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   379
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   380
		// Execute command and log parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   381
		INFO_PRINTF1(_L("execute SetFadingParameters(TUint8, TUint8)"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   382
		GetBitmapContext()->SetFadingParameters((TUint8)blackMap, (TUint8)whiteMap);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   383
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   384
	}