os/graphics/graphicscomposition/openwfcompositionengine/adaptation/include/owfdisplaycontextgeneral.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/graphicscomposition/openwfcompositionengine/adaptation/include/owfdisplaycontextgeneral.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,151 @@
     1.4 +/* Copyright (c) 2009 The Khronos Group Inc.
     1.5 + * Portions copyright (c) 2009-2010  Nokia Corporation and/or its subsidiary(-ies)
     1.6 + *
     1.7 + * Permission is hereby granted, free of charge, to any person obtaining a
     1.8 + * copy of this software and/or associated documentation files (the
     1.9 + * "Materials"), to deal in the Materials without restriction, including
    1.10 + * without limitation the rights to use, copy, modify, merge, publish,
    1.11 + * distribute, sublicense, and/or sell copies of the Materials, and to
    1.12 + * permit persons to whom the Materials are furnished to do so, subject to
    1.13 + * the following conditions:
    1.14 + *
    1.15 + * The above copyright notice and this permission notice shall be included
    1.16 + * in all copies or substantial portions of the Materials.
    1.17 + *
    1.18 + * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    1.19 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    1.20 + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
    1.21 + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
    1.22 + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
    1.23 + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
    1.24 + * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
    1.25 + */
    1.26 +#ifndef OWFDISPLAYCONTEXTGENERAL_H_
    1.27 +#define OWFDISPLAYCONTEXTGENERAL_H_
    1.28 +
    1.29 +#include <WF/wfc.h>
    1.30 +#include <e32def.h>
    1.31 +#include <KHR/khrplatform.h>
    1.32 +
    1.33 +#ifdef __cplusplus
    1.34 +extern "C" {
    1.35 +#endif
    1.36 +
    1.37 +typedef void*   OWF_DISPCTX;
    1.38 +
    1.39 +OWF_DISPCTX OWF_DisplayContext_Create(TInt screenNum);
    1.40 +void OWF_DisplayContext_Destroy(TInt screenNum, OWF_DISPCTX dc);
    1.41 +
    1.42 +/**
    1.43 +Create a chunk for a new scratch buffer that is at least size bytes large.
    1.44 +@param  dc      The display context that owns the scratch buffer.
    1.45 +@param  size    The minimum size of the buffer required.
    1.46 +@return A pointer to the base of the new buffer if successful; otherwise null is returned. 
    1.47 +*/
    1.48 +void* OWF_DisplayContext_ScratchBuffer_Allocate(OWF_DISPCTX dc, int size);
    1.49 +
    1.50 +/**
    1.51 +Destroys the buffer with base address aAddress
    1.52 +@param  dc      The display context that owns the scratch buffer
    1.53 +@param  buffer  A pointer to the buffer to destroy.
    1.54 +*/
    1.55 +void OWF_DisplayContext_ScratchBuffer_Destroy(OWF_DISPCTX dc, void* buffer);
    1.56 +
    1.57 +/**
    1.58 +Increments the serial number of the display context
    1.59 +@param  dc      The display context who's serial number is to be incremented
    1.60 +*/
    1.61 +void OWF_DisplayContext_IncrementSerialNumber(OWF_DISPCTX dc);
    1.62 +
    1.63 +/**
    1.64 +Sets the composition ongoing flag
    1.65 +@param  dc      The display context who's composition ongoing flag is to be set
    1.66 +@param val      The boolean value
    1.67 +*/
    1.68 +void OWF_DisplayContext_SetCompositionOngoing(OWF_DISPCTX dc, WFCboolean val);
    1.69 +
    1.70 +/**
    1.71 +Creates posts the rendezvous semaphore
    1.72 +@param  dc      The display context
    1.73 +*/
    1.74 +void OWF_ComposerThread_Rendezvous(OWF_DISPCTX dc);
    1.75 +
    1.76 +/**
    1.77 +Waits on rendezvous semaphore
    1.78 +@param  dc      The display context who's composition ongoing flag is to be set
    1.79 +*/
    1.80 +void OWF_ComposerThread_RendezvousWait(OWF_DISPCTX dc);
    1.81 +
    1.82 +/**
    1.83 +Destroys on rendezvous semaphore
    1.84 +@param  dc      The display context
    1.85 +*/
    1.86 +void OWF_ComposerThread_RendezvousDestroy(OWF_DISPCTX dc);
    1.87 +
    1.88 +/**
    1.89 +Activates fastpath mechanism and associates the stream output
    1.90 +@param  dc      The display context
    1.91 +@param  fastpathStream      Sets the fastpath stream
    1.92 +*/
    1.93 +void OWF_DisplayContext_EnableFastpath(OWF_DISPCTX dc, OWFNativeStreamType fastpathStream);
    1.94 +
    1.95 +/**
    1.96 +Disable fastpath stream
    1.97 +@param  dc      The display context
    1.98 +*/
    1.99 +void OWF_DisplayContext_DisableFastpath(OWF_DISPCTX dc);
   1.100 +
   1.101 +/**
   1.102 +Returns fastpath state
   1.103 +@param  dc      The display context
   1.104 +@return OWF_TRUE if the current stream is fastpathable, OWF_FALSE otherwise 
   1.105 +*/
   1.106 +WFCboolean OWF_DisplayContext_FastpathEnabled(OWF_DISPCTX dc);
   1.107 +
   1.108 +/**
   1.109 +Returns fastpathed stream
   1.110 +@param  dc      The display context
   1.111 +@return handle of the fastpathed stream 
   1.112 +*/
   1.113 +OWFNativeStreamType OWF_DisplayContext_FastpathStream(OWF_DISPCTX dc);
   1.114 +
   1.115 +/**
   1.116 +Retrieves state of the fastpath
   1.117 +@param  dc      The display context
   1.118 +@return OWF_TRUE if the fastpath has been checked, OWF_FALSE otherwise 
   1.119 +*/
   1.120 +WFCboolean OWF_DisplayContext_FastpathChecked(OWF_DISPCTX dc);
   1.121 +/**
   1.122 +Resets fatpath check
   1.123 +@param  dc      The display context
   1.124 +*/
   1.125 +void OWF_DisplayContext_ResetFastpathCheck(OWF_DISPCTX dc);
   1.126 +/**
   1.127 +Sets fatpath check
   1.128 +@param  dc      The display context
   1.129 +*/
   1.130 +void OWF_DisplayContext_SetFastpathChecked(OWF_DISPCTX dc);
   1.131 +
   1.132 +/**
   1.133 +Flags that the internal stream has been made accessible for outside world
   1.134 +The fast path mechanism is using it in order to fill the internal stream with
   1.135 +the content of the fastpathed stream
   1.136 +@param  dc      The display context
   1.137 +*/
   1.138 +void OWF_DisplayContext_FlagInternalStreamAccessed(OWF_DISPCTX dc);
   1.139 +
   1.140 +/**
   1.141 +Returns the internal stream accessibilty flag
   1.142 +@param  dc      The display context
   1.143 +@return OWF_TRUE if the fastpat has been checked, OWF_FALSE otherwise 
   1.144 +*/
   1.145 +WFCboolean OWF_DisplayContext_InternalStreamAccessed(OWF_DISPCTX dc);
   1.146 +
   1.147 +OWFboolean OWF_DisplayContext_CopyFastpathedStreamToTargetStream(void* context);
   1.148 +
   1.149 +
   1.150 +#ifdef __cplusplus
   1.151 +}
   1.152 +#endif
   1.153 +
   1.154 +#endif /* OWFDISPLAYCONTEXTGENERAL_H_ */