Update contrib.
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // This module implements the class for a 24 bpp unpack color screen.
27 void CDrawUTwentyFourBppScreenBitmap::SetSize(const TSize& aSize)
29 CDrawBitmap::SetSize(aSize);
30 __ASSERT_DEBUG(iSize == aSize, User::Invariant());
31 iLongWidth = iScanLineWords;
34 void CDrawUTwentyFourBppScreenBitmap::SetDisplayMode(CFbsDrawDevice* aDrawDevice)
36 CopyOldSettings(aDrawDevice);
40 TInt CDrawUTwentyFourBppScreenBitmap::HorzTwipsPerThousandPixels() const
42 if (iSize.iWidth == 0)
46 TInt r = HAL::Get(iScreenNo, HAL::EDisplayMode, displayMode);
50 TInt width = displayMode;
51 r = HAL::Get(iScreenNo, HAL::EDisplayXTwips, width);
55 return (width * 1000) / iSize.iWidth;
58 TInt CDrawUTwentyFourBppScreenBitmap::VertTwipsPerThousandPixels() const
60 if (iSize.iHeight == 0)
64 TInt r = HAL::Get(iScreenNo, HAL::EDisplayMode, displayMode);
67 TInt height = displayMode;
68 r = HAL::Get(iScreenNo, HAL::EDisplayYTwips, height);
72 return (height * 1000) / iSize.iHeight;
76 TInt CDrawUTwentyFourBppScreenBitmap::InitScreen()
82 TInt CDrawUTwentyFourBppScreenBitmap::ConstructScreenL(TInt aScreenNo, TAny* aBitmapAddress, TSize aSize)
84 iScreenNo = aScreenNo;
86 TInt ret = HAL::Get(aScreenNo, HALData::EDisplayMode, displayMode);
90 TInt linepitchInBytes = displayMode;
91 ret = HAL::Get(aScreenNo,HALData::EDisplayOffsetBetweenLines,linepitchInBytes);
95 iScanLineWords = linepitchInBytes / 4;
96 ret = CDrawUTwentyFourBppBitmap::Construct(aSize);
100 TInt offsetToFirstPixel = displayMode;
101 ret = HAL::Get(aScreenNo,HALData::EDisplayOffsetToFirstPixel, offsetToFirstPixel);
105 iBits = (TUint32*)((TUint32)aBitmapAddress + offsetToFirstPixel);
111 void CDrawUTwentyFourBppScreenBitmap::OrientationsAvailable(TBool aOrientation[4])
113 aOrientation[EOrientationNormal] = ETrue;
114 aOrientation[EOrientationRotated90] = ETrue;
115 aOrientation[EOrientationRotated180] = ETrue;
116 aOrientation[EOrientationRotated270] = ETrue;
119 TBool CDrawUTwentyFourBppScreenBitmap::SetOrientation(TOrientation aOrientation)
121 iOrientation = aOrientation ;