uigraphics/NVGRenderStage/src/nvgrenderstage.h
author William Roberts <williamr@symbian.org>
Mon, 23 Aug 2010 14:34:16 +0100
changeset 102 556a54d643b8
permissions -rw-r--r--
Add NVGRenderStage and update the *.ini files accordingly
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
102
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
     1
// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
     2
// All rights reserved.
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
     7
//
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
     8
// Initial Contributors:
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    10
//
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    11
// Contributors:
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    12
//
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    13
// Description:
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    14
//
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    15
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    16
#ifndef NVGRENDERSTAGE_H
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    17
#define NVGRENDERSTAGE_H
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    18
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    19
/**
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    20
@file
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    21
@test
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    22
@internalComponent - Internal Symbian test code
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    23
*/
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    24
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    25
#include <graphics/wsrenderstage.h>
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    26
#include <graphics/wsgraphicdrawer.h>
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    27
#include <graphics/wsgraphicscontext.h>
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    28
#include <nvg.h>
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    29
#include "vgigraphicsinterface.h"
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    30
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    31
/** Struct to form a simple LRU cache of conversion results
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    32
 */
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    33
class TCachedConversion
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    34
  {
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    35
public:
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    36
  TCachedConversion();
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    37
  ~TCachedConversion();
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    38
  inline void Deque();
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    39
  
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    40
public:
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    41
  TDblQueLink iLink;
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    42
  TUint32 iBitmapID;
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    43
  TUint32 iDiscriminator;
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    44
  CFbsBitmap* iCachedResult;
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    45
  };
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    46
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    47
void TCachedConversion::Deque() {iLink.Deque();}
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    48
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    49
/** This is a render stage used for processing NVG Icon bitmaps in the absence of
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    50
graphics acceleration hardware. The software implementation of OpenVG is used to
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    51
render the NVG drawing commands onto a normal CFbsBitmap, and a simple LRU cache
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    52
is used to keep the results for faster redrawing.
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    53
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    54
This render stage implements the MWsGraphicsContext interface so that it can intercept
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    55
any drawing commands that draw an extended bitmap, any commands that draw a normal 
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    56
bitmap are just passed through to the next renderstage (along with any commands that
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    57
do not involve bitmaps at all).
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    58
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    59
A CNvgRenderStage object is created by a CNvgRenderStageFactory.
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    60
 */
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    61
class CNvgRenderStage : public CWsRenderStage, public MWsGraphicsContext
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    62
	{
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    63
public:
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    64
	static CNvgRenderStage* NewL(MWsGraphicDrawerEnvironment* aEnv, MWsScreen* aScreen, MWsScreenRedraw* aScreenRedraw, CWsRenderStage* aNextStage);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    65
	virtual ~CNvgRenderStage();
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    66
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    67
public: 
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    68
	// Implementation of CWsRenderStage
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    69
	TAny* ResolveObjectInterface(TUint aTypeId);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    70
	virtual void Begin(const TRegion* aRegion);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    71
	virtual void End(TRequestStatus* aCompositorReady);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    72
	
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    73
public:
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    74
	// Implementation of MWsGraphicsContext
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    75
	void BitBlt(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    76
	void BitBlt(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap,	const TRect& aSourceRect);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    77
	void BitBltMasked(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect, const CFbsBitmap& aMaskBitmap, TBool aInvertMask);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    78
	void BitBltMasked(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect, const CFbsBitmap& aMaskBitmap, const TPoint& aMaskPos);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    79
	void ResetClippingRegion();
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    80
	void Clear();
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    81
	void Clear(const TRect& aRect);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    82
	void ResetBrushPattern();
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    83
	void ResetFont();
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    84
	void DrawArc(const TRect& aRect, const TPoint& aStart, const TPoint& aEnd);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    85
	void DrawPie(const TRect& aRect, const TPoint& aStart, const TPoint& aEnd);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    86
	void DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aSourceBitmap);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    87
	void DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    88
	void DrawBitmapMasked(const TRect& aDestRect, const CFbsBitmap& aSourceBitmap,const TRect& aSourceRect, const CFbsBitmap& aMaskBitmap, TBool aInvertMask);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    89
	void DrawRoundRect(const TRect& aRect, const TSize& aEllipse);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    90
	void DrawPolyLine(const TArray<TPoint>& aPointList); 
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    91
	void DrawPolyLineNoEndPoint(const TArray<TPoint>& aPointList);  
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    92
	void DrawPolygon(const TArray<TPoint>& aPointList, TFillRule aFillRule=EAlternate);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    93
	void DrawEllipse(const TRect& aRect);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    94
	void DrawLine(const TPoint& aStart, const TPoint& aEnd);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    95
	void DrawLineTo(const TPoint& aPoint);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    96
	void DrawLineBy(const TPoint& aVector);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    97
	void DrawRect(const TRect& aRect);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    98
	void DrawText(const TDesC& aText,const TTextParameters* aParam);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
    99
	void DrawText(const TDesC& aText,const TTextParameters* aParam,const TPoint& aPosition);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   100
	void DrawText(const TDesC& aText,const TTextParameters* aParam,const TRect& aClipRect);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   101
	void DrawText(const TDesC& aText,const TTextParameters* aParam,const TRect& aClipFillRect,TInt aBaselineOffset,TTextAlign aHrz=ELeft,TInt aMargin=0);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   102
	void DrawTextVertical(const TDesC& aText,const TTextParameters* aParam,TBool aUp);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   103
	void DrawTextVertical(const TDesC& aText,const TTextParameters* aParam,const TPoint& aPosition,TBool aUp);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   104
	void DrawTextVertical(const TDesC& aText,const TTextParameters* aParam,const TRect& aClipRect,TBool aUp);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   105
	void DrawTextVertical(const TDesC& aText,const TTextParameters* aParam,const TRect& aClipRect,TInt aBaselineOffset,TBool aUp,TTextAlign aVert=ELeft,TInt aMargin=0);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   106
	void DrawTextVertical(const TDesC& aText,const TTextParameters* aParam,const TRect& aClipRect,TInt aBaselineOffset,TInt aTextWidth,TBool aUp,TTextAlign aVert=ELeft,TInt aMargin=0);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   107
	void MoveTo(const TPoint& aPoint);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   108
	void MoveBy(const TPoint& aVector);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   109
	void Plot(const TPoint& aPoint);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   110
	void Reset();
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   111
	void SetBrushColor(const TRgb& aColor);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   112
	void SetBrushOrigin(const TPoint& aOrigin);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   113
	void SetBrushStyle(TBrushStyle aBrushStyle);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   114
	void SetClippingRegion(const TRegion& aRegion);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   115
	void SetDrawMode(TDrawMode aDrawMode);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   116
	void SetOrigin(const TPoint& aPoint = TPoint(0, 0));
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   117
	void SetPenColor(const TRgb& aColor);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   118
	void SetPenStyle(TPenStyle aPenStyle);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   119
	void SetPenSize(const TSize& aSize);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   120
	void SetTextShadowColor(const TRgb& aColor);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   121
	void SetCharJustification(TInt aExcessWidth, TInt aNumChars);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   122
	void SetWordJustification(TInt aExcessWidth, TInt aNumGaps);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   123
	void SetUnderlineStyle(TFontUnderline aUnderlineStyle);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   124
	void SetStrikethroughStyle(TFontStrikethrough aStrikethroughStyle);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   125
	void SetBrushPattern(const CFbsBitmap& aBitmap);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   126
	void SetBrushPattern(TInt aFbsBitmapHandle);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   127
	void SetFont(const CFont* aFont);	
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   128
	void CopyRect(const TPoint& aOffset, const TRect& aRect);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   129
	void UpdateJustification(const TDesC& aText,const TTextParameters* aParam);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   130
	void UpdateJustificationVertical(const TDesC& aText,const TTextParameters* aParam,TBool aUp);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   131
	void SetFontNoDuplicate(const CFont* aFont);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   132
	TBool HasBrushPattern() const;
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   133
	TBool HasFont() const;
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   134
	TRgb BrushColor() const;
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   135
	TRgb PenColor() const;
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   136
	TRgb TextShadowColor() const;	
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   137
	TInt GetError();
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   138
	TPoint Origin() const;	
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   139
	const TRegion& ClippingRegion();	
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   140
	TInt Push();	
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   141
	void Pop();
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   142
	
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   143
private:
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   144
	CNvgRenderStage();
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   145
	void ConstructL(CWsRenderStage* aNextStage);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   146
	
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   147
private:
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   148
	// Helper methods that support the implementation of MWsGraphicsContext
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   149
	CFbsBitmap* GetConvertedBitmap(const CFbsBitmap& aSourceBitmap);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   150
	void CopyExtendedBitmapToNormalBitmap(const CFbsBitmap& aExtendedBitmapSrc, CFbsBitmap& aBitmapDst);
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   151
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   152
private:
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   153
	MWsGraphicsContext* iGc;	
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   154
	TInt iExtendedBitmapError;
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   155
	TPoint iOrigin;
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   156
	RRegion iEmptyRegion;
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   157
	CFbsBitmap* iBrushPattern;
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   158
	CFbsBitmap* iInternalBrushPattern;
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   159
	MWsGraphicsContext::TBrushStyle iBrushStyle;
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   160
	CVGIGraphicsInterface* iGraphicsInterface;
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   161
	CNvgEngine* iNvgEngine;
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   162
	
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   163
	// LRU Cache of rendered bitmaps
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   164
#define MAX_NVG_CACHE_SIZE 128
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   165
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   166
	TDblQue<TCachedConversion> iCache;
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   167
  TDblQueIter<TCachedConversion> iCacheIterator;
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   168
	TUint iCacheFree;
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   169
	};
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   170
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   171
// #define DEBUG_NVG_RENDERSTAGE
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   172
556a54d643b8 Add NVGRenderStage and update the *.ini files accordingly
William Roberts <williamr@symbian.org>
parents:
diff changeset
   173
#endif // NVGRENDERSTAGE_H