Merge 1. Pull in cpp files in the performance enhanced Khronos RI OVG files which are newly added. I've ignored platform-specific cpp files for linux, macosx, and null operating systems because this local solution has its own platform glue (i.e. facility to target Bitmaps but no full windowing support). I've ignored sfEGLInterface.cpp because this is used as a bridge to go from EGL to Nokia's Platsim which offers an EGL service. That's not relevant to this implementation because this is ARM side code, not Intel side. I just left a comment to sfEGLInterface.cpp in case we need to pick up this later on. The current code compiles on winscw. Prior to this fix, the code works on winscw, and can launch the SVG tiger (tiger.exe). That takes about 20 seconds to render. I hope to always be able to show this icon on each commit, and the plan is for the render time to reduce with this series of submissions. On this commit, the tiger renders ok in 20 seconds.
// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
//
#ifndef __ACCELHARD_H__
#define __ACCELHARD_H__
#include "GraphicsAccelerator.h"
/**
@internalComponent
*/
enum TGraphicsAcceleratorPanic
{
EGraphicsAcceleratorPanicInvalidOperationBuffer,
EGraphicsAcceleratorAttemptedDrawOutsideBitmap,
};
/**
@internalComponent
*/
GLREF_C void GraphicsAcceleratorPanic(TGraphicsAcceleratorPanic aPanicCode);
/**
@internalComponent
*/
class CHardwareGraphicsAcceleratorBase : public CHardwareGraphicsAccelerator
{
protected:
void ConstructL(RHardwareBitmap aBitmap);
public:
// From CGraphicsAccelerator
virtual const TGraphicsAcceleratorCaps* Capabilities();
virtual TInt Operation(const TGraphicsOperation& aOperation);
virtual TInt Operation(const TGraphicsOperation& aOperation,TInt aNumClipRects,TRect* aClipRects);
virtual TInt Operation(TDes8& aBuffer);
virtual TInt Operation(TDes8& aBuffer,TInt aNumClipRects,TRect* aClipRects);
// From CGraphicsAccelerator
virtual void Reserved_1();
virtual void Reserved_2();
virtual void Reserved_3();
virtual void Reserved_4();
protected:
// Generic pure virtual operations
virtual void DoFillRect(const TRect& aRect,TUint32 aFillValue) = 0;
virtual TInt DoFilledRectWithPattern(const TRect& aRect,TGopFillPattern aPattern) = 0;
virtual void DoInvertRect(const TRect& aRect) = 0;
virtual TInt DoBitBlt(const TPoint& aDestination,const TAcceleratedBitmapSpec& aSourceBitmapSpec,const TRect& aSourceRect) = 0;
virtual TInt DoBitBltMasked(const TPoint& aDestination,const TAcceleratedBitmapSpec& aSourceBitmapSpec,const TRect& aSourceRect,const TAcceleratedBitmapSpec& aMaskSpec) = 0;
virtual void DoFadeRect(const TRect& aRect,const TGopFadeParams aFade) = 0;
virtual TInt DoBitBltAlphaBitmap(const TPoint& aDestination,const TAcceleratedBitmapSpec& aSourceBitmapSpec,const TRect& aSourceRect,const TAcceleratedBitmapSpec& aAlphaBitmapSpec) = 0;
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;
virtual TInt DoAlphaBlendOneBitmap(const TPoint& aDestination,const TAcceleratedBitmapSpec& aSrceBitmapSpec,const TRect& aSourceRect,const TAcceleratedBitmapSpec& aAlphaBitmapSpec,const TPoint& aAlphaPt) = 0;
//
// New pure virtual
virtual TUint32 FillValue(TRgb aColor) = 0; // Return a TUint32 value which has all pixels set to the given color
virtual void DoUpdateScreen(const TRect& aRect) = 0;
inline void UpdateScreen(const TRect& aRect);
protected:
TGraphicsAcceleratorCaps const* iCaps;
TAcceleratedBitmapInfo iBitmapInfo;
TBool iIsScreen;
};
inline void CHardwareGraphicsAcceleratorBase::UpdateScreen(const TRect& aRect)
{
if(iIsScreen)
DoUpdateScreen(aRect);
}
/**
@internalComponent
*/
class CColor256HardwareGraphicsAccelerator : public CHardwareGraphicsAcceleratorBase
{
public:
static CColor256HardwareGraphicsAccelerator* NewL(RHardwareBitmap aBitmap);
protected:
void ConstructL(RHardwareBitmap aBitmap);
// From CHardwareGraphicsAcceleratorBase
virtual void DoFillRect(const TRect& aRect,TUint32 aFillValue);
virtual TInt DoFilledRectWithPattern(const TRect& aRect,TGopFillPattern aPattern);
virtual void DoInvertRect(const TRect& aRect);
virtual TInt DoBitBlt(const TPoint& aDestination,const TAcceleratedBitmapSpec& aSourceBitmapSpec,const TRect& aSourceRect);
virtual TInt DoBitBltMasked(const TPoint& aDestination,const TAcceleratedBitmapSpec& aSourceBitmapSpec,const TRect& aSourceRect,const TAcceleratedBitmapSpec& aMaskSpec);
virtual void DoFadeRect(const TRect& aRect,const TGopFadeParams aFade);
virtual TInt DoBitBltAlphaBitmap(const TPoint& aDestination,const TAcceleratedBitmapSpec& aSourceBitmapSpec,const TRect& aSourceRect,const TAcceleratedBitmapSpec& aAlphaBitmapSpec);
virtual TInt DoAlphaBlendTwoBitmaps(const TPoint& aDestination,const TAcceleratedBitmapSpec& aSrceBitmapSpec1,const TAcceleratedBitmapSpec& aSrceBitmapSpec2,const TRect& aSourceRect,const TPoint& aSrcPt2,const TAcceleratedBitmapSpec& aAlphaBitmapSpec,const TPoint& aAlphaPt);
virtual TInt DoAlphaBlendOneBitmap(const TPoint& aDestination,const TAcceleratedBitmapSpec& aSrceBitmapSpec,const TRect& aSourceRect,const TAcceleratedBitmapSpec& aAlphaBitmapSpec,const TPoint& aAlphaPt);
virtual TUint32 FillValue(TRgb aColor);
virtual void DoUpdateScreen(const TRect& aRect);
private:
TInt iScreenNo;
};
#endif