egl/egltest/src/egltestcommonsgimageinfo.cpp
author Faisal Memon <faisal.memon@nokia.com>
Thu, 06 May 2010 18:24:48 +0100
branchNewGraphicsArchitecture
changeset 52 0c41673def7a
parent 0 5d03bc08d59c
permissions -rw-r--r--
Apply patch 6. Cleanup syborg specific variation by allowing the project file to build one specially for it. Fix include macros for test apps. Further tuning how the variant is build appears in later patches. Explicitly including platform_paths seems to make debugging easier for carbide. This might be removed if its bad practice or causes issues.

// Copyright (c) 2007-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:
//

/**
 @file
 @test
*/

#include "egltestcommonsgimageinfo.h"

/* Class TSgImageInfoTest */
EXPORT_C TSgImageInfoTest::TSgImageInfoTest()
	{
	iSizeInPixels = KPixmapSize;
	iPixelFormat = KDefaultSourceFormat;
#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
	iUsage = ESgUsageBitOpenVgImage;
#else
	iUsage = ESgUsageOpenVgImage;
	iShareable = EFalse;
	iCpuAccess = ESgCpuAccessNone;
	iScreenId = KSgScreenIdMain;
	iUserAttributes = NULL;
	iUserAttributeCount = 0;
#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
	}

EXPORT_C TSgImageInfoTest::TSgImageInfoTest(TUidPixelFormat aPixelFormat, TSize aSize)
	{
	iSizeInPixels = aSize;
	iPixelFormat = aPixelFormat;
#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
	iUsage = ESgUsageBitOpenVgSurface;
#else
	iUsage = ESgUsageOpenVgTarget;
	iShareable = EFalse;
	iCpuAccess = ESgCpuAccessNone;
	iScreenId = KSgScreenIdMain;
	iUserAttributes = NULL;
	iUserAttributeCount = 0;
#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
	}

EXPORT_C TSgImageInfoTest::~TSgImageInfoTest()
	{
	}

void TSgImageInfoTest::operator=(const TSgImageInfo& aInfo)
	{
	iSizeInPixels = aInfo.iSizeInPixels;
	iPixelFormat = aInfo.iPixelFormat;
	iUsage = aInfo.iUsage;
#ifndef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
	iShareable = aInfo.iShareable;
	iCpuAccess = aInfo.iCpuAccess;
	iScreenId = aInfo.iScreenId;
	iUserAttributes = aInfo.iUserAttributes;
	iUserAttributeCount = aInfo.iUserAttributeCount;
#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
	}

TBool TSgImageInfoTest::operator==(const TSgImageInfo& aInfo)
	{
	if((iSizeInPixels == aInfo.iSizeInPixels) &&
	   (iPixelFormat == aInfo.iPixelFormat) &&
#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
	   (iUsage == aInfo.iUsage))
#else
		(iUsage == aInfo.iUsage) &&
		(iShareable == aInfo.iShareable) &&
		(iCpuAccess == aInfo.iCpuAccess) &&
		(iScreenId == aInfo.iScreenId) &&
		(iUserAttributes == aInfo.iUserAttributes) &&
		(iUserAttributeCount == aInfo.iUserAttributeCount))
#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
		{
		return ETrue;
		}

	return EFalse;
	}

/* OpenVgImage Child variant */
EXPORT_C TSgImageInfoOpenVgImage::TSgImageInfoOpenVgImage()
	{
#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
	iUsage = ESgUsageBitOpenVgImage;
#else
	iUsage = ESgUsageOpenVgImage;
#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
	}

EXPORT_C TSgImageInfoOpenVgImage::TSgImageInfoOpenVgImage(TUidPixelFormat aPixelFormat, TSize aSize) : TSgImageInfoTest(aPixelFormat, aSize)
	{
#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
	iUsage = ESgUsageBitOpenVgImage;
#else
	iUsage = ESgUsageOpenVgImage;
#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
	}

EXPORT_C TSgImageInfoOpenVgImage::~TSgImageInfoOpenVgImage()
	{
	}

/* OpenVgTarget Child variant */
EXPORT_C TSgImageInfoOpenVgTarget::TSgImageInfoOpenVgTarget()
	{
#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
	iUsage = ESgUsageBitOpenVgSurface;
#else
	iUsage = ESgUsageOpenVgTarget;
#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
	}

EXPORT_C TSgImageInfoOpenVgTarget::TSgImageInfoOpenVgTarget(TUidPixelFormat aPixelFormat, TSize aSize) : TSgImageInfoTest(aPixelFormat, aSize)
	{
#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
	iUsage = ESgUsageBitOpenVgSurface;
#else
	iUsage = ESgUsageOpenVgTarget;
#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
	}

EXPORT_C TSgImageInfoOpenVgTarget::~TSgImageInfoOpenVgTarget()
	{
	}