os/graphics/graphicsdeviceinterface/screendriver/swins/SCMON1.CPP
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/graphicsdeviceinterface/screendriver/swins/SCMON1.CPP	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,78 @@
     1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#include "SCDRAW.H"
    1.20 +#include "_WININC.H"
    1.21 +
    1.22 +TInt CDrawOneBppScreenBitmap::InitScreen()
    1.23 +	{
    1.24 +	TRect drawRect;
    1.25 +	GetDrawRect(drawRect);
    1.26 +    RWindows* window = ::WindowHandler(iScreenNo);
    1.27 +	window->iDisplayMode = DisplayMode();
    1.28 +	window->iEpocBitmapSize = drawRect.Size();
    1.29 +	window->iEpocBitmapLinePitch = (iScanLineWords*4);
    1.30 +
    1.31 +	return KErrNone;
    1.32 +	}
    1.33 +
    1.34 +void CDrawOneBppScreenBitmap::OrientationsAvailable(TBool aOrientation[4])
    1.35 +	{
    1.36 +	aOrientation[EOrientationNormal] = ETrue;
    1.37 +	aOrientation[EOrientationRotated90] = EFalse;
    1.38 +	aOrientation[EOrientationRotated180] = EFalse;
    1.39 +	aOrientation[EOrientationRotated270] = EFalse;
    1.40 +	}
    1.41 +
    1.42 +void CDrawOneBppScreenBitmap::UpdateRect(const TRect& aRect) const
    1.43 +	{
    1.44 +	ASSERT(aRect.iTl.iX >= 0 && aRect.iTl.iY >= 0);
    1.45 +	ASSERT(aRect.iBr.iX <= iSize.iWidth);
    1.46 +	ASSERT(aRect.iBr.iY <= iSize.iHeight);
    1.47 +
    1.48 +	TInt lx = aRect.iTl.iX & ~0x1f;
    1.49 +	TInt rx = (aRect.iBr.iX + 31) & ~0x1f;
    1.50 +
    1.51 +	TUint32* srcePtr = ScanLine(aRect.iTl.iY) + (lx / 32);
    1.52 +	TUint32* srcePtrLimit = srcePtr + ((rx - lx) / 32);
    1.53 +
    1.54 +	for(TInt row = aRect.iTl.iY; row < aRect.iBr.iY; row++)
    1.55 +		{
    1.56 +		TUint32* tempSrcePtr = srcePtr;
    1.57 +		TUint8* destPixel = WinPixelAddress(lx,row);
    1.58 +
    1.59 +		while (tempSrcePtr < srcePtrLimit)
    1.60 +			{
    1.61 +			TUint32 data = *tempSrcePtr++;
    1.62 +
    1.63 +			Mem::Fill(destPixel,96,0xff);
    1.64 +
    1.65 +			for (TUint32 shift = 1; shift != 0; shift <<= 1)
    1.66 +				{
    1.67 +				if (!(data & shift))
    1.68 +					{
    1.69 +					destPixel[0] = 0;
    1.70 +					destPixel[1] = 0;
    1.71 +					destPixel[2] = 0;
    1.72 +					}
    1.73 +
    1.74 +				destPixel += 3;
    1.75 +				}
    1.76 +			}
    1.77 +		srcePtr += iScanLineWords;
    1.78 +		srcePtrLimit += iScanLineWords;
    1.79 +		}
    1.80 +	}
    1.81 +