1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
826 TBool CWsDynamicResWinBase::TestRectL(TRect aRect,TRgb aInnerColor,TInt aOtherInnerColors,TRgb aOuterColor,TInt aOtherOuterColors,TInt aExpectedCornerSize) |
826 TBool CWsDynamicResWinBase::TestRectL(TRect aRect,TRgb aInnerColor,TInt aOtherInnerColors,TRgb aOuterColor,TInt aOtherOuterColors,TInt aExpectedCornerSize) |
827 { |
827 { |
828 if (aRect.iTl.iX<=0 || aRect.iTl.iY<=0) |
828 if (aRect.iTl.iX<=0 || aRect.iTl.iY<=0) |
829 return ETrue; //can't perform the test against the outside of the screen |
829 return ETrue; //can't perform the test against the outside of the screen |
830 //quantise the expectation based on the current mode. |
830 //quantise the expectation based on the current mode. |
831 switch (iScreenDevice->DisplayMode()) |
831 TDisplayMode displayMode=iScreenDevice->DisplayMode(); |
832 { |
832 switch (displayMode) |
|
833 { |
833 case EColor4K: |
834 case EColor4K: |
834 aInnerColor=aInnerColor.Color4K(aInnerColor.Color4K()); |
835 aInnerColor=aInnerColor.Color4K(aInnerColor.Color4K()); |
835 aOuterColor=aOuterColor.Color4K(aOuterColor.Color4K()); |
836 aOuterColor=aOuterColor.Color4K(aOuterColor.Color4K()); |
836 break; |
837 break; |
837 case EColor64K: |
838 case EColor64K: |
838 aInnerColor=aInnerColor.Color64K(aInnerColor.Color64K()); |
839 aInnerColor=aInnerColor.Color64K(aInnerColor.Color64K()); |
839 aOuterColor=aOuterColor.Color64K(aOuterColor.Color64K()); |
840 aOuterColor=aOuterColor.Color64K(aOuterColor.Color64K()); |
840 break; |
841 break; |
841 case EColor16M: |
842 case EColor16M: |
842 case EColor16MU: |
843 case EColor16MU: |
843 case EColor16MA: |
844 case EColor16MA: |
844 case EColor16MAP: |
845 case EColor16MAP: |
845 break; |
846 break; |
846 default: |
847 default: |
847 ASSERT_TRUE(!"Can't quantise color for this display mode!"); |
848 ASSERT_EQUALS(EColor16MA,displayMode); //Can't quantise color for this display mode! |
848 |
849 } |
849 } |
850 |
850 RArray<CountColour> innerColors; |
851 RArray<CountColour> innerColors; |
851 innerColors.AppendL(aInnerColor); |
852 innerColors.AppendL(aInnerColor); |
852 RArray<CountColour> outerColors; |
853 RArray<CountColour> outerColors; |
853 outerColors.AppendL(aOuterColor); |
854 outerColors.AppendL(aOuterColor); |
854 TInt cornerSize=aExpectedCornerSize>=0?aExpectedCornerSize:-aExpectedCornerSize; |
855 TInt cornerSize=aExpectedCornerSize>=0?aExpectedCornerSize:-aExpectedCornerSize; |