graphicsresourceservices/graphicsresource/inc/sgimageadapter.h
author Faisal Memon <faisal.memon@nokia.com>
Fri, 14 May 2010 15:41:33 +0100
branchNewGraphicsArchitecture
changeset 64 5c983aa672ea
parent 0 5d03bc08d59c
permissions -rw-r--r--
Merge 1. Pull in cpp files in the performance enhanced Khronos RI OVG files which are newly added. I've ignored platform-specific cpp files for linux, macosx, and null operating systems because this local solution has its own platform glue (i.e. facility to target Bitmaps but no full windowing support). I've ignored sfEGLInterface.cpp because this is used as a bridge to go from EGL to Nokia's Platsim which offers an EGL service. That's not relevant to this implementation because this is ARM side code, not Intel side. I just left a comment to sfEGLInterface.cpp in case we need to pick up this later on. The current code compiles on winscw. Prior to this fix, the code works on winscw, and can launch the SVG tiger (tiger.exe). That takes about 20 seconds to render. I hope to always be able to show this icon on each commit, and the plan is for the render time to reduce with this series of submissions. On this commit, the tiger renders ok in 20 seconds.

// 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
 @publishedPartner
 @prototype
*/

#ifndef SGIMAGEADAPTER_H
#define SGIMAGEADAPTER_H

#include <graphics/sgresourceadapter.h>
#include <graphics/sgimage.h>


/**
@publishedPartner
@prototype
@deprecated

This interface must be implemented by all the user-side objects in the adaptation
layer of the Graphics subsystem which are referenced by instances of RSgImage.
The interface between the user-side and the kernel-side parts of the adaptation
layer is outside the scope of the specification of the Graphics Resource API.

@see RSgImage
*/
class MSgImageAdapter: public MSgDrawableAdapter
	{
public:
	/**
	@publishedPartner
	@prototype
	@deprecated

	Retrieves the values of the attributes of the image represented by this adapter
	object.

	@param aInfo On input, the globally unique identifiers of the user-defined
	       attributes to be retrieved from the image, if any. On return, the values
	       of the attributes of the image and the values of the selected user-defined
	       attributes.
	@pre If aInfo.iUserAttributes is not null then it points to an array of
	     aInfo.iUserAttributeCount elements with globally unique identifiers
	     corresponding to user-defined attributes attached to the image.
	@return KErrNone if successful.
	@return KErrNotFound if any of the user-defined attributes to be retrieved from
	        the image cannot be found.
	@see RSgImage::GetInfo()
	*/
	virtual TInt GetInfo(TSgImageInfo& aInfo) const = 0;
	/**
	@publishedPartner
	@prototype
	@deprecated

	Temporarily makes the pixel data of the image represented by this adapter object
	accessible for reading by the CPU.

	@param aDataAddress On return, the base address of the pixel data in the address
	       space of the calling process.
	@param aDataStride On return, the number of bytes between rows of the pixel data.
	@pre The image is not mapped yet.
	@pre The image was created with CPU access ESgCpuAccessReadOnly or
	     ESgCpuAccessReadWrite.
	@pre The image was created by the calling process.
	@post The pixel data of the image is directly accessible in the address space
	      of the calling process for reading only, until Unmap() is called.
	@return KErrNone if successful.
	@return KErrInUse if the image is already mapped or in exclusive use by the GPU.
	@return KErrAccessDenied if the image was not created with CPU access
	        ESgCpuAccessReadOnly or ESgCpuAccessReadWrite.
	@return KErrPermissionDenied if the image was created by another process.
	@return KErrNoMemory if there is not enough system memory.
	@see RSgImage::MapReadOnly()
	*/
	virtual TInt MapReadOnly(const TAny*& aDataAddress, TInt& aDataStride) = 0;
	/**
	@publishedPartner
	@prototype
	@deprecated

	Temporarily makes the pixel data of the image represented by this adapter object
	accessible for writing by the CPU.

	@param aDataAddress On return, the base address of the pixel data in the address
	       space of the calling process.
	@param aDataStride On return, the number of bytes between rows of the pixel data.
	@pre The image is not mapped yet.
	@pre The image was created with CPU access ESgCpuAccessWriteOnly or
	     ESgCpuAccessReadWrite.
	@pre The image was created by the calling process.
	@post The pixel data of the image is directly accessible in the address space
	      of the calling process for writing only, until Unmap() is called.
	@return KErrNone if successful.
	@return KErrInUse if the image is already mapped or in exclusive use by the GPU.
	@return KErrAccessDenied if the image was not created with CPU access
	        ESgCpuAccessWriteOnly or ESgCpuAccessReadWrite.
	@return KErrPermissionDenied if the image was created by another process.
	@return KErrNoMemory if there is not enough system memory.
	@see RSgImage::MapWriteOnly()
	*/
	virtual TInt MapWriteOnly(TAny*& aDataAddress, TInt& aDataStride) = 0;
	/**
	@publishedPartner
	@prototype
	@deprecated

	Temporarily makes the pixel data of the image represented by this adapter object
	accessible for reading and writing by the CPU.

	@param aDataAddress On return, the base address of the pixel data in the address
	       space of the calling process.
	@param aDataStride On return, the number of bytes between rows of the pixel data.
	@pre The image is not mapped yet.
	@pre The image was created with CPU access ESgCpuAccessReadWrite.
	@pre The image was created by the calling process.
	@post The pixel data of the image is directly accessible in the address space
	      of the calling process for reading and writing, until Unmap() is called.
	@return KErrNone if successful.
	@return KErrInUse if the image is already mapped or in exclusive use by the GPU.
	@return KErrAccessDenied if the image was not created with CPU access
	        ESgCpuAccessReadWrite.
	@return KErrPermissionDenied if the image was created by another process.
	@return KErrNoMemory if there is not enough system memory.
	@see RSgImage::MapReadWrite()
	*/
	virtual TInt MapReadWrite(TAny*& aDataAddress, TInt& aDataStride) = 0;
	/**
	@publishedPartner
	@prototype
	@deprecated

	Makes the pixel data of the image represented by this adapter object no longer
	accessible by the CPU.

	@pre The image is mapped for CPU access by a previous call to MapReadOnly(),
	     MapWriteOnly() or MapReadWrite().
	@post The GPU is guaranteed to be able to get access to the image.
	@post The address range in the calling process used for the mapping is no longer
	      valid.
	@return KErrNone if successful.
	@return KErrGeneral if the image was not mapped for CPU access.
	@see RSgImage::Unmap()
	*/
	virtual TInt Unmap() = 0;
	};


#endif // SGIMAGEADAPTER_H