os/graphics/graphicscomposition/openwfsupport/inc/contentupdateproxy.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) 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
// contentupdateproxy.h
sl@0
    15
// Proxy object for receiving SUS surface content update notifications and rerouting them to nativestream 
sl@0
    16
//
sl@0
    17
#ifndef COMPBACKUPDATEPROXY_H
sl@0
    18
#define COMPBACKUPDATEPROXY_H
sl@0
    19
#include <e32cmn.h>
sl@0
    20
#include <e32base.h>
sl@0
    21
#include <graphics/compositionsurfaceupdate.h>
sl@0
    22
#include <graphics/extensioncontainer.h>
sl@0
    23
class TSurfaceId;
sl@0
    24
class MRectangle;
sl@0
    25
class TRegion;
sl@0
    26
class COpenWfcStreamMap;
sl@0
    27
class CSurfaceStream;
sl@0
    28
sl@0
    29
#define KContentUpdateProxyVersion 3 
sl@0
    30
sl@0
    31
NONSHARABLE_CLASS(CContentUpdateProxy) : public CExtensionContainer, public MCompositionSurfaceUpdate
sl@0
    32
	{
sl@0
    33
public:
sl@0
    34
	static CExtensionContainer* NewL(TInt aScreenNum, COpenWfcStreamMap*	aSingleton,TInt aInternalVersion,TInt aPriority);
sl@0
    35
	
sl@0
    36
sl@0
    37
/*-------------------------------------------------------------------*//*!
sl@0
    38
 * \brief   Gets the API version number of the
sl@0
    39
 *          MCompositionSurfaceUpdate implementation.
sl@0
    40
 *
sl@0
    41
 * @return  1 for Oghma conformant implementation,
sl@0
    42
 *          2 for Sphinx.
sl@0
    43
 *          3 for OpenWF-C
sl@0
    44
 *//*-------------------------------------------------------------------*/
sl@0
    45
sl@0
    46
    virtual TInt        ApiVersion          (void) ;
sl@0
    47
sl@0
    48
/*-------------------------------------------------------------------*//*!
sl@0
    49
 * \brief   Gets the internal version number of the
sl@0
    50
 *          MCompositionSurfaceUpdate implementation.
sl@0
    51
 *
sl@0
    52
 * @return  The version number of the MCompositionSurfaceUpdate
sl@0
    53
 *          instance.
sl@0
    54
 *//*-------------------------------------------------------------------*/
sl@0
    55
sl@0
    56
    virtual TVersion    InternalVersion     (void) ;
sl@0
    57
sl@0
    58
sl@0
    59
/*-------------------------------------------------------------------*//*!
sl@0
    60
 * \brief   A function that responds to surface content notifications.
sl@0
    61
 *
sl@0
    62
 * When the contents of a surface change, this function gets called
sl@0
    63
 * by a mechanism that is an implementation detail of the graphics
sl@0
    64
 * driver together with the MCompositionSurfaceUpdate implementation. The
sl@0
    65
 * call can originate from different processes and the
sl@0
    66
 * MCompositionSurfaceUpdate together with the surface implementation
sl@0
    67
 * relays the information content of it, through implementation
sl@0
    68
 * specific means, to trigger the actual composition soon after this
sl@0
    69
 * call - this composition call should be synchronized with the
sl@0
    70
 * refresh rate of the screen.
sl@0
    71
 *
sl@0
    72
 * @param   aSurface            The surface that has been updated.
sl@0
    73
 * @param   aBuffer             The buffer of the surface to be used in
sl@0
    74
 *                              composition. Integer starting from 0.
sl@0
    75
 * @param   aRegion             The sub-area that has the updates. If NULL, the
sl@0
    76
 *                              whole surface is considered changed.
sl@0
    77
 * @param   aStatusConsumed     A request status object or NULL. If not NULL, then the
sl@0
    78
 *                              request status is completed once the backend
sl@0
    79
 *                              does not anymore need the contents of the
sl@0
    80
 *                              surface to render the update. This may happen
sl@0
    81
 *                              before actually displaying the finished frame.
sl@0
    82
 * @param   aStatusDisplayed    This is signaled after the composited frame
sl@0
    83
 *                              is posted the to display for the first time after
sl@0
    84
 *                              the update. After this the value in
sl@0
    85
 *                              aTimeStamp is valid, if the value in the
sl@0
    86
 *                              status object is KErrNone. Can be NULL, if
sl@0
    87
 *                              no signal is desired.
sl@0
    88
 * @param   aTimeStamp          Value of the User::FastCounter() right after the
sl@0
    89
 *                              display refresh that signaled aStatusDisplayed.
sl@0
    90
 * @param   aStatusDispXTimes   This is signaled when the surface has been on
sl@0
    91
 *                              the screen for aDisplayedXTimes refreshes,
sl@0
    92
 *                              including the update that signaled aStatusDisplayed.
sl@0
    93
 *                              Can be NULL, if no signal is wanted.
sl@0
    94
 * @param   aDisplayedXTimes    The number of refreshes after which aStatusDispXTimes
sl@0
    95
 *                              is signaled or NULL. If values is provided, it must be
sl@0
    96
 *                              >= 1.
sl@0
    97
 *
sl@0
    98
 * @pre     The MCompositionSurfaceUpdate implementation is waiting for content
sl@0
    99
 *          update notifications.
sl@0
   100
 * @pre     aSurface.IsNull() returns EFalse.
sl@0
   101
 * @pre     The surface aSurface is registered with the backend or all status
sl@0
   102
 *          requests are completed with KErrArgument.
sl@0
   103
 * @pre     Either both aStatusDisplayed and aTimeStamp are NULL or neither
sl@0
   104
 *          of them are.
sl@0
   105
 * @pre     Either both aStatusDispXTimes and aDisplayedXTimes are NULL or
sl@0
   106
 *          neither of them are.
sl@0
   107
 * @post    The MCompositionSurfaceUpdate is waiting for vsync or another
sl@0
   108
 *          synchronisation method to trigger composition,
sl@0
   109
 *          depending on cached visibility information.
sl@0
   110
 * @note    The updated region is used only as an optimisation hint.
sl@0
   111
 *          the current contents of the surface are always used for
sl@0
   112
 *          composition independent of the aRegion.
sl@0
   113
 * @see     Surface Update API Specification [R6] for further details
sl@0
   114
 *          about the semantics of the parameters and return values
sl@0
   115
 *          of the TRequestStatus objects.
sl@0
   116
 *//*-------------------------------------------------------------------*/
sl@0
   117
sl@0
   118
    virtual void        ContentUpdated      (const TSurfaceId&  aSurface,
sl@0
   119
                                             TInt               aBuffer,
sl@0
   120
                                             const TRegion*     aRegion,
sl@0
   121
                                             TRequestStatus*    aStatusConsumed,
sl@0
   122
                                             TRequestStatus*    aStatusDisplayed,
sl@0
   123
                                             TUint32*           aTimeStamp,
sl@0
   124
                                             TRequestStatus*    aStatusDispXTimes,
sl@0
   125
                                             TInt*              aDisplayedXTimes) ;
sl@0
   126
sl@0
   127
    
sl@0
   128
public:
sl@0
   129
    void RegisterNotifications(CSurfaceStream& aNs,
sl@0
   130
                               TInt            aBuffer,
sl@0
   131
                               TRequestStatus* aStatusDisplayed, TUint32* aTimeStamp,
sl@0
   132
                               TRequestStatus* aStatusDispXTimes, TInt* aDisplayedXTimes,
sl@0
   133
                               TRequestStatus* aStatusConsumed, const TRegion* aRegion);   
sl@0
   134
    
sl@0
   135
private:	//methods
sl@0
   136
	void ConstructL(TInt aScreenNum, COpenWfcStreamMap*	aSingleton,TInt aInternalVersio,TInt aPriority);
sl@0
   137
	CContentUpdateProxy();
sl@0
   138
	~CContentUpdateProxy();
sl@0
   139
	void CompleteStatus(TRequestStatus* aStatusConsumed,TRequestStatus* aStatusDisplayed,
sl@0
   140
	        TRequestStatus* aStatusDispXTimes,TInt aReason);
sl@0
   141
	virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
sl@0
   142
sl@0
   143
private:	//data
sl@0
   144
	TInt				iScreenNum;
sl@0
   145
	TInt				iInternalVersion;
sl@0
   146
	TInt				iPriority;
sl@0
   147
	COpenWfcStreamMap*	iSingleton;
sl@0
   148
	RHeap&              iHeap;
sl@0
   149
	};
sl@0
   150
sl@0
   151
sl@0
   152
#endif /*COMPBACKUPDATEPROXY_*/