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