os/graphics/graphicsresourceservices/graphicsresource/inc/sgimageadapter.h
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
 @publishedPartner
sl@0
    19
 @prototype
sl@0
    20
*/
sl@0
    21
sl@0
    22
#ifndef SGIMAGEADAPTER_H
sl@0
    23
#define SGIMAGEADAPTER_H
sl@0
    24
sl@0
    25
#include <graphics/sgresourceadapter.h>
sl@0
    26
#include <graphics/sgimage.h>
sl@0
    27
sl@0
    28
sl@0
    29
/**
sl@0
    30
@publishedPartner
sl@0
    31
@prototype
sl@0
    32
@deprecated
sl@0
    33
sl@0
    34
This interface must be implemented by all the user-side objects in the adaptation
sl@0
    35
layer of the Graphics subsystem which are referenced by instances of RSgImage.
sl@0
    36
The interface between the user-side and the kernel-side parts of the adaptation
sl@0
    37
layer is outside the scope of the specification of the Graphics Resource API.
sl@0
    38
sl@0
    39
@see RSgImage
sl@0
    40
*/
sl@0
    41
class MSgImageAdapter: public MSgDrawableAdapter
sl@0
    42
	{
sl@0
    43
public:
sl@0
    44
	/**
sl@0
    45
	@publishedPartner
sl@0
    46
	@prototype
sl@0
    47
	@deprecated
sl@0
    48
sl@0
    49
	Retrieves the values of the attributes of the image represented by this adapter
sl@0
    50
	object.
sl@0
    51
sl@0
    52
	@param aInfo On input, the globally unique identifiers of the user-defined
sl@0
    53
	       attributes to be retrieved from the image, if any. On return, the values
sl@0
    54
	       of the attributes of the image and the values of the selected user-defined
sl@0
    55
	       attributes.
sl@0
    56
	@pre If aInfo.iUserAttributes is not null then it points to an array of
sl@0
    57
	     aInfo.iUserAttributeCount elements with globally unique identifiers
sl@0
    58
	     corresponding to user-defined attributes attached to the image.
sl@0
    59
	@return KErrNone if successful.
sl@0
    60
	@return KErrNotFound if any of the user-defined attributes to be retrieved from
sl@0
    61
	        the image cannot be found.
sl@0
    62
	@see RSgImage::GetInfo()
sl@0
    63
	*/
sl@0
    64
	virtual TInt GetInfo(TSgImageInfo& aInfo) const = 0;
sl@0
    65
	/**
sl@0
    66
	@publishedPartner
sl@0
    67
	@prototype
sl@0
    68
	@deprecated
sl@0
    69
sl@0
    70
	Temporarily makes the pixel data of the image represented by this adapter object
sl@0
    71
	accessible for reading by the CPU.
sl@0
    72
sl@0
    73
	@param aDataAddress On return, the base address of the pixel data in the address
sl@0
    74
	       space of the calling process.
sl@0
    75
	@param aDataStride On return, the number of bytes between rows of the pixel data.
sl@0
    76
	@pre The image is not mapped yet.
sl@0
    77
	@pre The image was created with CPU access ESgCpuAccessReadOnly or
sl@0
    78
	     ESgCpuAccessReadWrite.
sl@0
    79
	@pre The image was created by the calling process.
sl@0
    80
	@post The pixel data of the image is directly accessible in the address space
sl@0
    81
	      of the calling process for reading only, until Unmap() is called.
sl@0
    82
	@return KErrNone if successful.
sl@0
    83
	@return KErrInUse if the image is already mapped or in exclusive use by the GPU.
sl@0
    84
	@return KErrAccessDenied if the image was not created with CPU access
sl@0
    85
	        ESgCpuAccessReadOnly or ESgCpuAccessReadWrite.
sl@0
    86
	@return KErrPermissionDenied if the image was created by another process.
sl@0
    87
	@return KErrNoMemory if there is not enough system memory.
sl@0
    88
	@see RSgImage::MapReadOnly()
sl@0
    89
	*/
sl@0
    90
	virtual TInt MapReadOnly(const TAny*& aDataAddress, TInt& aDataStride) = 0;
sl@0
    91
	/**
sl@0
    92
	@publishedPartner
sl@0
    93
	@prototype
sl@0
    94
	@deprecated
sl@0
    95
sl@0
    96
	Temporarily makes the pixel data of the image represented by this adapter object
sl@0
    97
	accessible for writing by the CPU.
sl@0
    98
sl@0
    99
	@param aDataAddress On return, the base address of the pixel data in the address
sl@0
   100
	       space of the calling process.
sl@0
   101
	@param aDataStride On return, the number of bytes between rows of the pixel data.
sl@0
   102
	@pre The image is not mapped yet.
sl@0
   103
	@pre The image was created with CPU access ESgCpuAccessWriteOnly or
sl@0
   104
	     ESgCpuAccessReadWrite.
sl@0
   105
	@pre The image was created by the calling process.
sl@0
   106
	@post The pixel data of the image is directly accessible in the address space
sl@0
   107
	      of the calling process for writing only, until Unmap() is called.
sl@0
   108
	@return KErrNone if successful.
sl@0
   109
	@return KErrInUse if the image is already mapped or in exclusive use by the GPU.
sl@0
   110
	@return KErrAccessDenied if the image was not created with CPU access
sl@0
   111
	        ESgCpuAccessWriteOnly or ESgCpuAccessReadWrite.
sl@0
   112
	@return KErrPermissionDenied if the image was created by another process.
sl@0
   113
	@return KErrNoMemory if there is not enough system memory.
sl@0
   114
	@see RSgImage::MapWriteOnly()
sl@0
   115
	*/
sl@0
   116
	virtual TInt MapWriteOnly(TAny*& aDataAddress, TInt& aDataStride) = 0;
sl@0
   117
	/**
sl@0
   118
	@publishedPartner
sl@0
   119
	@prototype
sl@0
   120
	@deprecated
sl@0
   121
sl@0
   122
	Temporarily makes the pixel data of the image represented by this adapter object
sl@0
   123
	accessible for reading and writing by the CPU.
sl@0
   124
sl@0
   125
	@param aDataAddress On return, the base address of the pixel data in the address
sl@0
   126
	       space of the calling process.
sl@0
   127
	@param aDataStride On return, the number of bytes between rows of the pixel data.
sl@0
   128
	@pre The image is not mapped yet.
sl@0
   129
	@pre The image was created with CPU access ESgCpuAccessReadWrite.
sl@0
   130
	@pre The image was created by the calling process.
sl@0
   131
	@post The pixel data of the image is directly accessible in the address space
sl@0
   132
	      of the calling process for reading and writing, until Unmap() is called.
sl@0
   133
	@return KErrNone if successful.
sl@0
   134
	@return KErrInUse if the image is already mapped or in exclusive use by the GPU.
sl@0
   135
	@return KErrAccessDenied if the image was not created with CPU access
sl@0
   136
	        ESgCpuAccessReadWrite.
sl@0
   137
	@return KErrPermissionDenied if the image was created by another process.
sl@0
   138
	@return KErrNoMemory if there is not enough system memory.
sl@0
   139
	@see RSgImage::MapReadWrite()
sl@0
   140
	*/
sl@0
   141
	virtual TInt MapReadWrite(TAny*& aDataAddress, TInt& aDataStride) = 0;
sl@0
   142
	/**
sl@0
   143
	@publishedPartner
sl@0
   144
	@prototype
sl@0
   145
	@deprecated
sl@0
   146
sl@0
   147
	Makes the pixel data of the image represented by this adapter object no longer
sl@0
   148
	accessible by the CPU.
sl@0
   149
sl@0
   150
	@pre The image is mapped for CPU access by a previous call to MapReadOnly(),
sl@0
   151
	     MapWriteOnly() or MapReadWrite().
sl@0
   152
	@post The GPU is guaranteed to be able to get access to the image.
sl@0
   153
	@post The address range in the calling process used for the mapping is no longer
sl@0
   154
	      valid.
sl@0
   155
	@return KErrNone if successful.
sl@0
   156
	@return KErrGeneral if the image was not mapped for CPU access.
sl@0
   157
	@see RSgImage::Unmap()
sl@0
   158
	*/
sl@0
   159
	virtual TInt Unmap() = 0;
sl@0
   160
	};
sl@0
   161
sl@0
   162
sl@0
   163
#endif // SGIMAGEADAPTER_H