sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @publishedPartner sl@0: @prototype sl@0: */ sl@0: sl@0: #ifndef SGIMAGEADAPTER_H sl@0: #define SGIMAGEADAPTER_H sl@0: sl@0: #include sl@0: #include sl@0: sl@0: sl@0: /** sl@0: @publishedPartner sl@0: @prototype sl@0: @deprecated sl@0: sl@0: This interface must be implemented by all the user-side objects in the adaptation sl@0: layer of the Graphics subsystem which are referenced by instances of RSgImage. sl@0: The interface between the user-side and the kernel-side parts of the adaptation sl@0: layer is outside the scope of the specification of the Graphics Resource API. sl@0: sl@0: @see RSgImage sl@0: */ sl@0: class MSgImageAdapter: public MSgDrawableAdapter sl@0: { sl@0: public: sl@0: /** sl@0: @publishedPartner sl@0: @prototype sl@0: @deprecated sl@0: sl@0: Retrieves the values of the attributes of the image represented by this adapter sl@0: object. sl@0: sl@0: @param aInfo On input, the globally unique identifiers of the user-defined sl@0: attributes to be retrieved from the image, if any. On return, the values sl@0: of the attributes of the image and the values of the selected user-defined sl@0: attributes. sl@0: @pre If aInfo.iUserAttributes is not null then it points to an array of sl@0: aInfo.iUserAttributeCount elements with globally unique identifiers sl@0: corresponding to user-defined attributes attached to the image. sl@0: @return KErrNone if successful. sl@0: @return KErrNotFound if any of the user-defined attributes to be retrieved from sl@0: the image cannot be found. sl@0: @see RSgImage::GetInfo() sl@0: */ sl@0: virtual TInt GetInfo(TSgImageInfo& aInfo) const = 0; sl@0: /** sl@0: @publishedPartner sl@0: @prototype sl@0: @deprecated sl@0: sl@0: Temporarily makes the pixel data of the image represented by this adapter object sl@0: accessible for reading by the CPU. sl@0: sl@0: @param aDataAddress On return, the base address of the pixel data in the address sl@0: space of the calling process. sl@0: @param aDataStride On return, the number of bytes between rows of the pixel data. sl@0: @pre The image is not mapped yet. sl@0: @pre The image was created with CPU access ESgCpuAccessReadOnly or sl@0: ESgCpuAccessReadWrite. sl@0: @pre The image was created by the calling process. sl@0: @post The pixel data of the image is directly accessible in the address space sl@0: of the calling process for reading only, until Unmap() is called. sl@0: @return KErrNone if successful. sl@0: @return KErrInUse if the image is already mapped or in exclusive use by the GPU. sl@0: @return KErrAccessDenied if the image was not created with CPU access sl@0: ESgCpuAccessReadOnly or ESgCpuAccessReadWrite. sl@0: @return KErrPermissionDenied if the image was created by another process. sl@0: @return KErrNoMemory if there is not enough system memory. sl@0: @see RSgImage::MapReadOnly() sl@0: */ sl@0: virtual TInt MapReadOnly(const TAny*& aDataAddress, TInt& aDataStride) = 0; sl@0: /** sl@0: @publishedPartner sl@0: @prototype sl@0: @deprecated sl@0: sl@0: Temporarily makes the pixel data of the image represented by this adapter object sl@0: accessible for writing by the CPU. sl@0: sl@0: @param aDataAddress On return, the base address of the pixel data in the address sl@0: space of the calling process. sl@0: @param aDataStride On return, the number of bytes between rows of the pixel data. sl@0: @pre The image is not mapped yet. sl@0: @pre The image was created with CPU access ESgCpuAccessWriteOnly or sl@0: ESgCpuAccessReadWrite. sl@0: @pre The image was created by the calling process. sl@0: @post The pixel data of the image is directly accessible in the address space sl@0: of the calling process for writing only, until Unmap() is called. sl@0: @return KErrNone if successful. sl@0: @return KErrInUse if the image is already mapped or in exclusive use by the GPU. sl@0: @return KErrAccessDenied if the image was not created with CPU access sl@0: ESgCpuAccessWriteOnly or ESgCpuAccessReadWrite. sl@0: @return KErrPermissionDenied if the image was created by another process. sl@0: @return KErrNoMemory if there is not enough system memory. sl@0: @see RSgImage::MapWriteOnly() sl@0: */ sl@0: virtual TInt MapWriteOnly(TAny*& aDataAddress, TInt& aDataStride) = 0; sl@0: /** sl@0: @publishedPartner sl@0: @prototype sl@0: @deprecated sl@0: sl@0: Temporarily makes the pixel data of the image represented by this adapter object sl@0: accessible for reading and writing by the CPU. sl@0: sl@0: @param aDataAddress On return, the base address of the pixel data in the address sl@0: space of the calling process. sl@0: @param aDataStride On return, the number of bytes between rows of the pixel data. sl@0: @pre The image is not mapped yet. sl@0: @pre The image was created with CPU access ESgCpuAccessReadWrite. sl@0: @pre The image was created by the calling process. sl@0: @post The pixel data of the image is directly accessible in the address space sl@0: of the calling process for reading and writing, until Unmap() is called. sl@0: @return KErrNone if successful. sl@0: @return KErrInUse if the image is already mapped or in exclusive use by the GPU. sl@0: @return KErrAccessDenied if the image was not created with CPU access sl@0: ESgCpuAccessReadWrite. sl@0: @return KErrPermissionDenied if the image was created by another process. sl@0: @return KErrNoMemory if there is not enough system memory. sl@0: @see RSgImage::MapReadWrite() sl@0: */ sl@0: virtual TInt MapReadWrite(TAny*& aDataAddress, TInt& aDataStride) = 0; sl@0: /** sl@0: @publishedPartner sl@0: @prototype sl@0: @deprecated sl@0: sl@0: Makes the pixel data of the image represented by this adapter object no longer sl@0: accessible by the CPU. sl@0: sl@0: @pre The image is mapped for CPU access by a previous call to MapReadOnly(), sl@0: MapWriteOnly() or MapReadWrite(). sl@0: @post The GPU is guaranteed to be able to get access to the image. sl@0: @post The address range in the calling process used for the mapping is no longer sl@0: valid. sl@0: @return KErrNone if successful. sl@0: @return KErrGeneral if the image was not mapped for CPU access. sl@0: @see RSgImage::Unmap() sl@0: */ sl@0: virtual TInt Unmap() = 0; sl@0: }; sl@0: sl@0: sl@0: #endif // SGIMAGEADAPTER_H