os/graphics/graphicscomposition/openwfcompositionengine/adaptation/include/owfdisplaycontextgeneral.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.
     1 /* Copyright (c) 2009 The Khronos Group Inc.
     2  * Portions copyright (c) 2009-2010  Nokia Corporation and/or its subsidiary(-ies)
     3  *
     4  * Permission is hereby granted, free of charge, to any person obtaining a
     5  * copy of this software and/or associated documentation files (the
     6  * "Materials"), to deal in the Materials without restriction, including
     7  * without limitation the rights to use, copy, modify, merge, publish,
     8  * distribute, sublicense, and/or sell copies of the Materials, and to
     9  * permit persons to whom the Materials are furnished to do so, subject to
    10  * the following conditions:
    11  *
    12  * The above copyright notice and this permission notice shall be included
    13  * in all copies or substantial portions of the Materials.
    14  *
    15  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    16  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    17  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
    18  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
    19  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
    20  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
    21  * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
    22  */
    23 #ifndef OWFDISPLAYCONTEXTGENERAL_H_
    24 #define OWFDISPLAYCONTEXTGENERAL_H_
    25 
    26 #include <WF/wfc.h>
    27 #include <e32def.h>
    28 #include <KHR/khrplatform.h>
    29 
    30 #ifdef __cplusplus
    31 extern "C" {
    32 #endif
    33 
    34 typedef void*   OWF_DISPCTX;
    35 
    36 OWF_DISPCTX OWF_DisplayContext_Create(TInt screenNum);
    37 void OWF_DisplayContext_Destroy(TInt screenNum, OWF_DISPCTX dc);
    38 
    39 /**
    40 Create a chunk for a new scratch buffer that is at least size bytes large.
    41 @param  dc      The display context that owns the scratch buffer.
    42 @param  size    The minimum size of the buffer required.
    43 @return A pointer to the base of the new buffer if successful; otherwise null is returned. 
    44 */
    45 void* OWF_DisplayContext_ScratchBuffer_Allocate(OWF_DISPCTX dc, int size);
    46 
    47 /**
    48 Destroys the buffer with base address aAddress
    49 @param  dc      The display context that owns the scratch buffer
    50 @param  buffer  A pointer to the buffer to destroy.
    51 */
    52 void OWF_DisplayContext_ScratchBuffer_Destroy(OWF_DISPCTX dc, void* buffer);
    53 
    54 /**
    55 Increments the serial number of the display context
    56 @param  dc      The display context who's serial number is to be incremented
    57 */
    58 void OWF_DisplayContext_IncrementSerialNumber(OWF_DISPCTX dc);
    59 
    60 /**
    61 Sets the composition ongoing flag
    62 @param  dc      The display context who's composition ongoing flag is to be set
    63 @param val      The boolean value
    64 */
    65 void OWF_DisplayContext_SetCompositionOngoing(OWF_DISPCTX dc, WFCboolean val);
    66 
    67 /**
    68 Creates posts the rendezvous semaphore
    69 @param  dc      The display context
    70 */
    71 void OWF_ComposerThread_Rendezvous(OWF_DISPCTX dc);
    72 
    73 /**
    74 Waits on rendezvous semaphore
    75 @param  dc      The display context who's composition ongoing flag is to be set
    76 */
    77 void OWF_ComposerThread_RendezvousWait(OWF_DISPCTX dc);
    78 
    79 /**
    80 Destroys on rendezvous semaphore
    81 @param  dc      The display context
    82 */
    83 void OWF_ComposerThread_RendezvousDestroy(OWF_DISPCTX dc);
    84 
    85 /**
    86 Activates fastpath mechanism and associates the stream output
    87 @param  dc      The display context
    88 @param  fastpathStream      Sets the fastpath stream
    89 */
    90 void OWF_DisplayContext_EnableFastpath(OWF_DISPCTX dc, OWFNativeStreamType fastpathStream);
    91 
    92 /**
    93 Disable fastpath stream
    94 @param  dc      The display context
    95 */
    96 void OWF_DisplayContext_DisableFastpath(OWF_DISPCTX dc);
    97 
    98 /**
    99 Returns fastpath state
   100 @param  dc      The display context
   101 @return OWF_TRUE if the current stream is fastpathable, OWF_FALSE otherwise 
   102 */
   103 WFCboolean OWF_DisplayContext_FastpathEnabled(OWF_DISPCTX dc);
   104 
   105 /**
   106 Returns fastpathed stream
   107 @param  dc      The display context
   108 @return handle of the fastpathed stream 
   109 */
   110 OWFNativeStreamType OWF_DisplayContext_FastpathStream(OWF_DISPCTX dc);
   111 
   112 /**
   113 Retrieves state of the fastpath
   114 @param  dc      The display context
   115 @return OWF_TRUE if the fastpath has been checked, OWF_FALSE otherwise 
   116 */
   117 WFCboolean OWF_DisplayContext_FastpathChecked(OWF_DISPCTX dc);
   118 /**
   119 Resets fatpath check
   120 @param  dc      The display context
   121 */
   122 void OWF_DisplayContext_ResetFastpathCheck(OWF_DISPCTX dc);
   123 /**
   124 Sets fatpath check
   125 @param  dc      The display context
   126 */
   127 void OWF_DisplayContext_SetFastpathChecked(OWF_DISPCTX dc);
   128 
   129 /**
   130 Flags that the internal stream has been made accessible for outside world
   131 The fast path mechanism is using it in order to fill the internal stream with
   132 the content of the fastpathed stream
   133 @param  dc      The display context
   134 */
   135 void OWF_DisplayContext_FlagInternalStreamAccessed(OWF_DISPCTX dc);
   136 
   137 /**
   138 Returns the internal stream accessibilty flag
   139 @param  dc      The display context
   140 @return OWF_TRUE if the fastpat has been checked, OWF_FALSE otherwise 
   141 */
   142 WFCboolean OWF_DisplayContext_InternalStreamAccessed(OWF_DISPCTX dc);
   143 
   144 OWFboolean OWF_DisplayContext_CopyFastpathedStreamToTargetStream(void* context);
   145 
   146 
   147 #ifdef __cplusplus
   148 }
   149 #endif
   150 
   151 #endif /* OWFDISPLAYCONTEXTGENERAL_H_ */