os/graphics/graphicscomposition/openwfcompositionengine/adaptation/include/owfdisplaycontextgeneral.h
Update contrib.
1 /* Copyright (c) 2009 The Khronos Group Inc.
2 * Portions copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies)
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:
12 * The above copyright notice and this permission notice shall be included
13 * in all copies or substantial portions of the Materials.
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.
23 #ifndef OWFDISPLAYCONTEXTGENERAL_H_
24 #define OWFDISPLAYCONTEXTGENERAL_H_
28 #include <KHR/khrplatform.h>
34 typedef void* OWF_DISPCTX;
36 OWF_DISPCTX OWF_DisplayContext_Create(TInt screenNum);
37 void OWF_DisplayContext_Destroy(TInt screenNum, OWF_DISPCTX dc);
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.
45 void* OWF_DisplayContext_ScratchBuffer_Allocate(OWF_DISPCTX dc, int size);
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.
52 void OWF_DisplayContext_ScratchBuffer_Destroy(OWF_DISPCTX dc, void* buffer);
55 Increments the serial number of the display context
56 @param dc The display context who's serial number is to be incremented
58 void OWF_DisplayContext_IncrementSerialNumber(OWF_DISPCTX dc);
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
65 void OWF_DisplayContext_SetCompositionOngoing(OWF_DISPCTX dc, WFCboolean val);
68 Creates posts the rendezvous semaphore
69 @param dc The display context
71 void OWF_ComposerThread_Rendezvous(OWF_DISPCTX dc);
74 Waits on rendezvous semaphore
75 @param dc The display context who's composition ongoing flag is to be set
77 void OWF_ComposerThread_RendezvousWait(OWF_DISPCTX dc);
80 Destroys on rendezvous semaphore
81 @param dc The display context
83 void OWF_ComposerThread_RendezvousDestroy(OWF_DISPCTX dc);
86 Activates fastpath mechanism and associates the stream output
87 @param dc The display context
88 @param fastpathStream Sets the fastpath stream
90 void OWF_DisplayContext_EnableFastpath(OWF_DISPCTX dc, OWFNativeStreamType fastpathStream);
93 Disable fastpath stream
94 @param dc The display context
96 void OWF_DisplayContext_DisableFastpath(OWF_DISPCTX dc);
99 Returns fastpath state
100 @param dc The display context
101 @return OWF_TRUE if the current stream is fastpathable, OWF_FALSE otherwise
103 WFCboolean OWF_DisplayContext_FastpathEnabled(OWF_DISPCTX dc);
106 Returns fastpathed stream
107 @param dc The display context
108 @return handle of the fastpathed stream
110 OWFNativeStreamType OWF_DisplayContext_FastpathStream(OWF_DISPCTX dc);
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
117 WFCboolean OWF_DisplayContext_FastpathChecked(OWF_DISPCTX dc);
120 @param dc The display context
122 void OWF_DisplayContext_ResetFastpathCheck(OWF_DISPCTX dc);
125 @param dc The display context
127 void OWF_DisplayContext_SetFastpathChecked(OWF_DISPCTX dc);
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
135 void OWF_DisplayContext_FlagInternalStreamAccessed(OWF_DISPCTX dc);
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
142 WFCboolean OWF_DisplayContext_InternalStreamAccessed(OWF_DISPCTX dc);
144 OWFboolean OWF_DisplayContext_CopyFastpathedStreamToTargetStream(void* context);
151 #endif /* OWFDISPLAYCONTEXTGENERAL_H_ */