os/graphics/egl/egltest/src/egltestcommonsgimageinfo.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/egl/egltest/src/egltestcommonsgimageinfo.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,139 @@
     1.4 +// Copyright (c) 2007-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 +/**
    1.20 + @file
    1.21 + @test
    1.22 +*/
    1.23 +
    1.24 +#include "egltestcommonsgimageinfo.h"
    1.25 +
    1.26 +/* Class TSgImageInfoTest */
    1.27 +EXPORT_C TSgImageInfoTest::TSgImageInfoTest()
    1.28 +	{
    1.29 +	iSizeInPixels = KPixmapSize;
    1.30 +	iPixelFormat = KDefaultSourceFormat;
    1.31 +#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
    1.32 +	iUsage = ESgUsageBitOpenVgImage;
    1.33 +#else
    1.34 +	iUsage = ESgUsageOpenVgImage;
    1.35 +	iShareable = EFalse;
    1.36 +	iCpuAccess = ESgCpuAccessNone;
    1.37 +	iScreenId = KSgScreenIdMain;
    1.38 +	iUserAttributes = NULL;
    1.39 +	iUserAttributeCount = 0;
    1.40 +#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
    1.41 +	}
    1.42 +
    1.43 +EXPORT_C TSgImageInfoTest::TSgImageInfoTest(TUidPixelFormat aPixelFormat, TSize aSize)
    1.44 +	{
    1.45 +	iSizeInPixels = aSize;
    1.46 +	iPixelFormat = aPixelFormat;
    1.47 +#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
    1.48 +	iUsage = ESgUsageBitOpenVgSurface;
    1.49 +#else
    1.50 +	iUsage = ESgUsageOpenVgTarget;
    1.51 +	iShareable = EFalse;
    1.52 +	iCpuAccess = ESgCpuAccessNone;
    1.53 +	iScreenId = KSgScreenIdMain;
    1.54 +	iUserAttributes = NULL;
    1.55 +	iUserAttributeCount = 0;
    1.56 +#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
    1.57 +	}
    1.58 +
    1.59 +EXPORT_C TSgImageInfoTest::~TSgImageInfoTest()
    1.60 +	{
    1.61 +	}
    1.62 +
    1.63 +void TSgImageInfoTest::operator=(const TSgImageInfo& aInfo)
    1.64 +	{
    1.65 +	iSizeInPixels = aInfo.iSizeInPixels;
    1.66 +	iPixelFormat = aInfo.iPixelFormat;
    1.67 +	iUsage = aInfo.iUsage;
    1.68 +#ifndef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
    1.69 +	iShareable = aInfo.iShareable;
    1.70 +	iCpuAccess = aInfo.iCpuAccess;
    1.71 +	iScreenId = aInfo.iScreenId;
    1.72 +	iUserAttributes = aInfo.iUserAttributes;
    1.73 +	iUserAttributeCount = aInfo.iUserAttributeCount;
    1.74 +#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
    1.75 +	}
    1.76 +
    1.77 +TBool TSgImageInfoTest::operator==(const TSgImageInfo& aInfo)
    1.78 +	{
    1.79 +	if((iSizeInPixels == aInfo.iSizeInPixels) &&
    1.80 +	   (iPixelFormat == aInfo.iPixelFormat) &&
    1.81 +#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
    1.82 +	   (iUsage == aInfo.iUsage))
    1.83 +#else
    1.84 +		(iUsage == aInfo.iUsage) &&
    1.85 +		(iShareable == aInfo.iShareable) &&
    1.86 +		(iCpuAccess == aInfo.iCpuAccess) &&
    1.87 +		(iScreenId == aInfo.iScreenId) &&
    1.88 +		(iUserAttributes == aInfo.iUserAttributes) &&
    1.89 +		(iUserAttributeCount == aInfo.iUserAttributeCount))
    1.90 +#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
    1.91 +		{
    1.92 +		return ETrue;
    1.93 +		}
    1.94 +
    1.95 +	return EFalse;
    1.96 +	}
    1.97 +
    1.98 +/* OpenVgImage Child variant */
    1.99 +EXPORT_C TSgImageInfoOpenVgImage::TSgImageInfoOpenVgImage()
   1.100 +	{
   1.101 +#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
   1.102 +	iUsage = ESgUsageBitOpenVgImage;
   1.103 +#else
   1.104 +	iUsage = ESgUsageOpenVgImage;
   1.105 +#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
   1.106 +	}
   1.107 +
   1.108 +EXPORT_C TSgImageInfoOpenVgImage::TSgImageInfoOpenVgImage(TUidPixelFormat aPixelFormat, TSize aSize) : TSgImageInfoTest(aPixelFormat, aSize)
   1.109 +	{
   1.110 +#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
   1.111 +	iUsage = ESgUsageBitOpenVgImage;
   1.112 +#else
   1.113 +	iUsage = ESgUsageOpenVgImage;
   1.114 +#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
   1.115 +	}
   1.116 +
   1.117 +EXPORT_C TSgImageInfoOpenVgImage::~TSgImageInfoOpenVgImage()
   1.118 +	{
   1.119 +	}
   1.120 +
   1.121 +/* OpenVgTarget Child variant */
   1.122 +EXPORT_C TSgImageInfoOpenVgTarget::TSgImageInfoOpenVgTarget()
   1.123 +	{
   1.124 +#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
   1.125 +	iUsage = ESgUsageBitOpenVgSurface;
   1.126 +#else
   1.127 +	iUsage = ESgUsageOpenVgTarget;
   1.128 +#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
   1.129 +	}
   1.130 +
   1.131 +EXPORT_C TSgImageInfoOpenVgTarget::TSgImageInfoOpenVgTarget(TUidPixelFormat aPixelFormat, TSize aSize) : TSgImageInfoTest(aPixelFormat, aSize)
   1.132 +	{
   1.133 +#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
   1.134 +	iUsage = ESgUsageBitOpenVgSurface;
   1.135 +#else
   1.136 +	iUsage = ESgUsageOpenVgTarget;
   1.137 +#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
   1.138 +	}
   1.139 +
   1.140 +EXPORT_C TSgImageInfoOpenVgTarget::~TSgImageInfoOpenVgTarget()
   1.141 +	{
   1.142 +	}