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