1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/graphicsresourceservices/graphicsresource/inc/sgimageadapter.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,163 @@
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 + @publishedPartner
1.22 + @prototype
1.23 +*/
1.24 +
1.25 +#ifndef SGIMAGEADAPTER_H
1.26 +#define SGIMAGEADAPTER_H
1.27 +
1.28 +#include <graphics/sgresourceadapter.h>
1.29 +#include <graphics/sgimage.h>
1.30 +
1.31 +
1.32 +/**
1.33 +@publishedPartner
1.34 +@prototype
1.35 +@deprecated
1.36 +
1.37 +This interface must be implemented by all the user-side objects in the adaptation
1.38 +layer of the Graphics subsystem which are referenced by instances of RSgImage.
1.39 +The interface between the user-side and the kernel-side parts of the adaptation
1.40 +layer is outside the scope of the specification of the Graphics Resource API.
1.41 +
1.42 +@see RSgImage
1.43 +*/
1.44 +class MSgImageAdapter: public MSgDrawableAdapter
1.45 + {
1.46 +public:
1.47 + /**
1.48 + @publishedPartner
1.49 + @prototype
1.50 + @deprecated
1.51 +
1.52 + Retrieves the values of the attributes of the image represented by this adapter
1.53 + object.
1.54 +
1.55 + @param aInfo On input, the globally unique identifiers of the user-defined
1.56 + attributes to be retrieved from the image, if any. On return, the values
1.57 + of the attributes of the image and the values of the selected user-defined
1.58 + attributes.
1.59 + @pre If aInfo.iUserAttributes is not null then it points to an array of
1.60 + aInfo.iUserAttributeCount elements with globally unique identifiers
1.61 + corresponding to user-defined attributes attached to the image.
1.62 + @return KErrNone if successful.
1.63 + @return KErrNotFound if any of the user-defined attributes to be retrieved from
1.64 + the image cannot be found.
1.65 + @see RSgImage::GetInfo()
1.66 + */
1.67 + virtual TInt GetInfo(TSgImageInfo& aInfo) const = 0;
1.68 + /**
1.69 + @publishedPartner
1.70 + @prototype
1.71 + @deprecated
1.72 +
1.73 + Temporarily makes the pixel data of the image represented by this adapter object
1.74 + accessible for reading by the CPU.
1.75 +
1.76 + @param aDataAddress On return, the base address of the pixel data in the address
1.77 + space of the calling process.
1.78 + @param aDataStride On return, the number of bytes between rows of the pixel data.
1.79 + @pre The image is not mapped yet.
1.80 + @pre The image was created with CPU access ESgCpuAccessReadOnly or
1.81 + ESgCpuAccessReadWrite.
1.82 + @pre The image was created by the calling process.
1.83 + @post The pixel data of the image is directly accessible in the address space
1.84 + of the calling process for reading only, until Unmap() is called.
1.85 + @return KErrNone if successful.
1.86 + @return KErrInUse if the image is already mapped or in exclusive use by the GPU.
1.87 + @return KErrAccessDenied if the image was not created with CPU access
1.88 + ESgCpuAccessReadOnly or ESgCpuAccessReadWrite.
1.89 + @return KErrPermissionDenied if the image was created by another process.
1.90 + @return KErrNoMemory if there is not enough system memory.
1.91 + @see RSgImage::MapReadOnly()
1.92 + */
1.93 + virtual TInt MapReadOnly(const TAny*& aDataAddress, TInt& aDataStride) = 0;
1.94 + /**
1.95 + @publishedPartner
1.96 + @prototype
1.97 + @deprecated
1.98 +
1.99 + Temporarily makes the pixel data of the image represented by this adapter object
1.100 + accessible for writing by the CPU.
1.101 +
1.102 + @param aDataAddress On return, the base address of the pixel data in the address
1.103 + space of the calling process.
1.104 + @param aDataStride On return, the number of bytes between rows of the pixel data.
1.105 + @pre The image is not mapped yet.
1.106 + @pre The image was created with CPU access ESgCpuAccessWriteOnly or
1.107 + ESgCpuAccessReadWrite.
1.108 + @pre The image was created by the calling process.
1.109 + @post The pixel data of the image is directly accessible in the address space
1.110 + of the calling process for writing only, until Unmap() is called.
1.111 + @return KErrNone if successful.
1.112 + @return KErrInUse if the image is already mapped or in exclusive use by the GPU.
1.113 + @return KErrAccessDenied if the image was not created with CPU access
1.114 + ESgCpuAccessWriteOnly or ESgCpuAccessReadWrite.
1.115 + @return KErrPermissionDenied if the image was created by another process.
1.116 + @return KErrNoMemory if there is not enough system memory.
1.117 + @see RSgImage::MapWriteOnly()
1.118 + */
1.119 + virtual TInt MapWriteOnly(TAny*& aDataAddress, TInt& aDataStride) = 0;
1.120 + /**
1.121 + @publishedPartner
1.122 + @prototype
1.123 + @deprecated
1.124 +
1.125 + Temporarily makes the pixel data of the image represented by this adapter object
1.126 + accessible for reading and writing by the CPU.
1.127 +
1.128 + @param aDataAddress On return, the base address of the pixel data in the address
1.129 + space of the calling process.
1.130 + @param aDataStride On return, the number of bytes between rows of the pixel data.
1.131 + @pre The image is not mapped yet.
1.132 + @pre The image was created with CPU access ESgCpuAccessReadWrite.
1.133 + @pre The image was created by the calling process.
1.134 + @post The pixel data of the image is directly accessible in the address space
1.135 + of the calling process for reading and writing, until Unmap() is called.
1.136 + @return KErrNone if successful.
1.137 + @return KErrInUse if the image is already mapped or in exclusive use by the GPU.
1.138 + @return KErrAccessDenied if the image was not created with CPU access
1.139 + ESgCpuAccessReadWrite.
1.140 + @return KErrPermissionDenied if the image was created by another process.
1.141 + @return KErrNoMemory if there is not enough system memory.
1.142 + @see RSgImage::MapReadWrite()
1.143 + */
1.144 + virtual TInt MapReadWrite(TAny*& aDataAddress, TInt& aDataStride) = 0;
1.145 + /**
1.146 + @publishedPartner
1.147 + @prototype
1.148 + @deprecated
1.149 +
1.150 + Makes the pixel data of the image represented by this adapter object no longer
1.151 + accessible by the CPU.
1.152 +
1.153 + @pre The image is mapped for CPU access by a previous call to MapReadOnly(),
1.154 + MapWriteOnly() or MapReadWrite().
1.155 + @post The GPU is guaranteed to be able to get access to the image.
1.156 + @post The address range in the calling process used for the mapping is no longer
1.157 + valid.
1.158 + @return KErrNone if successful.
1.159 + @return KErrGeneral if the image was not mapped for CPU access.
1.160 + @see RSgImage::Unmap()
1.161 + */
1.162 + virtual TInt Unmap() = 0;
1.163 + };
1.164 +
1.165 +
1.166 +#endif // SGIMAGEADAPTER_H