os/graphics/egl/egltest/src/egltestcommonsgimageinfo.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
/**
sl@0
    17
 @file
sl@0
    18
 @test
sl@0
    19
*/
sl@0
    20
sl@0
    21
#include "egltestcommonsgimageinfo.h"
sl@0
    22
sl@0
    23
/* Class TSgImageInfoTest */
sl@0
    24
EXPORT_C TSgImageInfoTest::TSgImageInfoTest()
sl@0
    25
	{
sl@0
    26
	iSizeInPixels = KPixmapSize;
sl@0
    27
	iPixelFormat = KDefaultSourceFormat;
sl@0
    28
#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
sl@0
    29
	iUsage = ESgUsageBitOpenVgImage;
sl@0
    30
#else
sl@0
    31
	iUsage = ESgUsageOpenVgImage;
sl@0
    32
	iShareable = EFalse;
sl@0
    33
	iCpuAccess = ESgCpuAccessNone;
sl@0
    34
	iScreenId = KSgScreenIdMain;
sl@0
    35
	iUserAttributes = NULL;
sl@0
    36
	iUserAttributeCount = 0;
sl@0
    37
#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
sl@0
    38
	}
sl@0
    39
sl@0
    40
EXPORT_C TSgImageInfoTest::TSgImageInfoTest(TUidPixelFormat aPixelFormat, TSize aSize)
sl@0
    41
	{
sl@0
    42
	iSizeInPixels = aSize;
sl@0
    43
	iPixelFormat = aPixelFormat;
sl@0
    44
#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
sl@0
    45
	iUsage = ESgUsageBitOpenVgSurface;
sl@0
    46
#else
sl@0
    47
	iUsage = ESgUsageOpenVgTarget;
sl@0
    48
	iShareable = EFalse;
sl@0
    49
	iCpuAccess = ESgCpuAccessNone;
sl@0
    50
	iScreenId = KSgScreenIdMain;
sl@0
    51
	iUserAttributes = NULL;
sl@0
    52
	iUserAttributeCount = 0;
sl@0
    53
#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
sl@0
    54
	}
sl@0
    55
sl@0
    56
EXPORT_C TSgImageInfoTest::~TSgImageInfoTest()
sl@0
    57
	{
sl@0
    58
	}
sl@0
    59
sl@0
    60
void TSgImageInfoTest::operator=(const TSgImageInfo& aInfo)
sl@0
    61
	{
sl@0
    62
	iSizeInPixels = aInfo.iSizeInPixels;
sl@0
    63
	iPixelFormat = aInfo.iPixelFormat;
sl@0
    64
	iUsage = aInfo.iUsage;
sl@0
    65
#ifndef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
sl@0
    66
	iShareable = aInfo.iShareable;
sl@0
    67
	iCpuAccess = aInfo.iCpuAccess;
sl@0
    68
	iScreenId = aInfo.iScreenId;
sl@0
    69
	iUserAttributes = aInfo.iUserAttributes;
sl@0
    70
	iUserAttributeCount = aInfo.iUserAttributeCount;
sl@0
    71
#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
sl@0
    72
	}
sl@0
    73
sl@0
    74
TBool TSgImageInfoTest::operator==(const TSgImageInfo& aInfo)
sl@0
    75
	{
sl@0
    76
	if((iSizeInPixels == aInfo.iSizeInPixels) &&
sl@0
    77
	   (iPixelFormat == aInfo.iPixelFormat) &&
sl@0
    78
#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
sl@0
    79
	   (iUsage == aInfo.iUsage))
sl@0
    80
#else
sl@0
    81
		(iUsage == aInfo.iUsage) &&
sl@0
    82
		(iShareable == aInfo.iShareable) &&
sl@0
    83
		(iCpuAccess == aInfo.iCpuAccess) &&
sl@0
    84
		(iScreenId == aInfo.iScreenId) &&
sl@0
    85
		(iUserAttributes == aInfo.iUserAttributes) &&
sl@0
    86
		(iUserAttributeCount == aInfo.iUserAttributeCount))
sl@0
    87
#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
sl@0
    88
		{
sl@0
    89
		return ETrue;
sl@0
    90
		}
sl@0
    91
sl@0
    92
	return EFalse;
sl@0
    93
	}
sl@0
    94
sl@0
    95
/* OpenVgImage Child variant */
sl@0
    96
EXPORT_C TSgImageInfoOpenVgImage::TSgImageInfoOpenVgImage()
sl@0
    97
	{
sl@0
    98
#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
sl@0
    99
	iUsage = ESgUsageBitOpenVgImage;
sl@0
   100
#else
sl@0
   101
	iUsage = ESgUsageOpenVgImage;
sl@0
   102
#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
sl@0
   103
	}
sl@0
   104
sl@0
   105
EXPORT_C TSgImageInfoOpenVgImage::TSgImageInfoOpenVgImage(TUidPixelFormat aPixelFormat, TSize aSize) : TSgImageInfoTest(aPixelFormat, aSize)
sl@0
   106
	{
sl@0
   107
#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
sl@0
   108
	iUsage = ESgUsageBitOpenVgImage;
sl@0
   109
#else
sl@0
   110
	iUsage = ESgUsageOpenVgImage;
sl@0
   111
#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
sl@0
   112
	}
sl@0
   113
sl@0
   114
EXPORT_C TSgImageInfoOpenVgImage::~TSgImageInfoOpenVgImage()
sl@0
   115
	{
sl@0
   116
	}
sl@0
   117
sl@0
   118
/* OpenVgTarget Child variant */
sl@0
   119
EXPORT_C TSgImageInfoOpenVgTarget::TSgImageInfoOpenVgTarget()
sl@0
   120
	{
sl@0
   121
#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
sl@0
   122
	iUsage = ESgUsageBitOpenVgSurface;
sl@0
   123
#else
sl@0
   124
	iUsage = ESgUsageOpenVgTarget;
sl@0
   125
#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
sl@0
   126
	}
sl@0
   127
sl@0
   128
EXPORT_C TSgImageInfoOpenVgTarget::TSgImageInfoOpenVgTarget(TUidPixelFormat aPixelFormat, TSize aSize) : TSgImageInfoTest(aPixelFormat, aSize)
sl@0
   129
	{
sl@0
   130
#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
sl@0
   131
	iUsage = ESgUsageBitOpenVgSurface;
sl@0
   132
#else
sl@0
   133
	iUsage = ESgUsageOpenVgTarget;
sl@0
   134
#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
sl@0
   135
	}
sl@0
   136
sl@0
   137
EXPORT_C TSgImageInfoOpenVgTarget::~TSgImageInfoOpenVgTarget()
sl@0
   138
	{
sl@0
   139
	}