|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef DIRECTGDIADAPTER_H |
|
17 #define DIRECTGDIADAPTER_H |
|
18 |
|
19 /** |
|
20 @file |
|
21 @internalComponent |
|
22 */ |
|
23 |
|
24 #include <e32cmn.h> |
|
25 |
|
26 _LIT(KComponentPanicCategory, "DGDIAdapter"); |
|
27 #define SYMBIAN_PANIC_CATEGORY KComponentPanicCategory |
|
28 |
|
29 #include "directgditypes.h" |
|
30 #include <graphics/directgdipanics.h> |
|
31 |
|
32 |
|
33 /** |
|
34 Enumeration of DirectGDI panic codes. These should be used in conjunction with |
|
35 the ASSERT_ALWAYS and ASSERT_DEBUG macros defined below. |
|
36 */ |
|
37 enum TDirectGdiAdapterPanicCode |
|
38 { |
|
39 /** The requested functionality has not been implemented - do not use. |
|
40 */ |
|
41 EDirectGdiPanicNotImplemented = 1, |
|
42 |
|
43 /** An unexpected error has occured. |
|
44 */ |
|
45 EDirectGdiPanicUnexpectedError = 2, |
|
46 |
|
47 /** Invalid reference count to DirectGDI driver. |
|
48 */ |
|
49 EDirectGdiPanicDriverInvalidRefCount = 6, |
|
50 |
|
51 /** NULL bitmap specified. |
|
52 */ |
|
53 EDirectGdiPanicInvalidBitmap = 7, |
|
54 |
|
55 /** Invalid region passed into function. |
|
56 */ |
|
57 EDirectGdiPanicInvalidRegion = 8, |
|
58 |
|
59 /** An attempt has been made to use a patterned brush style when a patterned brush has not been set. |
|
60 */ |
|
61 EDirectGdiPanicPatternedBrushNotSet = 12, |
|
62 |
|
63 /** Unable to bind a rendering API. |
|
64 */ |
|
65 EDirectGdiPanicBindApi = 23, |
|
66 |
|
67 /** No drawing surface configurations are available. |
|
68 */ |
|
69 EDirectGdiPanicNoAvailableConfigs = 24, |
|
70 |
|
71 /** No available drawing surface configurations match specific attributes. |
|
72 */ |
|
73 EDirectGdiPanicNoMatchingConfig = 25, |
|
74 |
|
75 /** CVgEngine::DrawPolygon() was passed an invalid fill-rule. |
|
76 */ |
|
77 EDirectGdiPanicInvalidFillRule = 26, |
|
78 |
|
79 /** An array defining a polyline/polygon has too few points. |
|
80 */ |
|
81 EDirectGdiPanicInvalidPointArray = 27, |
|
82 |
|
83 /** RSgImage::GetPixelFormats() returns pixel count = 0. |
|
84 */ |
|
85 EDirectGdiPanicNoValidPixelFormats = 29, |
|
86 |
|
87 /** Open count error in CDirectGdiDrawableRef::Close(). |
|
88 */ |
|
89 EDirectGdiPanicDrawableRefCountError = 30, |
|
90 |
|
91 /** Attempt to get a handle to a drawable resource using CDirectGdiDriverImpl::GetImageTargetFromHandle(), |
|
92 * CDirectGdiDriverImpl::GetImageSourceFromHandle(), CDirectGdiDriverImpl::GetDrawableSourceFromHandle() |
|
93 * or CSwDirectGdiDriverImpl::FindImageTargetImpl() failed. |
|
94 */ |
|
95 EDirectGdiPanicResourceHandleNotFound = 32, |
|
96 |
|
97 /** Driver Process State has not been initialised. |
|
98 */ |
|
99 EDirectGdiPanicProcessStateNotInitialized = 33, |
|
100 |
|
101 /** Attempt to activate a target in CVgEngine::Activate() or CSwDirectGdiEngine::Activate() with a NULL handle. |
|
102 */ |
|
103 EDirectGdiPanicActivateWithNullHandle = 34, |
|
104 |
|
105 /** Unable to initialise a display. |
|
106 */ |
|
107 EDirectGdiPanicInitializeDisplay = 35, |
|
108 |
|
109 /** No display to which graphics are drawn. |
|
110 */ |
|
111 EDirectGdiPanicNoDisplay = 36, |
|
112 |
|
113 /** Unable to close a drawable handle. |
|
114 */ |
|
115 EDirectGdiPanicCloseDrawableHandleFailure = 37, |
|
116 |
|
117 /** Attempt to destroy a NULL engine in CDirectGdiDriverImpl::DestroyEngine(). |
|
118 */ |
|
119 EDirectGdiPanicDestroyNullEngine = 38, |
|
120 |
|
121 /** Attempt to activate a NULL target in CDirectGdiDriverImpl::Activate(). |
|
122 */ |
|
123 EDirectGdiPanicNullTargetActivate = 39, |
|
124 |
|
125 /** Failed to find a config for a particular pixel type. |
|
126 */ |
|
127 EDirectGdiPanicNoConfigFound = 41, |
|
128 |
|
129 /** Failed to create a drawing surface. |
|
130 */ |
|
131 EDirectGdiPanicNoDrawingSurface = 42, |
|
132 |
|
133 /** Failed to create a drawing context. |
|
134 */ |
|
135 EDirectGdiPanicNoContext = 43, |
|
136 |
|
137 /** Attempt to delete a CDirectGdiDrawableRef object when its reference count is non-zero. |
|
138 */ |
|
139 EDirectGdiPanicDrawableRefDestructorError = 44, |
|
140 |
|
141 /** A driver was closed while some drawable items were still in the drawable array. |
|
142 */ |
|
143 EDirectGdiPanicItemsLeftInImageArray = 45, |
|
144 |
|
145 /** Inconsistency in internal data of glyph cache structure. |
|
146 */ |
|
147 EDirectGdiPanicGlyphCacheDataInconsistent = 46, |
|
148 |
|
149 /** Valid reference to image source not found. |
|
150 */ |
|
151 EDirectGdiPanicImageSourceNotFound = 47, |
|
152 |
|
153 /** An invalid image handle was passed to the CImageSourceData constructor. |
|
154 */ |
|
155 EDirectGdiPanicImageSourceDataConstructorError = 48, |
|
156 |
|
157 /** The reference count was not zero in the destructor of CImageSourceData. |
|
158 */ |
|
159 EDirectGdiPanicImageSourceDataRefCountError = 49, |
|
160 |
|
161 /** The instance count was not zero in the destructor of CDirectGdiDriverProcessState. |
|
162 */ |
|
163 EDirectGdiPanicProcessStateInstanceCountError = 50, |
|
164 |
|
165 /** The image count was not zero in the destructor of CDirectGdiDriverProcessState. |
|
166 */ |
|
167 EDirectGdiPanicProcessStateImageCountError = 51, |
|
168 |
|
169 /** This panic only occurs when _DEBUG_DIRECTGDI is defined. One of the methods in |
|
170 CDirectGdiDriverProcessState was called without the image's mutex being held. |
|
171 */ |
|
172 EDirectGdiPanicImageMutexError = 52, |
|
173 |
|
174 /** Attempt to activate a target in CSwDirectGdiEngine::Activate() with a NULL draw device. |
|
175 */ |
|
176 EDirectGdiPanicActivateWithNullDrawDevice = 53, |
|
177 |
|
178 /** Attempt to deactive a NULL target in CDirectGdiDriverImpl. |
|
179 */ |
|
180 EDirectGdiPanicNullTargetDeactivate = 55, |
|
181 |
|
182 /** This panic occurs when DrawGlyph is called on an unsupported glyph bitmap type. |
|
183 */ |
|
184 EDirectGdiPanicInvalidGlyphBitmapType = 56, |
|
185 |
|
186 /** Attempt to create a new image source/drawable source using a handle that already has |
|
187 an image source/drawable source associated with it. |
|
188 */ |
|
189 EDirectGdiPanicSourceHandleNotNull = 57, |
|
190 |
|
191 /** Attempt to create a new image target using a handle that is already has an image target associated with it. |
|
192 */ |
|
193 EDirectGdiPanicTargetHandleNotNull = 58, |
|
194 |
|
195 /** An egl Api returned a failure. The actual egl error code is reported in the log. |
|
196 */ |
|
197 EEglApiFailure = 59, |
|
198 |
|
199 /** In a call to DestroyEngine(), the engine could not be found in the internal list of engines. |
|
200 */ |
|
201 EDirectGdiPanicEngineNotFound = 60, |
|
202 |
|
203 /** Glyph image storage was not created. |
|
204 */ |
|
205 EDirectGdiPanicGlyphImageStorageNotCreated = 61, |
|
206 |
|
207 /** Pen end cap style expected to be rounded, but found not to be. |
|
208 */ |
|
209 EDirectGdiPanicPenEndCapStyleNotRound = 62, |
|
210 |
|
211 /** eglWaitClient error. |
|
212 */ |
|
213 EDirectGdiPanicFinish = 63, |
|
214 |
|
215 /** An error code from vgGetError which is caused by incorrect usage of OpenVG. |
|
216 */ |
|
217 EDirectGdiPanicVgError = 64, |
|
218 |
|
219 /** Whilst performing a Clear() the clear-brush is not a recognised paint brush. |
|
220 */ |
|
221 EDirectGdiPanicClearBrushInvalid = 65, |
|
222 |
|
223 /** Panic codes corresponding to the old BitGdi codes (+1000). |
|
224 Any more panic codes from BitGDI generic DirectGDI should be added in this section. |
|
225 */ |
|
226 EDirectGdiPanicInvalidParameter = 1006, |
|
227 EDirectGdiPanicInvalidDisplayMode = 1009, |
|
228 |
|
229 /** Attempt to draw outside of clipping region. |
|
230 */ |
|
231 EDirectGdiPanicOutOfBounds = 1013, |
|
232 EDirectGdiPanicPolygonFiller = 1015, |
|
233 EDirectGdiPanicZeroLength = 1016, |
|
234 EDirectGdiPanicInvalidPointer = 1018, |
|
235 EDirectGdiPanicInvalidArg = 1021, |
|
236 EDirectGdiPanicNegativeShift = 1022, |
|
237 |
|
238 /** |
|
239 This panic may occur if MOutlineAndShadowBlend interface is not implemented, or |
|
240 the MSgImage_Sw interface is not implemented on RSgImage. |
|
241 */ |
|
242 EDirectGdiPanicInvalidInterfaceHandle = 1023, |
|
243 // End of panic codes corresponding to the old BitGDI codes. |
|
244 }; |
|
245 |
|
246 /** |
|
247 Log current eglGetError() to the debug stream, along with line number and source file name. |
|
248 This must be #defined so that we retain the line and source file information at the |
|
249 point in which LogEglError() is invoked. |
|
250 */ |
|
251 #ifdef _DEBUG |
|
252 #define LogEglError() {TBuf16<256> message; message.Format(_L16("EGL Error: %x\n"), eglGetError()); GRAPHICS_LOGD_DEBUG(message);} |
|
253 #else |
|
254 #define LogEglError() {} |
|
255 #endif //_DEBUG |
|
256 |
|
257 #endif /*DIRECTGDIADAPTER_H*/ |
|
258 |
|
259 |