uigraphics/NVGRenderStage/src/nvgrenderstage.cpp
author William Roberts <williamr@symbian.org>
Thu, 07 Jan 2010 12:19:27 +0000
changeset 20 f6fd4830a02c
parent 15 1bd1043e4812
permissions -rw-r--r--
Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
     1
// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
     2
// All rights reserved.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
     7
//
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
     8
// Initial Contributors:
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    10
//
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    11
// Contributors:
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    12
// Symbian Foundation Ltd- conversion from t_extendedbitmaprenderstage
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    13
//
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    14
// Description:
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    15
//
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    16
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    17
#include "nvgrenderstage.h"
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    18
#include <graphics/wsrenderstage.h>
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    19
#include <s32mem.h>
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    20
#include <AknIconHeader.h>
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    21
#include <AknIconUtils.h>
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    22
20
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
    23
TCachedConversion::TCachedConversion() :
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
    24
  iLink(), iCachedResult(NULL)
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
    25
  {}
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
    26
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
    27
TCachedConversion::~TCachedConversion()
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
    28
  {
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
    29
  delete iCachedResult;
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
    30
  }
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    31
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    32
const TUid KUidNvgExtendedBitmap = {0x39b9273e};  
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    33
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    34
CNvgRenderStage::CNvgRenderStage() : 	
20
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
    35
	iExtendedBitmapError(KErrNone), 
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
    36
	iCache(_FOFF(TCachedConversion,iLink)), 
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
    37
	iCacheIterator(iCache),
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
    38
	iCacheFree(MAX_NVG_CACHE_SIZE)
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    39
	{	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    40
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    41
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    42
/** Called by CNvgRenderStageFactory::CreateRenderStageL() and 
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    43
CNvgRenderStageFactory::CreateFinalRenderStageL() when a new render stage
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    44
called "nvgbitmap" is to be created. The only parameter used by this render stage
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    45
is aNextStage, the rest are commented out to prevent warnings.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    46
@see MWsRenderStageFactory::CreateRenderStageL()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    47
@see MWsRenderStageFactory::CreateFinalRenderStageL()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    48
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    49
CNvgRenderStage* CNvgRenderStage::NewL(MWsGraphicDrawerEnvironment* /*aEnv*/, MWsScreen* /*aScreen*/, MWsScreenRedraw* /*aScreenRedraw*/, CWsRenderStage* aNextStage)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    50
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    51
	CNvgRenderStage* stage = new(ELeave) CNvgRenderStage();
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    52
	CleanupStack::PushL(stage);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    53
	stage->ConstructL(aNextStage);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    54
	CleanupStack::Pop(stage);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    55
	return stage;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    56
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    57
	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    58
