sl@0
|
1 |
// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#ifndef __ACCELHARD_H__
|
sl@0
|
17 |
#define __ACCELHARD_H__
|
sl@0
|
18 |
|
sl@0
|
19 |
#include "GraphicsAccelerator.h"
|
sl@0
|
20 |
|
sl@0
|
21 |
/**
|
sl@0
|
22 |
@internalComponent
|
sl@0
|
23 |
*/
|
sl@0
|
24 |
enum TGraphicsAcceleratorPanic
|
sl@0
|
25 |
{
|
sl@0
|
26 |
EGraphicsAcceleratorPanicInvalidOperationBuffer,
|
sl@0
|
27 |
EGraphicsAcceleratorAttemptedDrawOutsideBitmap,
|
sl@0
|
28 |
};
|
sl@0
|
29 |
|
sl@0
|
30 |
/**
|
sl@0
|
31 |
@internalComponent
|
sl@0
|
32 |
*/
|
sl@0
|
33 |
GLREF_C void GraphicsAcceleratorPanic(TGraphicsAcceleratorPanic aPanicCode);
|
sl@0
|
34 |
|
sl@0
|
35 |
/**
|
sl@0
|
36 |
@internalComponent
|
sl@0
|
37 |
*/
|
sl@0
|
38 |
class CHardwareGraphicsAcceleratorBase : public CHardwareGraphicsAccelerator
|
sl@0
|
39 |
{
|
sl@0
|
40 |
protected:
|
sl@0
|
41 |
void ConstructL(RHardwareBitmap aBitmap);
|
sl@0
|
42 |
public:
|
sl@0
|
43 |
// From CGraphicsAccelerator
|
sl@0
|
44 |
virtual const TGraphicsAcceleratorCaps* Capabilities();
|
sl@0
|
45 |
virtual TInt Operation(const TGraphicsOperation& aOperation);
|
sl@0
|
46 |
virtual TInt Operation(const TGraphicsOperation& aOperation,TInt aNumClipRects,TRect* aClipRects);
|
sl@0
|
47 |
virtual TInt Operation(TDes8& aBuffer);
|
sl@0
|
48 |
virtual TInt Operation(TDes8& aBuffer,TInt aNumClipRects,TRect* aClipRects);
|
sl@0
|
49 |
// From CGraphicsAccelerator
|
sl@0
|
50 |
virtual void Reserved_1();
|
sl@0
|
51 |
virtual void Reserved_2();
|
sl@0
|
52 |
virtual void Reserved_3();
|
sl@0
|
53 |
virtual void Reserved_4();
|
sl@0
|
54 |
|
sl@0
|
55 |
protected:
|
sl@0
|
56 |
// Generic pure virtual operations
|
sl@0
|
57 |
virtual void DoFillRect(const TRect& aRect,TUint32 aFillValue) = 0;
|
sl@0
|
58 |
virtual TInt DoFilledRectWithPattern(const TRect& aRect,TGopFillPattern aPattern) = 0;
|
sl@0
|
59 |
virtual void DoInvertRect(const TRect& aRect) = 0;
|
sl@0
|
60 |
virtual TInt DoBitBlt(const TPoint& aDestination,const TAcceleratedBitmapSpec& aSourceBitmapSpec,const TRect& aSourceRect) = 0;
|
sl@0
|
61 |
virtual TInt DoBitBltMasked(const TPoint& aDestination,const TAcceleratedBitmapSpec& aSourceBitmapSpec,const TRect& aSourceRect,const TAcceleratedBitmapSpec& aMaskSpec) = 0;
|
sl@0
|
62 |
virtual void DoFadeRect(const TRect& aRect,const TGopFadeParams aFade) = 0;
|
sl@0
|
63 |
virtual TInt DoBitBltAlphaBitmap(const TPoint& aDestination,const TAcceleratedBitmapSpec& aSourceBitmapSpec,const TRect& aSourceRect,const TAcceleratedBitmapSpec& aAlphaBitmapSpec) = 0;
|
sl@0
|
64 |
virtual TInt DoAlphaBlendTwoBitmaps(const TPoint& aDestination,const TAcceleratedBitmapSpec& aSrceBitmapSpec1,const TAcceleratedBitmapSpec& aSrceBitmapSpec2,const TRect& aSourceRect,const TPoint& aSrcPt2,const TAcceleratedBitmapSpec& aAlphaBitmapSpec,const TPoint& aAlphaPt) = 0;
|
sl@0
|
65 |
virtual TInt DoAlphaBlendOneBitmap(const TPoint& aDestination,const TAcceleratedBitmapSpec& aSrceBitmapSpec,const TRect& aSourceRect,const TAcceleratedBitmapSpec& aAlphaBitmapSpec,const TPoint& aAlphaPt) = 0;
|
sl@0
|
66 |
//
|
sl@0
|
67 |
|
sl@0
|
68 |
// New pure virtual
|
sl@0
|
69 |
virtual TUint32 FillValue(TRgb aColor) = 0; // Return a TUint32 value which has all pixels set to the given color
|
sl@0
|
70 |
virtual void DoUpdateScreen(const TRect& aRect) = 0;
|
sl@0
|
71 |
inline void UpdateScreen(const TRect& aRect);
|
sl@0
|
72 |
protected:
|
sl@0
|
73 |
TGraphicsAcceleratorCaps const* iCaps;
|
sl@0
|
74 |
TAcceleratedBitmapInfo iBitmapInfo;
|
sl@0
|
75 |
TBool iIsScreen;
|
sl@0
|
76 |
};
|
sl@0
|
77 |
|
sl@0
|
78 |
inline void CHardwareGraphicsAcceleratorBase::UpdateScreen(const TRect& aRect)
|
sl@0
|
79 |
{
|
sl@0
|
80 |
if(iIsScreen)
|
sl@0
|
81 |
DoUpdateScreen(aRect);
|
sl@0
|
82 |
}
|
sl@0
|
83 |
|
sl@0
|
84 |
/**
|
sl@0
|
85 |
@internalComponent
|
sl@0
|
86 |
*/
|
sl@0
|
87 |
class CColor256HardwareGraphicsAccelerator : public CHardwareGraphicsAcceleratorBase
|
sl@0
|
88 |
{
|
sl@0
|
89 |
public:
|
sl@0
|
90 |
static CColor256HardwareGraphicsAccelerator* NewL(RHardwareBitmap aBitmap);
|
sl@0
|
91 |
protected:
|
sl@0
|
92 |
void ConstructL(RHardwareBitmap aBitmap);
|
sl@0
|
93 |
// From CHardwareGraphicsAcceleratorBase
|
sl@0
|
94 |
virtual void DoFillRect(const TRect& aRect,TUint32 aFillValue);
|
sl@0
|
95 |
virtual TInt DoFilledRectWithPattern(const TRect& aRect,TGopFillPattern aPattern);
|
sl@0
|
96 |
virtual void DoInvertRect(const TRect& aRect);
|
sl@0
|
97 |
virtual TInt DoBitBlt(const TPoint& aDestination,const TAcceleratedBitmapSpec& aSourceBitmapSpec,const TRect& aSourceRect);
|
sl@0
|
98 |
virtual TInt DoBitBltMasked(const TPoint& aDestination,const TAcceleratedBitmapSpec& aSourceBitmapSpec,const TRect& aSourceRect,const TAcceleratedBitmapSpec& aMaskSpec);
|
sl@0
|
99 |
virtual void DoFadeRect(const TRect& aRect,const TGopFadeParams aFade);
|
sl@0
|
100 |
virtual TInt DoBitBltAlphaBitmap(const TPoint& aDestination,const TAcceleratedBitmapSpec& aSourceBitmapSpec,const TRect& aSourceRect,const TAcceleratedBitmapSpec& aAlphaBitmapSpec);
|
sl@0
|
101 |
virtual TInt DoAlphaBlendTwoBitmaps(const TPoint& aDestination,const TAcceleratedBitmapSpec& aSrceBitmapSpec1,const TAcceleratedBitmapSpec& aSrceBitmapSpec2,const TRect& aSourceRect,const TPoint& aSrcPt2,const TAcceleratedBitmapSpec& aAlphaBitmapSpec,const TPoint& aAlphaPt);
|
sl@0
|
102 |
virtual TInt DoAlphaBlendOneBitmap(const TPoint& aDestination,const TAcceleratedBitmapSpec& aSrceBitmapSpec,const TRect& aSourceRect,const TAcceleratedBitmapSpec& aAlphaBitmapSpec,const TPoint& aAlphaPt);
|
sl@0
|
103 |
virtual TUint32 FillValue(TRgb aColor);
|
sl@0
|
104 |
virtual void DoUpdateScreen(const TRect& aRect);
|
sl@0
|
105 |
private:
|
sl@0
|
106 |
TInt iScreenNo;
|
sl@0
|
107 |
};
|
sl@0
|
108 |
|
sl@0
|
109 |
#endif
|