void CNvgRenderStage::ConstructL(CWsRenderStage* aNextStage)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    59
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    60
	iBrushPattern = new(ELeave) CFbsBitmap;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    61
	iInternalBrushPattern = new(ELeave) CFbsBitmap;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    62
	iGraphicsInterface = new(ELeave) CVGIGraphicsInterface;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    63
  iNvgEngine = CNvgEngine::NewL();
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    64
  iNvgEngine->SetVGImageBinder(iGraphicsInterface);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    65
	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    66
	BaseConstructL();	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    67
	SetNext(aNextStage);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    68
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    69
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    70
CNvgRenderStage::~CNvgRenderStage()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    71
	{	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    72
	iEmptyRegion.Close();
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    73
	delete iBrushPattern;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    74
	delete iInternalBrushPattern;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    75
	delete iNvgEngine;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    76
	delete iGraphicsInterface;
20
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
    77
	
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
    78
	iCacheIterator.SetToFirst();
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
    79
  TCachedConversion* cached = iCacheIterator++;
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
    80
	while (cached != NULL)
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
    81
	 {
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
    82
   delete cached;
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
    83
   cached = iCacheIterator++;
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
    84
   }
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    85
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    86
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    87
/** The only interface returned by this render stage is MWsGraphicsContext.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    88
All other interface requests are passed to the base render stage class for resolving.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    89
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    90
@see CWsRenderStage::ResolveObjectInterface()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    91
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    92
@param aTypeId The type id of the interface to be retreived, must be one of the 
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    93
TSurfaceConfiguration interface extension IDs.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    94
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    95
@return Returns a pointer to an object that has the requested interface if found, 
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    96
otherwise returns NULL.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    97
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    98
TAny* CNvgRenderStage::ResolveObjectInterface(TUint aTypeId)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    99
	{	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   100
	switch (aTypeId)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   101
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   102
		case MWsGraphicsContext::EWsObjectInterfaceId:
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   103
			return static_cast<MWsGraphicsContext*>(this);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   104
		
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   105
		default:
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   106
			return CWsRenderStage::ResolveObjectInterface(aTypeId);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   107
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   108
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   109
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   110
/** Call Begin() for this render stage and for the next one as well. It is assumed
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   111
that this renderstage is chained in front of a renderstage that can draw to a
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   112
CGraphicsContext as this renderstage uses MWsGraphicsContext interface from the
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   113
next stage to draw to. A pointer to the MWsGraphicsContext interface is saved here
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   114
and is used for all subsequent MWsGraphicsContext operations called on this
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   115
render stage. 
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   116
15
1bd1043e4812 COnfigure NVGRenderStage in wsini.ini, and tweak some comments
William Roberts <williamr@symbian.org>
parents: 14
diff changeset
   117
This render stage draws all extended bitmaps of type 0x39b9273e
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   118
and passes all other drawing operations directly to the next render stage through
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   119
its MWsGraphicsContext interface.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   120
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   121
@see CWsRenderStage::Begin()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   122
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   123
@param aRegion The dirty region for which drawing operations are about to be issued.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   124
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   125
@post An error of KErrNotFound is set for this render stage if the MWsGraphicsContext
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   126
interface of the next render stage cannot be obtained. This render stage relies on
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   127
the existence of a subsequent stage with a valid MWsGraphicsContext interface to send
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   128
its draw operations to so will not be able to draw anything if no MWsGraphicsContext
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   129
is returned by the next render stage. The current error for this render stage can be
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   130
retreived by calling GetError().
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   131
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   132
void CNvgRenderStage::Begin(const TRegion* aRegion)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   133
	{		
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   134
	CWsRenderStage* nextStage = Next();
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   135
	if (nextStage)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   136
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   137
		nextStage->Begin(aRegion);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   138
		
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   139
		// Use the graphics context from the next render stage to draw to
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   140
		iGc = static_cast<MWsGraphicsContext*>(nextStage->ResolveObjectInterface(MWsGraphicsContext::EWsObjectInterfaceId));
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   141
		if (iGc == NULL)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   142
			{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   143
			iExtendedBitmapError = KErrNotFound; 
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   144
			}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   145
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   146
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   147
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   148
/** Signals that the currect batch of drawing operations is complete. This
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   149
implementation of End() just calls End() for the next render stage in the chain.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   150
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   151
@see CWsRenderStage::End()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   152
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   153
@param aCompositorReady Will be completed when the render stage is ready to 
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   154
receive the next batch of drawing operations.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   155
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   156
void CNvgRenderStage::End(TRequestStatus* aCompositorReady)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   157
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   158
	if (Next())
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   159
		{		
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   160
		Next()->End(aCompositorReady);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   161
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   162
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   163
15
1bd1043e4812 COnfigure NVGRenderStage in wsini.ini, and tweak some comments
William Roberts <williamr@symbian.org>
parents: 14
diff changeset
   164
/** If the passed bitmap is an extended bitmap of type 0x39b9273e, draw it to the stored
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   165
graphics context of the next render stage using  DrawExtendedBitmap(), if the passed bitmap
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   166
is not an extended bitmap just pass it on to the next render stage directly.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   167
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   168
@see CFbsBitGc::BitBlt(const TPoint&, const CFbsBitmap&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   169
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   170
void CNvgRenderStage::BitBlt(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   171
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   172
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   173
		{
20
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   174
		CFbsBitmap* sourceBitmap = const_cast<CFbsBitmap*>(&aSourceBitmap);
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   175
		
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   176
		if (aSourceBitmap.ExtendedBitmapType() == KUidNvgExtendedBitmap)
20
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   177
			{						
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   178
			sourceBitmap = GetConvertedBitmap(aSourceBitmap);
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   179
			}
20
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   180
		
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   181
		iGc->BitBlt(aDestPos, *sourceBitmap);
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   182
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   183
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   184
15
1bd1043e4812 COnfigure NVGRenderStage in wsini.ini, and tweak some comments
William Roberts <williamr@symbian.org>
parents: 14
diff changeset
   185
/** If the passed bitmap is an extended bitmap of type 0x39b9273e, draw it to the 
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   186
stored graphics context of the next render stage using  DrawExtendedBitmap(), if the
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   187
passed bitmap is not an extended bitmap just pass it on to the next render stage directly.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   188
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   189
@see CFbsBitGc::BitBlt(const TPoint&, const CFbsBitmap&, const TRect&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   190
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   191
void CNvgRenderStage::BitBlt(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   192
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   193
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   194
		{			
20
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   195
		CFbsBitmap* sourceBitmap = const_cast<CFbsBitmap*>(&aSourceBitmap);
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   196
		
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   197
		if (aSourceBitmap.ExtendedBitmapType() == KUidNvgExtendedBitmap)
20
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   198
			{						
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   199
			sourceBitmap = GetConvertedBitmap(aSourceBitmap);
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   200
			}
20
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   201
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   202
		iGc->BitBlt(aDestPos, *sourceBitmap, aSourceRect);
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   203
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   204
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   205
15
1bd1043e4812 COnfigure NVGRenderStage in wsini.ini, and tweak some comments
William Roberts <williamr@symbian.org>
parents: 14
diff changeset
   206
/** If either of the passed bitmaps is an extended bitmap of type 0x39b9273e convert
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   207
to a normal bitmap before passing to the next render stage, otherwise
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   208
just pass to the next render stage directly.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   209
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   210
@see CFbsBitGc::BitBltMasked(const TPoint& aDestPos, const CFbsBitmap&, const TRect&, const CFbsBitmap&, TBool)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   211
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   212
void CNvgRenderStage::BitBltMasked(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect, const CFbsBitmap& aMaskBitmap, TBool aInvertMask)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   213
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   214
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   215
		{		
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   216
		CFbsBitmap* sourceBitmap = const_cast<CFbsBitmap*>(&aSourceBitmap);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   217
		CFbsBitmap* maskBitmap = const_cast<CFbsBitmap*>(&aMaskBitmap);		
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   218
		
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   219
		if (aSourceBitmap.ExtendedBitmapType() == KUidNvgExtendedBitmap)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   220
			{						
20
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   221
			sourceBitmap = GetConvertedBitmap(aSourceBitmap);
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   222
			}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   223
		
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   224
		if (aMaskBitmap.ExtendedBitmapType() == KUidNvgExtendedBitmap)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   225
			{			
20
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   226
			maskBitmap = GetConvertedBitmap(aMaskBitmap);
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   227
			}	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   228
		
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   229
		iGc->BitBltMasked(aDestPos, *sourceBitmap, aSourceRect, *maskBitmap, aInvertMask);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   230
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   231
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   232
15
1bd1043e4812 COnfigure NVGRenderStage in wsini.ini, and tweak some comments
William Roberts <williamr@symbian.org>
parents: 14
diff changeset
   233
/** If either of the passed bitmaps is an extended bitmap of type 0x39b9273e
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   234
convert to a normal bitmap before passing to the next render stage, otherwise
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   235
just pass to the next render stage directly.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   236
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   237
@see CFbsBitGc::BitBltMasked(const TPoint& aDestPos, const CFbsBitmap&, const TRect&, const CFbsBitmap&, TPoint)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   238
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   239
void CNvgRenderStage::BitBltMasked(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect, const CFbsBitmap& aMaskBitmap, const TPoint& aMaskPos)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   240
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   241
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   242
		{		
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   243
		CFbsBitmap* sourceBitmap = const_cast<CFbsBitmap*>(&aSourceBitmap);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   244
		CFbsBitmap* maskBitmap = const_cast<CFbsBitmap*>(&aMaskBitmap);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   245
		
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   246
		if (aSourceBitmap.ExtendedBitmapType() == KUidNvgExtendedBitmap)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   247
			{
20
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   248
			sourceBitmap = GetConvertedBitmap(aSourceBitmap);
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   249
			}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   250
		
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   251
		if (aMaskBitmap.ExtendedBitmapType() == KUidNvgExtendedBitmap)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   252
			{
20
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   253
			maskBitmap = GetConvertedBitmap(aMaskBitmap);
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   254
			}	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   255
		
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   256
		iGc->BitBltMasked(aDestPos, *sourceBitmap, aSourceRect, *maskBitmap, aMaskPos);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   257
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   258
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   259
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   260
/** @see CFbsBitGc::ResetClippingRegion()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   261
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   262
void CNvgRenderStage::ResetClippingRegion()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   263
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   264
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   265
		{		
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   266
		iGc->ResetClippingRegion();
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   267
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   268
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   269
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   270
/** @see CFbsBitGc::Clear()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   271
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   272
void CNvgRenderStage::Clear()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   273
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   274
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   275
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   276
		iGc->Clear();
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   277
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   278
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   279
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   280
/** @see CFbsBitGc::Clear(const TRect&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   281
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   282
void CNvgRenderStage::Clear(const TRect& aRect)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   283
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   284
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   285
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   286
		iGc->Clear(aRect);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   287
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   288
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   289
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   290
/** @see CFbsBitGc::ResetBrushPattern()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   291
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   292
void CNvgRenderStage::ResetBrushPattern()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   293
	{	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   294
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   295
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   296
		iGc->ResetBrushPattern();
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   297
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   298
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   299
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   300
/** @see CFbsBitGc::ResetFont()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   301
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   302
void CNvgRenderStage::ResetFont()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   303
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   304
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   305
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   306
		iGc->ResetFont();
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   307
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   308
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   309
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   310
/** @see CFbsBitGc::DrawArc()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   311
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   312
void CNvgRenderStage::DrawArc(const TRect& aRect, const TPoint& aStart, const TPoint& aEnd)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   313
	{	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   314
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   315
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   316
		iGc->DrawArc(aRect, aStart, aEnd);	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   317
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   318
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   319
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   320
/** @see CFbsBitGc::DrawPie()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   321
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   322
void CNvgRenderStage::DrawPie(const TRect& aRect, const TPoint& aStart, const TPoint& aEnd)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   323
	{	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   324
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   325
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   326
		iGc->DrawPie(aRect, aStart, aEnd);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   327
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   328
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   329
15
1bd1043e4812 COnfigure NVGRenderStage in wsini.ini, and tweak some comments
William Roberts <williamr@symbian.org>
parents: 14
diff changeset
   330
/** If the passed bitmap is an extended bitmap of type 0x39b9273e, draw it to the 
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   331
stored graphics context of the next render stage using DrawExtendedBitmap(), if the
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   332
passed bitmap is not an extended bitmap just pass it on to the next render stage directly.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   333
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   334
@see CFbsBitGc::DrawBitmap(const TRect&, const CFbsBitmap&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   335
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   336
void CNvgRenderStage::DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aSourceBitmap)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   337
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   338
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   339
		{	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   340
		CFbsBitmap* sourceBitmap = const_cast<CFbsBitmap*>(&aSourceBitmap);		
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   341
		
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   342
		if (aSourceBitmap.ExtendedBitmapType() == KUidNvgExtendedBitmap)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   343
			{
20
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   344
			sourceBitmap = GetConvertedBitmap(aSourceBitmap);
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   345
			}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   346
				
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   347
		iGc->DrawBitmap(aDestRect, *sourceBitmap);	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   348
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   349
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   350
15
1bd1043e4812 COnfigure NVGRenderStage in wsini.ini, and tweak some comments
William Roberts <williamr@symbian.org>
parents: 14
diff changeset
   351
/** If the passed bitmap is an extended bitmap of type 0x39b9273e, draw it to the 
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   352
stored graphics context of the next render stage using DrawExtendedBitmap(), if the
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   353
passed bitmap is not an extended bitmap just pass it on to the next render stage directly.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   354
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   355
@see CFbsBitGc::DrawBitmap(const TRect&, const CFbsBitmap&, const TRect&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   356
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   357
void CNvgRenderStage::DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   358
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   359
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   360
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   361
		CFbsBitmap* sourceBitmap = const_cast<CFbsBitmap*>(&aSourceBitmap);		
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   362
		
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   363
		if (aSourceBitmap.ExtendedBitmapType() == KUidNvgExtendedBitmap)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   364
			{
20
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   365
			sourceBitmap = GetConvertedBitmap(aSourceBitmap);
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   366
			}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   367
				
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   368
		iGc->DrawBitmap(aDestRect, *sourceBitmap, aSourceRect);		
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   369
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   370
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   371
15
1bd1043e4812 COnfigure NVGRenderStage in wsini.ini, and tweak some comments
William Roberts <williamr@symbian.org>
parents: 14
diff changeset
   372
/** If the passed bitmap or mask bitmap is an extended bitmap of type 0x39b9273e
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   373
convert it to a normal bitmap before calling DrawBitmapMasked(), normal bitmaps
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   374
are passed straight through to the next render stage without conversion.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   375
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   376
@see CFbsBitGc::DrawBitmapMasked(const TRect&, const CFbsBitmap&, const TRect&, const CFbsBitmap&, TBool)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   377
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   378
void CNvgRenderStage::DrawBitmapMasked(const TRect& aDestRect, const CFbsBitmap& aSourceBitmap,const TRect& aSourceRect, const CFbsBitmap& aMaskBitmap, TBool aInvertMask)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   379
	{	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   380
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   381
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   382
		CFbsBitmap* sourceBitmap = const_cast<CFbsBitmap*>(&aSourceBitmap);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   383
		CFbsBitmap* maskBitmap = const_cast<CFbsBitmap*>(&aMaskBitmap);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   384
		
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   385
		if (aSourceBitmap.ExtendedBitmapType() == KUidNvgExtendedBitmap)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   386
			{
20
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   387
			sourceBitmap = GetConvertedBitmap(aSourceBitmap);
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   388
			}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   389
		if (aMaskBitmap.ExtendedBitmapType() == KUidNvgExtendedBitmap)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   390
			{
20
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   391
			maskBitmap = GetConvertedBitmap(aMaskBitmap);
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   392
			}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   393
	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   394
		iGc->DrawBitmapMasked(aDestRect, *sourceBitmap, aSourceRect, *maskBitmap, aInvertMask);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   395
		}	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   396
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   397
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   398
/** @see CFbsBitGc::DrawRoundRect(const TRect&, const TSize&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   399
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   400
void CNvgRenderStage::DrawRoundRect(const TRect& aRect, const TSize& aEllipse)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   401
	{	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   402
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   403
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   404
		iGc->DrawRoundRect(aRect, aEllipse);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   405
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   406
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   407
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   408
/** @see CFbsBitGc::DrawPolyLine(const TArray<TPoint>&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   409
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   410
void CNvgRenderStage::DrawPolyLine(const TArray<TPoint>& aPointList) 
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   411
	{	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   412
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   413
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   414
		iGc->DrawPolyLine(aPointList);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   415
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   416
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   417
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   418
/** @see CFbsBitGc::DrawPolyLineNoEndPoint(const TArray<TPoint>&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   419
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   420
void CNvgRenderStage::DrawPolyLineNoEndPoint(const TArray<TPoint>& aPointList)  
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   421
	{	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   422
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   423
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   424
		iGc->DrawPolyLineNoEndPoint(aPointList);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   425
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   426
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   427
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   428
/** @see CFbsBitGc::DrawPolygon(const TArray<TPoint>&, TFillRule)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   429
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   430
void CNvgRenderStage::DrawPolygon(const TArray<TPoint>& aPointList, TFillRule aFillRule)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   431
	{	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   432
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   433
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   434
		iGc->DrawPolygon(aPointList, aFillRule);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   435
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   436
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   437
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   438
/** @see CFbsBitGc::DrawEllipse(const TRect&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   439
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   440
void CNvgRenderStage::DrawEllipse(const TRect& aRect)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   441
	{	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   442
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   443
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   444
		iGc->DrawEllipse(aRect);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   445
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   446
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   447
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   448
/** @see CFbsBitGc::DrawLine(const TPoint&, const TPoint&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   449
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   450
void CNvgRenderStage::DrawLine(const TPoint& aStart, const TPoint& aEnd)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   451
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   452
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   453
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   454
		iGc->DrawLine(aStart, aEnd);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   455
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   456
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   457
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   458
/** @see CFbsBitGc::DrawLineTo(const TPoint&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   459
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   460
void CNvgRenderStage::DrawLineTo(const TPoint& aPoint)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   461
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   462
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   463
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   464
		iGc->DrawLineTo(aPoint);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   465
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   466
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   467
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   468
/** @see CFbsBitGc::DrawLineBy(const TPoint&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   469
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   470
void CNvgRenderStage::DrawLineBy(const TPoint& aVector)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   471
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   472
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   473
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   474
		iGc->DrawLineBy(aVector);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   475
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   476
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   477
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   478
/** @see CFbsBitGc::DrawRect(const TRect&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   479
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   480
void CNvgRenderStage::DrawRect(const TRect& aRect)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   481
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   482
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   483
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   484
		iGc->DrawRect(aRect);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   485
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   486
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   487
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   488
/** @see CFbsBitGc::DrawText(const TDesC& aText, const TTextParameters*)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   489
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   490
void CNvgRenderStage::DrawText(const TDesC& aText, const TTextParameters* aParam)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   491
	{	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   492
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   493
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   494
		iGc->DrawText(aText, aParam);	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   495
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   496
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   497
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   498
/** @see CFbsBitGc::DrawText(const TDesC& aText, const TTextParameters*, const TPoint&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   499
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   500
void CNvgRenderStage::DrawText(const TDesC& aText, const TTextParameters* aParam, const TPoint& aPosition)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   501
	{	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   502
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   503
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   504
		iGc->DrawText(aText, aParam, aPosition);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   505
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   506
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   507
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   508
/** @see CFbsBitGc::DrawText(const TDesC& aText, const TTextParameters*, const TRect&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   509
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   510
void CNvgRenderStage::DrawText(const TDesC& aText, const TTextParameters* aParam, const TRect& aClipRect)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   511
	{	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   512
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   513
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   514
		iGc->DrawText(aText, aParam, aClipRect);	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   515
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   516
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   517
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   518
/** @see CFbsBitGc::DrawText(const TDesC& aText, const TTextParameters*, const TRect&, TInt, TTextAlign, TInt)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   519
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   520
void CNvgRenderStage::DrawText(const TDesC& aText, const TTextParameters* aParam, const TRect& aClipFillRect, TInt aBaselineOffset, TTextAlign aHrz, TInt aMargin)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   521
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   522
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   523
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   524
		iGc->DrawText(aText, aParam, aClipFillRect, aBaselineOffset, aHrz, aMargin);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   525
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   526
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   527
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   528
/** @see CFbsBitGc::DrawTextVertical(const TDesC&, const TTextParameters*, TBool)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   529
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   530
void CNvgRenderStage::DrawTextVertical(const TDesC& aText, const TTextParameters* aParam, TBool aUp)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   531
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   532
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   533
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   534
		iGc->DrawTextVertical(aText, aParam, aUp);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   535
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   536
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   537
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   538
/** @see CFbsBitGc::DrawTextVertical(const TDesC&, const TTextParameters*, const TPoint&, TBool)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   539
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   540
void CNvgRenderStage::DrawTextVertical(const TDesC& aText, const TTextParameters* aParam, const TPoint& aPosition, TBool aUp)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   541
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   542
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   543
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   544
		iGc->DrawTextVertical(aText, aParam, aPosition, aUp);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   545
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   546
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   547
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   548
/** @see CFbsBitGc::DrawTextVertical(const TDesC&, const TTextParameters*, const TRect&, TBool)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   549
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   550
void CNvgRenderStage::DrawTextVertical(const TDesC& aText, const TTextParameters* aParam, const TRect& aClipRect, TBool aUp)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   551
	{	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   552
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   553
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   554
		iGc->DrawTextVertical(aText, aParam, aClipRect, aUp);		
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   555
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   556
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   557
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   558
/** @see CFbsBitGc::DrawTextVertical(const TDesC&, const TTextParameters*, const TRect&, TInt aBaselineOffset, TBool, TTextAlign, TInt)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   559
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   560
void CNvgRenderStage::DrawTextVertical(const TDesC& aText, const TTextParameters* aParam, const TRect& aClipRect, TInt aBaselineOffset, TBool aUp, TTextAlign aVert, TInt aMargin)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   561
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   562
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   563
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   564
		iGc->DrawTextVertical(aText, aParam, aClipRect, aBaselineOffset, aUp, aVert, aMargin);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   565
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   566
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   567
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   568
/** @see CFbsBitGc::DrawTextVertical(const TDesC&, const TTextParameters*, const TRect&, TInt, TInt, TBool, TTextAlign, TInt)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   569
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   570
void CNvgRenderStage::DrawTextVertical(const TDesC& aText, const TTextParameters* aParam, const TRect& aClipRect, TInt aBaselineOffset, TInt aTextWidth, TBool aUp, TTextAlign aVert, TInt aMargin)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   571
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   572
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   573
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   574
		iGc->DrawTextVertical(aText, aParam, aClipRect, aBaselineOffset, aTextWidth, aUp, aVert, aMargin);	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   575
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   576
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   577
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   578
/** @see CFbsBitGc::MoveTo(const TPoint&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   579
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   580
void CNvgRenderStage::MoveTo(const TPoint& aPoint)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   581
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   582
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   583
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   584
		iGc->MoveTo(aPoint);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   585
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   586
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   587
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   588
/** @see CFbsBitGc::MoveBy(const TPoint&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   589
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   590
void CNvgRenderStage::MoveBy(const TPoint& aVector)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   591
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   592
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   593
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   594
		iGc->MoveBy(aVector);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   595
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   596
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   597
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   598
/** @see CFbsBitGc::Plot(const TPoint&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   599
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   600
void CNvgRenderStage::Plot(const TPoint& aPoint)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   601
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   602
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   603
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   604
		iGc->Plot(aPoint);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   605
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   606
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   607
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   608
/** @see CFbsBitGc::Reset()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   609
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   610
void CNvgRenderStage::Reset()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   611
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   612
	iExtendedBitmapError = KErrNone;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   613
	iOrigin.SetXY(0,0);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   614
	iBrushStyle = MWsGraphicsContext::ENullBrush;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   615
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   616
		{	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   617
		iGc->Reset();
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   618
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   619
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   620
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   621
/** @see CFbsBitGc::SetBrushColor(const TRgb&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   622
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   623
void CNvgRenderStage::SetBrushColor(const TRgb& aColor)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   624
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   625
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   626
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   627
		iGc->SetBrushColor(aColor);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   628
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   629
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   630
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   631
/** @see CFbsBitGc::SetBrushOrigin(const TPoint&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   632
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   633
void CNvgRenderStage::SetBrushOrigin(const TPoint& aOrigin)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   634
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   635
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   636
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   637
		iGc->SetBrushOrigin(aOrigin);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   638
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   639
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   640
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   641
/** @see CFbsBitGc::SetBrushStyle(TBrushStyle)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   642
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   643
void CNvgRenderStage::SetBrushStyle(TBrushStyle aBrushStyle)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   644
	{	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   645
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   646
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   647
		iGc->SetBrushStyle(aBrushStyle);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   648
		iBrushStyle = aBrushStyle;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   649
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   650
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   651
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   652
/** @see CFbsBitGc::SetClippingRegion(const TRegion&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   653
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   654
void CNvgRenderStage::SetClippingRegion(const TRegion& aRegion)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   655
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   656
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   657
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   658
		iGc->SetClippingRegion(aRegion);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   659
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   660
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   661
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   662
/** @see CFbsBitGc::SetDrawMode(TDrawMode)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   663
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   664
void CNvgRenderStage::SetDrawMode(TDrawMode aDrawMode)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   665
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   666
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   667
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   668
		iGc->SetDrawMode(aDrawMode);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   669
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   670
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   671
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   672
/** @see CFbsBitGc::SetOrigin(const TPoint&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   673
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   674
void CNvgRenderStage::SetOrigin(const TPoint& aPoint)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   675
	{	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   676
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   677
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   678
		iGc->SetOrigin(aPoint);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   679
		iOrigin = aPoint;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   680
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   681
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   682
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   683
/** @see CFbsBitGc::SetPenColor(const TRgb&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   684
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   685
void CNvgRenderStage::SetPenColor(const TRgb& aColor)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   686
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   687
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   688
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   689
		iGc->SetPenColor(aColor);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   690
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   691
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   692
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   693
/** @see CFbsBitGc::SetPenStyle(TPenStyle)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   694
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   695
void CNvgRenderStage::SetPenStyle(TPenStyle aPenStyle)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   696
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   697
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   698
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   699
		iGc->SetPenStyle(aPenStyle);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   700
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   701
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   702
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   703
/** @see CFbsBitGc::SetPenSize(const TSize&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   704
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   705
void CNvgRenderStage::SetPenSize(const TSize& aSize)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   706
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   707
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   708
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   709
		iGc->SetPenSize(aSize);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   710
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   711
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   712
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   713
/** @see CFbsBitGc::SetTextShadowColor(const TRgb&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   714
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   715
void CNvgRenderStage::SetTextShadowColor(const TRgb& aColor)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   716
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   717
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   718
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   719
		iGc->SetTextShadowColor(aColor);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   720
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   721
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   722
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   723
/** @see CFbsBitGc::SetCharJustification(TInt, TInt)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   724
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   725
void CNvgRenderStage::SetCharJustification(TInt aExcessWidth, TInt aNumChars)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   726
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   727
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   728
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   729
		iGc->SetCharJustification(aExcessWidth, aNumChars);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   730
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   731
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   732
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   733
/** @see CFbsBitGc::SetWordJustification(TInt, TInt)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   734
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   735
void CNvgRenderStage::SetWordJustification(TInt aExcessWidth, TInt aNumGaps)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   736
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   737
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   738
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   739
		iGc->SetWordJustification(aExcessWidth, aNumGaps);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   740
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   741
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   742
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   743
/** @see CFbsBitGc::SetUnderlineStyle(TFontUnderline)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   744
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   745
void CNvgRenderStage::SetUnderlineStyle(TFontUnderline aUnderlineStyle)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   746
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   747
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   748
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   749
		iGc->SetUnderlineStyle(aUnderlineStyle);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   750
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   751
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   752
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   753
/** @see CFbsBitGc::SetStrikethroughStyle(TFontStrikethrough)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   754
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   755
void CNvgRenderStage::SetStrikethroughStyle(TFontStrikethrough aStrikethroughStyle)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   756
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   757
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   758
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   759
		iGc->SetStrikethroughStyle(aStrikethroughStyle);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   760
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   761
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   762
15
1bd1043e4812 COnfigure NVGRenderStage in wsini.ini, and tweak some comments
William Roberts <williamr@symbian.org>
parents: 14
diff changeset
   763
/** If the passed bitmap is an extended bitmap of type 0x39b9273e
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   764
convert the extended bitmap to a normal bitmap and set the converted bitmap
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   765
as the current brush pattern. If the passed bitmap is a normal
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   766
bitmap just pass it on to the next render stage.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   767
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   768
@see SetBrushPattern(TInt)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   769
@see CFbsBitGc::SetBrushPattern(const CFbsBitmap&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   770
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   771
void CNvgRenderStage::SetBrushPattern(const CFbsBitmap& aBitmap)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   772
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   773
	SetBrushPattern(aBitmap.Handle());	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   774
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   775
15
1bd1043e4812 COnfigure NVGRenderStage in wsini.ini, and tweak some comments
William Roberts <williamr@symbian.org>
parents: 14
diff changeset
   776
/** If the passed bitmap handle refers to an extended bitmap of type 0x39b9273e
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   777
convert the extended bitmap to a normal bitmap and set the converted bitmap
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   778
as the current brush pattern. If the passed bitmap handle refers to a normal
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   779
bitmap just pass it on to the next render stage.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   780
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   781
@see SetBrushPattern(const CFbsBitmap&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   782
@see CFbsBitGc::SetBrushPattern(TInt)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   783
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   784
void CNvgRenderStage::SetBrushPattern(TInt aFbsBitmapHandle)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   785
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   786
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   787
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   788
		iBrushPattern->Duplicate(aFbsBitmapHandle);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   789
		if (iBrushPattern->ExtendedBitmapType() == KUidNvgExtendedBitmap)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   790
			{
20
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   791
			iInternalBrushPattern = GetConvertedBitmap(*iBrushPattern);
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   792
			iGc->SetBrushPattern(*iInternalBrushPattern);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   793
			}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   794
		else
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   795
			{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   796
			iGc->SetBrushPattern(aFbsBitmapHandle);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   797
			}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   798
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   799
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   800
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   801
/** @see CFbsBitGc::SetFont(const CFont*)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   802
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   803
void CNvgRenderStage::SetFont(const CFont* aFont)	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   804
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   805
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   806
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   807
		iGc->SetFont(aFont);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   808
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   809
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   810
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   811
/** @see CFbsBitGc::CopyRect(const TPoint&, const TRect&)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   812
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   813
void CNvgRenderStage::CopyRect(const TPoint& aOffset, const TRect& aRect)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   814
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   815
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   816
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   817
		iGc->CopyRect(aOffset, aRect);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   818
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   819
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   820
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   821
/** @see CFbsBitGc::UpdateJustification(const TDesC&, const TTextParameters*)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   822
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   823
void CNvgRenderStage::UpdateJustification(const TDesC& aText, const TTextParameters* aParam)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   824
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   825
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   826
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   827
		iGc->UpdateJustification(aText, aParam);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   828
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   829
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   830
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   831
/** @see CFbsBitGc::UpdateJustificationVertical(const TDesC&, const TTextParameters*, TBool)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   832
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   833
void CNvgRenderStage::UpdateJustificationVertical(const TDesC& aText, const TTextParameters* aParam, TBool aUp)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   834
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   835
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   836
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   837
		iGc->UpdateJustificationVertical(aText, aParam, aUp);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   838
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   839
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   840
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   841
/** @see CFbsBitGc::SetFontNoDuplicate(const CFont*)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   842
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   843
void CNvgRenderStage::SetFontNoDuplicate(const CFont* aFont)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   844
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   845
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   846
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   847
		iGc->SetFontNoDuplicate(aFont);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   848
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   849
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   850
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   851
/** @see CFbsBitGc::HasBrushPattern()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   852
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   853
TBool CNvgRenderStage::HasBrushPattern() const
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   854
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   855
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   856
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   857
		return iGc->HasBrushPattern();
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   858
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   859
	else
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   860
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   861
		return EFalse;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   862
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   863
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   864
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   865
/** @see CFbsBitGc::HasFont()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   866
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   867
TBool CNvgRenderStage::HasFont() const
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   868
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   869
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   870
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   871
		return iGc->HasFont();
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   872
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   873
	else
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   874
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   875
		return EFalse;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   876
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   877
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   878
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   879
/** @see CFbsBitGc::BrushColor()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   880
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   881
TRgb CNvgRenderStage::BrushColor() const
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   882
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   883
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   884
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   885
		return iGc->BrushColor();
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   886
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   887
	else
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   888
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   889
		return KRgbWhite;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   890
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   891
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   892
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   893
/** @see CFbsBitGc::PenColor()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   894
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   895
TRgb CNvgRenderStage::PenColor() const
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   896
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   897
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   898
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   899
		return iGc->PenColor();
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   900
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   901
	else
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   902
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   903
		return KRgbBlack;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   904
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   905
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   906
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   907
/** @see MWsGraphicsContext::TextShadowColor()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   908
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   909
TRgb CNvgRenderStage::TextShadowColor() const	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   910
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   911
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   912
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   913
		return iGc->TextShadowColor();
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   914
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   915
	else
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   916
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   917
		return KRgbGray;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   918
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   919
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   920
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   921
/** If an error has been set by this render stage return that error,
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   922
otherwise return the error from the graphics context of the next
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   923
render stage.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   924
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   925
@see MWsGraphicsContext::GetError()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   926
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   927
TInt CNvgRenderStage::GetError()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   928
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   929
	if (iExtendedBitmapError != KErrNone)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   930
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   931
		return iExtendedBitmapError;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   932
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   933
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   934
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   935
		return iGc->GetError();
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   936
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   937
	return KErrNone;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   938
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   939
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   940
/** @see MWsGraphicsContext::Origin()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   941
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   942
TPoint CNvgRenderStage::Origin() const	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   943
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   944
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   945
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   946
		return iGc->Origin();
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   947
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   948
	else
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   949
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   950
		return TPoint(0,0);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   951
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   952
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   953
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   954
/** @see MWsGraphicsContext::ClippingRegion()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   955
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   956
const TRegion& CNvgRenderStage::ClippingRegion()	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   957
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   958
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   959
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   960
		return iGc->ClippingRegion();
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   961
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   962
	else
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   963
		{		
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   964
		return iEmptyRegion;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   965
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   966
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   967
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   968
/** @see MWsGraphicsContext::Push()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   969
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   970
TInt CNvgRenderStage::Push()	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   971
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   972
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   973
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   974
		return iGc->Push();
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   975
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   976
	else
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   977
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   978
		return KErrGeneral;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   979
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   980
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   981
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   982
/** @see MWsGraphicsContext::Pop()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   983
 */
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   984
void CNvgRenderStage::Pop()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   985
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   986
	if (iGc)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   987
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   988
		iGc->Pop();
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   989
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   990
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   991
20
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   992
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   993
/** Helper method that draws an NVG extended bitmap into a normal bitmap. 
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   994
20
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   995
@param aExtendedBitmapSrc The extended bitmap to draw 
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   996
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   997
@pre aExtendedBitmapSrc must be an extended bitmap of extended bitmap type 0x39b9273e
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
   998
 */
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
   999
20
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1000
CFbsBitmap* CNvgRenderStage::GetConvertedBitmap(const CFbsBitmap& aExtendedBitmapSrc)
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1001
  {
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1002
  aExtendedBitmapSrc.BeginDataAccess();
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1003
  const TUint8* bmpData = (const TUint8*)aExtendedBitmapSrc.DataAddress();
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1004
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1005
  TPtr8 IconHeaderPtr((TUint8*)bmpData, KIconHeaderLength, KIconHeaderLength);
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1006
  TAknIconHeader iconheader(IconHeaderPtr);
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1007
20
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1008
  TUint32 bitmapid = iconheader.GetBitmapId();
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1009
  TUint32 handle = aExtendedBitmapSrc.Handle();
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1010
  aExtendedBitmapSrc.EndDataAccess();
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1011
  CFbsBitmap* error = const_cast<CFbsBitmap*>(&aExtendedBitmapSrc);  // not renderable, but better than panic!
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1012
  
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1013
  // look to see if we have this in the cache
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1014
  iCacheIterator.SetToFirst();
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1015
  TCachedConversion* cached = iCacheIterator++;
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1016
  while (cached != NULL)
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1017
    {
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1018
    if (cached->iBitmapID == bitmapid && cached->iDiscriminator == handle)
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1019
      {
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1020
      // Cache hit
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1021
#ifdef DEBUG_NVG_RENDERSTAGE
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1022
      RDebug::Printf("NVG Render cache hit for id %08x, handle %d\n", bitmapid, handle);
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1023
#endif
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1024
      cached->Deque();
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1025
      iCache.AddFirst(*cached);  // move to front of the list, to record use
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1026
      return cached->iCachedResult;  
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1027
      }
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1028
    cached = iCacheIterator++;
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1029
    }
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1030
  
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1031
  // missed in the cache, need to perform the conversion
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1032
  TInt err = KErrNone;
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1033
  if (iCacheFree > 0)
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1034
    {
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1035
    // just allocate a new entry, which will be added to the end
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1036
    TRAP(err, cached = new(ELeave) TCachedConversion);
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1037
    if (err != KErrNone)
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1038
      {
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1039
      return error;
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1040
      }
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1041
    TRAP(err, cached->iCachedResult = new(ELeave) CFbsBitmap);
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1042
    if (err != KErrNone)
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1043
      {
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1044
      delete cached;
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1045
      return error;
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1046
      }
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1047
    }
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1048
  else
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1049
    {
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1050
    // Remove the least recently used item
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1051
    cached = iCache.Last();
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1052
    cached->Deque();  // remove from the cache
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1053
    iCacheFree++;
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1054
#ifdef DEBUG_NVG_RENDERSTAGE
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1055
    RDebug::Printf("NVG Render cache removing id %08x, handle %d\n", cached->iBitmapID, cached->iDiscriminator);
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1056
#endif
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1057
    }
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1058
  
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1059
  // cached is now available to hold the new result
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1060
  cached->iBitmapID = bitmapid;
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1061
  cached->iDiscriminator = handle;
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1062
20
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1063
  CopyExtendedBitmapToNormalBitmap(aExtendedBitmapSrc, *cached->iCachedResult);
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1064
  if (iExtendedBitmapError != KErrNone)
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1065
    {
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1066
    delete cached;
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1067
    return error;
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1068
    }
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1069
  
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1070
  // Newly cached bitmap is valid
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1071
  iCache.AddFirst(*cached);
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1072
  iCacheFree--;
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1073
#ifdef DEBUG_NVG_RENDERSTAGE
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1074
  RDebug::Printf("NVG Render cache added id %08x, handle %d (%d free)\n", bitmapid, handle, iCacheFree);
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1075
#endif
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1076
  return cached->iCachedResult;
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1077
  }
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1078
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1079
/** Helper method that draws an NVG extended bitmap into a normal bitmap. The normal
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1080
bitmap passed is resized before the extended bitmap is drawn into it.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1081
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1082
@param aExtendedBitmapSrc The extended bitmap to draw in to the normal bitmap aBitmapDest
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1083
@param aBitmapDest The normal bitmap that the extended bitmap is to be drawn into
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1084
15
1bd1043e4812 COnfigure NVGRenderStage in wsini.ini, and tweak some comments
William Roberts <williamr@symbian.org>
parents: 14
diff changeset
  1085
@pre aExtendedBitmapSrc must be an extended bitmap of extended bitmap type 0x39b9273e
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1086
@post aBitmapDest has been reset and resized and now contains a representation of the aExtendedBitmapSrc
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1087
 */
20
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1088
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1089
void CNvgRenderStage::CopyExtendedBitmapToNormalBitmap(const CFbsBitmap& aExtendedBitmapSrc, CFbsBitmap& aBitmapDst)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1090
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1091
	TSize size = aExtendedBitmapSrc.SizeInPixels();
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1092
	TInt err = aBitmapDst.Create(size, aExtendedBitmapSrc.DisplayMode());
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1093
	if (err != KErrNone)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1094
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1095
		iExtendedBitmapError = err;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1096
		return;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1097
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1098
	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1099
	TRAP(err, iGraphicsInterface->InitializeL(size));
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1100
	if (err != KErrNone)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1101
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1102
		iExtendedBitmapError = err;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1103
		return;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1104
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1105
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1106
	// Clear to White before doing anything else
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1107
  VGfloat color[4] = { 1.0f, 1.0f, 1.0f, 0.0f };
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1108
  vgSeti(VG_SCISSORING, VG_FALSE);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1109
  vgSetfv(VG_CLEAR_COLOR, 4, color);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1110
  vgClear(0, 0, size.iWidth, size.iHeight);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1111
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1112
  aExtendedBitmapSrc.BeginDataAccess();
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1113
  const TUint8* bmpData = (const TUint8*)aExtendedBitmapSrc.DataAddress();
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1114
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1115
  TPtr8 IconHeaderPtr((TUint8*)bmpData, KIconHeaderLength, KIconHeaderLength);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1116
  TAknIconHeader iconheader(IconHeaderPtr);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1117
20
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1118
#ifdef DEBUG_NVG_RENDERSTAGE
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1119
  RDebug::Printf("ConvertExtendedBitmap: id=%08x size (%d x %d)\n", iconheader.GetBitmapId(), size.iWidth, size.iHeight);
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1120
#endif
f6fd4830a02c Add LRU cache of rendered bitmaps, to improve redraw performance in the absence of graphics HW support for OpenVG
William Roberts <williamr@symbian.org>
parents: 15
diff changeset
  1121
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1122
  TInt dataSize = aExtendedBitmapSrc.DataSize();
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1123
  // skip TNVGIconHeader structure - we only know about version 0
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1124
  if (bmpData[2] == 0)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1125
    {
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1126
    TInt headerlength = bmpData[3];   // should be KIconHeaderLength
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1127
    bmpData += headerlength;    
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1128
    dataSize -=  headerlength;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1129
    }
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1130
  TPtrC8 nvgData(bmpData,dataSize);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1131
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1132
    TInt rotAngle = iconheader.GetRotation();
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1133
    // setting the rotation angle
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1134
    iNvgEngine->Rotate(-rotAngle, size.iWidth >> 1, size.iHeight >>1);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1135
    
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1136
    //setting preserve aspect ratio
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1137
    TNvgAlignStatusType alignTypeValue = ENvgPreserveAspectRatio_XmidYmid;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1138
    TNvgMeetOrSliceType meetOrSliceTypeValue = ENvgMeet;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1139
    
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1140
    switch ( iconheader.GetScaleMode() )
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1141
        {
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1142
        case EAspectRatioPreserved: // fall through
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1143
            {
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1144
            // use default
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1145
            break;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1146
            }
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1147
            // Ensures NVG content fully covers the area of the icon whilst preserving aspect ratio.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1148
        case EAspectRatioPreservedSlice:
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1149
            {
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1150
            // alignTypeValue use default
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1151
            meetOrSliceTypeValue = ENvgSlice;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1152
            break;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1153
            } 
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1154
            /* EAspectRatioPreservedAndUnusedSpaceRemoved is mapped to the same values as EAspectRatioNotPreserved
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1155
             * because we already have a frame buffer with the dimensions that preserves the aspect ratio.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1156
             * This mapping ensures that NVG engine does not calculate aspect ratio twice and potentially resulting in precision loss.*/
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1157
        case EAspectRatioPreservedAndUnusedSpaceRemoved:                        
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1158
        case EAspectRatioNotPreserved:
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1159
            {            
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1160
            alignTypeValue = ENvgPreserveAspectRatio_None;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1161
            // meetOrSliceTypeValue use default
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1162
            break;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1163
            }
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1164
        }    
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1165
    iNvgEngine->SetPreserveAspectRatio(alignTypeValue, meetOrSliceTypeValue);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1166
  
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1167
  TInt error = iNvgEngine->DrawNvg(nvgData, aExtendedBitmapSrc.SizeInPixels(), &aBitmapDst, NULL);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1168
  aExtendedBitmapSrc.EndDataAccess(ETrue);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1169
  
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1170
  TRAP(err, iGraphicsInterface->CopyBitmapL(&aBitmapDst, NULL));
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1171
	if (err != KErrNone)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1172
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1173
		iExtendedBitmapError = err;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1174
		return;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1175
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1176
	}