|
1 // Copyright (c) 2010 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 #ifdef WIN32 |
|
17 #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers |
|
18 #include <windows.h> |
|
19 #endif |
|
20 |
|
21 #include <stdio.h> |
|
22 #include <stdlib.h> |
|
23 #include <vg/openvg.h> |
|
24 #include <EGL/egl.h> |
|
25 #include "KhronosAPIWrapper.h" |
|
26 #include "serializedfunctioncall.h" |
|
27 #include "remotefunctioncall.h" |
|
28 #include "openvgrfc.h" |
|
29 #include "graphicsvhwcallback.h" //callback interface Wrapper=>Virtual HW |
|
30 #include "serialisedapiuids.h" |
|
31 #include "openvgapiwrapper.h" |
|
32 #include "khronosapiwrapperdefs.h" |
|
33 #include "driverapiwrapper.h" //For calling the sync functions |
|
34 |
|
35 int OpenVGAPIWrapper::vgePathCoordsSizeInBytes() |
|
36 { |
|
37 VGPath dstPath; |
|
38 m_currentFunctionCall.GetParamValue( dstPath, 0 ); |
|
39 VGint startIndex; |
|
40 m_currentFunctionCall.GetParamValue( startIndex, 1 ); |
|
41 VGint numSegments; |
|
42 m_currentFunctionCall.GetParamValue( numSegments, 2 ); |
|
43 if ( !vgePathCoordsSizeInBytesPtr ) |
|
44 { |
|
45 vgePathCoordsSizeInBytesPtr = (vgePathCoordsSizeInBytesPtrType)::eglGetProcAddress("vgePathCoordsSizeInBytes"); |
|
46 } |
|
47 if ( vgePathCoordsSizeInBytesPtr ) |
|
48 { |
|
49 VGint ret = vgePathCoordsSizeInBytesPtr( dstPath, startIndex, numSegments ); |
|
50 m_currentFunctionCall.SetReturnValue( (TUint32)ret ); |
|
51 } |
|
52 else |
|
53 { |
|
54 m_currentFunctionCall.SetReturnValue( (TUint32)(-1) ); |
|
55 } |
|
56 |
|
57 return WriteReply(); |
|
58 } |
|
59 |
|
60 int OpenVGAPIWrapper::vgCreatePaint() |
|
61 { |
|
62 VGPaint paint = ::vgCreatePaint(); |
|
63 m_currentFunctionCall.SetReturnValue((TUint32)paint); |
|
64 return WriteReply(); |
|
65 } |
|
66 |
|
67 |
|
68 int OpenVGAPIWrapper::vgDestroyPaint() |
|
69 { |
|
70 VGPaint paint; |
|
71 m_currentFunctionCall.GetParamValue( paint, 0 ); |
|
72 ::vgDestroyPaint( paint ); |
|
73 return WriteReply(); |
|
74 } |
|
75 |
|
76 |
|
77 int OpenVGAPIWrapper::vgSetPaint() |
|
78 { |
|
79 VGPaint paint; |
|
80 m_currentFunctionCall.GetParamValue( paint, 0 ); |
|
81 VGbitfield paintModes; |
|
82 m_currentFunctionCall.GetParamValue( paintModes, 1 ); |
|
83 ::vgSetPaint(paint, paintModes); |
|
84 return WriteReply(); |
|
85 } |
|
86 |
|
87 |
|
88 int OpenVGAPIWrapper::vgSetParameteri() |
|
89 { |
|
90 VGHandle object; |
|
91 m_currentFunctionCall.GetParamValue( object, 0 ); |
|
92 VGint paramType; |
|
93 m_currentFunctionCall.GetParamValue( paramType, 1 ); |
|
94 VGint value; |
|
95 m_currentFunctionCall.GetParamValue( value, 2 ); |
|
96 ::vgSetParameteri(object, paramType, value); |
|
97 return WriteReply(); |
|
98 } |
|
99 |
|
100 |
|
101 int OpenVGAPIWrapper::vgSetParameterf() |
|
102 { |
|
103 VGHandle object; |
|
104 m_currentFunctionCall.GetParamValue( object, 0 ); |
|
105 VGint paramType; |
|
106 m_currentFunctionCall.GetParamValue( paramType, 1 ); |
|
107 VGfloat value; |
|
108 m_currentFunctionCall.GetParamValue( value, 2 ); |
|
109 ::vgSetParameterf(object, paramType, value); |
|
110 return WriteReply(); |
|
111 } |
|
112 |
|
113 |
|
114 int OpenVGAPIWrapper::vgSetParameterfv() |
|
115 { |
|
116 VGHandle object; |
|
117 m_currentFunctionCall.GetParamValue( object, 0 ); |
|
118 VGint paramType; |
|
119 m_currentFunctionCall.GetParamValue( paramType, 1 ); |
|
120 VGint count; |
|
121 m_currentFunctionCall.GetParamValue( count, 2 ); |
|
122 VGfloat * values; |
|
123 TInt size; |
|
124 m_currentFunctionCall.GetVectorData( values, size, 3 ); |
|
125 |
|
126 ::vgSetParameterfv(object, paramType, count, values); |
|
127 return WriteReply(); |
|
128 } |
|
129 |
|
130 int OpenVGAPIWrapper::vgCreatePath() |
|
131 { |
|
132 VGint pathFormat; |
|
133 m_currentFunctionCall.GetParamValue( pathFormat, 0 ); |
|
134 |
|
135 VGPathDatatype datatype; |
|
136 m_currentFunctionCall.GetParamValue( datatype, 1 ); |
|
137 |
|
138 VGfloat scale; |
|
139 m_currentFunctionCall.GetParamValue( scale, 2 ); |
|
140 |
|
141 VGfloat bias; |
|
142 m_currentFunctionCall.GetParamValue( bias, 3 ); |
|
143 |
|
144 VGint segmentCapacityHint; |
|
145 m_currentFunctionCall.GetParamValue( segmentCapacityHint, 4 ); |
|
146 |
|
147 VGint coordCapacityHint; |
|
148 m_currentFunctionCall.GetParamValue( coordCapacityHint, 5 ); |
|
149 |
|
150 VGbitfield capabilities; |
|
151 m_currentFunctionCall.GetParamValue( capabilities, 6 ); |
|
152 |
|
153 VGPath path = ::vgCreatePath( pathFormat, datatype, scale, bias, segmentCapacityHint, coordCapacityHint, capabilities); |
|
154 m_currentFunctionCall.SetReturnValue((TUint32)path); |
|
155 return WriteReply(); |
|
156 |
|
157 } |
|
158 |
|
159 int OpenVGAPIWrapper::vgDrawPath() |
|
160 { |
|
161 VGPath path; |
|
162 m_currentFunctionCall.GetParamValue( path, 0 ); |
|
163 |
|
164 VGbitfield paintModes; |
|
165 m_currentFunctionCall.GetParamValue( paintModes, 1 ); |
|
166 |
|
167 ::vgDrawPath( path, paintModes ); |
|
168 return WriteReply(); |
|
169 } |
|
170 |
|
171 int OpenVGAPIWrapper::vgDestroyPath() |
|
172 { |
|
173 VGPath path; |
|
174 m_currentFunctionCall.GetParamValue( path, 0 ); |
|
175 |
|
176 ::vgDestroyPath(path); |
|
177 return WriteReply(); |
|
178 } |
|
179 |
|
180 |
|
181 int OpenVGAPIWrapper::vgAppendPathData() |
|
182 { |
|
183 VGPath dstPath; |
|
184 m_currentFunctionCall.GetParamValue( dstPath, 0 ); |
|
185 VGint numSegments; |
|
186 m_currentFunctionCall.GetParamValue( numSegments, 1 ); |
|
187 VGubyte * pathSegments; |
|
188 TInt size; |
|
189 m_currentFunctionCall.GetVectorData( pathSegments, size, 2 ); |
|
190 |
|
191 void * pathData; |
|
192 m_currentFunctionCall.GetVectorData( pathData, size, 3 ); |
|
193 |
|
194 ::vgAppendPathData( dstPath, numSegments, pathSegments, pathData ); |
|
195 return WriteReply(); |
|
196 } |
|
197 |
|
198 |
|
199 int OpenVGAPIWrapper::vgGetError() |
|
200 { |
|
201 VGErrorCode error = ::vgGetError(); |
|
202 m_currentFunctionCall.SetReturnValue((TUint32)error); |
|
203 return WriteReply(); |
|
204 } |
|
205 |
|
206 |
|
207 int OpenVGAPIWrapper::vgSeti() |
|
208 { |
|
209 VGParamType type; |
|
210 m_currentFunctionCall.GetParamValue( type, 0 ); |
|
211 VGint value; |
|
212 m_currentFunctionCall.GetParamValue( value, 1 ); |
|
213 ::vgSeti( type, value); |
|
214 return WriteReply(); |
|
215 } |
|
216 |
|
217 |
|
218 int OpenVGAPIWrapper::vgSetf() |
|
219 { |
|
220 VGParamType type; |
|
221 m_currentFunctionCall.GetParamValue( type, 0 ); |
|
222 VGfloat value; |
|
223 m_currentFunctionCall.GetParamValue( value, 1 ); |
|
224 ::vgSetf( type, value ); |
|
225 return WriteReply(); |
|
226 } |
|
227 |
|
228 |
|
229 int OpenVGAPIWrapper::vgSetfv() |
|
230 { |
|
231 VGParamType type; |
|
232 m_currentFunctionCall.GetParamValue( type, 0 ); |
|
233 VGint count; |
|
234 m_currentFunctionCall.GetParamValue( count, 1 ); |
|
235 VGfloat * values; |
|
236 TInt size; |
|
237 m_currentFunctionCall.GetVectorData( values, size, 2 ); |
|
238 ::vgSetfv( type, count, values); |
|
239 return WriteReply(); |
|
240 } |
|
241 |
|
242 |
|
243 int OpenVGAPIWrapper::vgClear() |
|
244 { |
|
245 VGint x; |
|
246 m_currentFunctionCall.GetParamValue( x, 0 ); |
|
247 VGint y; |
|
248 m_currentFunctionCall.GetParamValue( y, 1 ); |
|
249 VGint width; |
|
250 m_currentFunctionCall.GetParamValue( width, 2 ); |
|
251 VGint height; |
|
252 m_currentFunctionCall.GetParamValue( height, 3 ); |
|
253 ::vgClear( x, y, width, height ); |
|
254 return WriteReply(); |
|
255 } |
|
256 |
|
257 |
|
258 int OpenVGAPIWrapper::vgLoadIdentity() |
|
259 { |
|
260 ::vgLoadIdentity(); |
|
261 return WriteReply(); |
|
262 } |
|
263 |
|
264 |
|
265 int OpenVGAPIWrapper::vgRotate() |
|
266 { |
|
267 VGfloat angle; |
|
268 m_currentFunctionCall.GetParamValue( angle, 0 ); |
|
269 ::vgRotate( angle ); |
|
270 return WriteReply(); |
|
271 } |
|
272 |
|
273 |
|
274 int OpenVGAPIWrapper::vgScale() |
|
275 { |
|
276 VGfloat sx; |
|
277 m_currentFunctionCall.GetParamValue( sx, 0 ); |
|
278 VGfloat sy; |
|
279 m_currentFunctionCall.GetParamValue( sy, 1 ); |
|
280 ::vgScale( sx, sy ); |
|
281 return WriteReply(); |
|
282 } |
|
283 |
|
284 |
|
285 int OpenVGAPIWrapper::vgTranslate() |
|
286 { |
|
287 VGfloat tx; |
|
288 m_currentFunctionCall.GetParamValue( tx, 0 ); |
|
289 VGfloat ty; |
|
290 m_currentFunctionCall.GetParamValue( ty, 1 ); |
|
291 ::vgTranslate( tx, ty ); |
|
292 return WriteReply(); |
|
293 } |
|
294 |
|
295 |
|
296 int OpenVGAPIWrapper::vgReadPixels() |
|
297 { |
|
298 VGint dataStride; |
|
299 m_currentFunctionCall.GetParamValue( dataStride, 1 ); |
|
300 VGImageFormat dataFormat; |
|
301 m_currentFunctionCall.GetParamValue( dataFormat, 2 ); |
|
302 VGint sx; |
|
303 m_currentFunctionCall.GetParamValue( sx, 3 ); |
|
304 VGint sy; |
|
305 m_currentFunctionCall.GetParamValue( sy, 4 ); |
|
306 VGint width; |
|
307 m_currentFunctionCall.GetParamValue( width, 5 ); |
|
308 VGint height; |
|
309 m_currentFunctionCall.GetParamValue( height, 6 ); |
|
310 VGint pixmapSize; |
|
311 m_currentFunctionCall.GetParamValue(pixmapSize, 7); |
|
312 |
|
313 void *dataBuffer = iStack->AllocFromStack(pixmapSize, 4); |
|
314 |
|
315 ::vgReadPixels( dataBuffer, dataStride, dataFormat, sx, sy, width, height ); |
|
316 m_currentFunctionCall.SetVectorData( dataBuffer, pixmapSize, 0 ); |
|
317 int ret = WriteReply(); |
|
318 iStack->ClearStack(); |
|
319 dataBuffer = NULL; |
|
320 return ret; |
|
321 } |
|
322 |
|
323 |
|
324 int OpenVGAPIWrapper::vgFlush() |
|
325 { |
|
326 ::vgFlush(); |
|
327 return WriteReply(); |
|
328 } |
|
329 |
|
330 |
|
331 int OpenVGAPIWrapper::vgFinish() |
|
332 { |
|
333 ::vgFinish(); |
|
334 return WriteReply(); |
|
335 } |
|
336 |
|
337 |
|
338 int OpenVGAPIWrapper::vgSetiv() |
|
339 { |
|
340 VGParamType type; |
|
341 m_currentFunctionCall.GetParamValue( type, 0 ); |
|
342 VGint count; |
|
343 m_currentFunctionCall.GetParamValue( count, 1 ); |
|
344 VGint * values; |
|
345 TInt size; |
|
346 m_currentFunctionCall.GetVectorData( values, size, 2 ); |
|
347 ::vgSetiv( type, count, values); |
|
348 return WriteReply(); |
|
349 } |
|
350 |
|
351 |
|
352 int OpenVGAPIWrapper::vgGetf() |
|
353 { |
|
354 VGParamType type; |
|
355 m_currentFunctionCall.GetParamValue( type, 0 ); |
|
356 VGfloat ret = ::vgGetf( type ); |
|
357 m_currentFunctionCall.SetReturnValue( (TUint32)ret ); |
|
358 return WriteReply(); |
|
359 } |
|
360 |
|
361 |
|
362 int OpenVGAPIWrapper::vgGeti() |
|
363 { |
|
364 VGParamType type; |
|
365 m_currentFunctionCall.GetParamValue( type, 0 ); |
|
366 VGint ret = ::vgGeti( type ); |
|
367 m_currentFunctionCall.SetReturnValue( (TUint32)ret ); |
|
368 return WriteReply(); |
|
369 } |
|
370 |
|
371 |
|
372 int OpenVGAPIWrapper::vgGetVectorSize() |
|
373 { |
|
374 VGParamType type; |
|
375 m_currentFunctionCall.GetParamValue( type, 0 ); |
|
376 VGint ret = ::vgGetVectorSize( type ); |
|
377 m_currentFunctionCall.SetReturnValue( (TUint32)ret ); |
|
378 return WriteReply(); |
|
379 } |
|
380 |
|
381 |
|
382 int OpenVGAPIWrapper::vgGetParameterf() |
|
383 { |
|
384 VGHandle object; |
|
385 m_currentFunctionCall.GetParamValue( object, 0 ); |
|
386 VGint paramType; |
|
387 m_currentFunctionCall.GetParamValue( paramType, 1 ); |
|
388 VGfloat ret = ::vgGetParameterf( object, paramType ); |
|
389 m_currentFunctionCall.SetReturnValue( (TUint32)ret ); |
|
390 return WriteReply(); |
|
391 } |
|
392 |
|
393 |
|
394 int OpenVGAPIWrapper::vgGetParameteri() |
|
395 { |
|
396 VGHandle object; |
|
397 m_currentFunctionCall.GetParamValue( object, 0 ); |
|
398 VGint paramType; |
|
399 m_currentFunctionCall.GetParamValue( paramType, 1 ); |
|
400 VGint ret = ::vgGetParameteri( object, paramType ); |
|
401 m_currentFunctionCall.SetReturnValue( (TUint32)ret ); |
|
402 return WriteReply(); |
|
403 } |
|
404 |
|
405 |
|
406 int OpenVGAPIWrapper::vgGetParameterVectorSize() |
|
407 { |
|
408 VGHandle object; |
|
409 m_currentFunctionCall.GetParamValue( object, 0 ); |
|
410 VGint paramType; |
|
411 m_currentFunctionCall.GetParamValue( paramType, 1 ); |
|
412 VGint ret = ::vgGetParameterVectorSize( object, paramType ); |
|
413 m_currentFunctionCall.SetReturnValue( (TUint32)ret ); |
|
414 return WriteReply(); |
|
415 } |
|
416 |
|
417 |
|
418 int OpenVGAPIWrapper::vgShear() |
|
419 { |
|
420 VGfloat shx; |
|
421 m_currentFunctionCall.GetParamValue( shx, 0 ); |
|
422 VGfloat shy; |
|
423 m_currentFunctionCall.GetParamValue( shy, 1 ); |
|
424 ::vgShear( shx, shy ); |
|
425 return WriteReply(); |
|
426 } |
|
427 |
|
428 |
|
429 int OpenVGAPIWrapper::vgMask() |
|
430 { |
|
431 VGHandle mask; |
|
432 m_currentFunctionCall.GetParamValue( mask, 0 ); |
|
433 VGMaskOperation operation; |
|
434 m_currentFunctionCall.GetParamValue( operation, 1 ); |
|
435 VGint x; |
|
436 m_currentFunctionCall.GetParamValue( x, 2 ); |
|
437 VGint y; |
|
438 m_currentFunctionCall.GetParamValue( y, 3 ); |
|
439 VGint width; |
|
440 m_currentFunctionCall.GetParamValue( width, 4 ); |
|
441 VGint height; |
|
442 m_currentFunctionCall.GetParamValue( height, 5 ); |
|
443 |
|
444 ::vgMask( mask, operation, x, y, width, height ); |
|
445 return WriteReply(); |
|
446 } |
|
447 |
|
448 |
|
449 int OpenVGAPIWrapper::vgRenderToMask() |
|
450 { |
|
451 VGPath path; |
|
452 m_currentFunctionCall.GetParamValue( path, 0 ); |
|
453 VGbitfield paintModes; |
|
454 m_currentFunctionCall.GetParamValue( paintModes, 1 ); |
|
455 VGMaskOperation operation; |
|
456 m_currentFunctionCall.GetParamValue( operation, 2 ); |
|
457 |
|
458 ::vgRenderToMask( path, paintModes, operation); |
|
459 return WriteReply(); |
|
460 } |
|
461 |
|
462 |
|
463 int OpenVGAPIWrapper::vgCreateMaskLayer() |
|
464 { |
|
465 VGint width; |
|
466 m_currentFunctionCall.GetParamValue( width, 0 ); |
|
467 VGint height; |
|
468 m_currentFunctionCall.GetParamValue( height, 1 ); |
|
469 ::vgCreateMaskLayer( width, height ); |
|
470 return WriteReply(); |
|
471 } |
|
472 |
|
473 |
|
474 int OpenVGAPIWrapper::vgDestroyMaskLayer() |
|
475 { |
|
476 VGMaskLayer maskLayer; |
|
477 m_currentFunctionCall.GetParamValue( maskLayer, 0 ); |
|
478 ::vgDestroyMaskLayer( maskLayer ); |
|
479 return WriteReply(); |
|
480 } |
|
481 |
|
482 |
|
483 int OpenVGAPIWrapper::vgFillMaskLayer() |
|
484 { |
|
485 VGMaskLayer maskLayer; |
|
486 m_currentFunctionCall.GetParamValue( maskLayer, 0 ); |
|
487 VGint x; |
|
488 m_currentFunctionCall.GetParamValue( x, 1 ); |
|
489 VGint y; |
|
490 m_currentFunctionCall.GetParamValue( y, 2 ); |
|
491 VGint width; |
|
492 m_currentFunctionCall.GetParamValue( width, 3 ); |
|
493 VGint height; |
|
494 m_currentFunctionCall.GetParamValue( height, 4 ); |
|
495 VGfloat value; |
|
496 m_currentFunctionCall.GetParamValue( value, 5 ); |
|
497 |
|
498 ::vgFillMaskLayer( maskLayer, x, y, |
|
499 width, height, value ); |
|
500 return WriteReply(); |
|
501 } |
|
502 |
|
503 |
|
504 int OpenVGAPIWrapper::vgCopyMask() |
|
505 { |
|
506 VGMaskLayer maskLayer; |
|
507 m_currentFunctionCall.GetParamValue( maskLayer, 0 ); |
|
508 VGint sx; |
|
509 m_currentFunctionCall.GetParamValue( sx, 1 ); |
|
510 VGint sy; |
|
511 m_currentFunctionCall.GetParamValue( sy, 2 ); |
|
512 VGint dx; |
|
513 m_currentFunctionCall.GetParamValue( dx, 3 ); |
|
514 VGint dy; |
|
515 m_currentFunctionCall.GetParamValue( dy, 4 ); |
|
516 VGint width; |
|
517 m_currentFunctionCall.GetParamValue( width, 5 ); |
|
518 VGint height; |
|
519 m_currentFunctionCall.GetParamValue( height, 6 ); |
|
520 |
|
521 ::vgCopyMask( maskLayer, sx, sy, dx, dy, |
|
522 width, height ); |
|
523 return WriteReply(); |
|
524 } |
|
525 |
|
526 |
|
527 int OpenVGAPIWrapper::vgClearPath() |
|
528 { |
|
529 VGPath path; |
|
530 m_currentFunctionCall.GetParamValue( path, 0 ); |
|
531 VGbitfield capabilities; |
|
532 m_currentFunctionCall.GetParamValue( capabilities, 1 ); |
|
533 |
|
534 ::vgClearPath( path, capabilities ); |
|
535 return WriteReply(); |
|
536 } |
|
537 |
|
538 |
|
539 int OpenVGAPIWrapper::vgRemovePathCapabilities() |
|
540 { |
|
541 VGPath path; |
|
542 m_currentFunctionCall.GetParamValue( path, 0 ); |
|
543 VGbitfield capabilities; |
|
544 m_currentFunctionCall.GetParamValue( capabilities, 1 ); |
|
545 ::vgRemovePathCapabilities( path, capabilities ); |
|
546 return WriteReply(); |
|
547 } |
|
548 |
|
549 |
|
550 int OpenVGAPIWrapper::vgGetPathCapabilities() |
|
551 { |
|
552 VGPath path; |
|
553 m_currentFunctionCall.GetParamValue( path, 0 ); |
|
554 VGbitfield ret = ::vgGetPathCapabilities( path ); |
|
555 m_currentFunctionCall.SetReturnValue( (TUint32)ret ); |
|
556 return WriteReply(); |
|
557 } |
|
558 |
|
559 |
|
560 int OpenVGAPIWrapper::vgAppendPath() |
|
561 { |
|
562 VGPath dstPath; |
|
563 m_currentFunctionCall.GetParamValue( dstPath, 0 ); |
|
564 VGPath srcPath; |
|
565 m_currentFunctionCall.GetParamValue( srcPath, 1 ); |
|
566 ::vgAppendPath( dstPath, srcPath ); |
|
567 return WriteReply(); |
|
568 } |
|
569 |
|
570 |
|
571 int OpenVGAPIWrapper::vgTransformPath() |
|
572 { |
|
573 VGPath dstPath; |
|
574 m_currentFunctionCall.GetParamValue( dstPath, 0 ); |
|
575 VGPath srcPath; |
|
576 m_currentFunctionCall.GetParamValue( srcPath, 1 ); |
|
577 ::vgTransformPath( dstPath, srcPath ); |
|
578 return WriteReply(); |
|
579 } |
|
580 |
|
581 |
|
582 int OpenVGAPIWrapper::vgInterpolatePath() |
|
583 { |
|
584 VGPath dstPath; |
|
585 m_currentFunctionCall.GetParamValue( dstPath, 0 ); |
|
586 VGPath startPath; |
|
587 m_currentFunctionCall.GetParamValue( startPath, 1 ); |
|
588 VGPath endPath; |
|
589 m_currentFunctionCall.GetParamValue( endPath, 2 ); |
|
590 VGfloat amount; |
|
591 m_currentFunctionCall.GetParamValue( amount, 3 ); |
|
592 |
|
593 ::vgInterpolatePath( dstPath, startPath, endPath, amount ); |
|
594 return WriteReply(); |
|
595 } |
|
596 |
|
597 |
|
598 int OpenVGAPIWrapper::vgPathLength() |
|
599 { |
|
600 VGPath path; |
|
601 m_currentFunctionCall.GetParamValue( path, 0 ); |
|
602 VGint startSegment; |
|
603 m_currentFunctionCall.GetParamValue( startSegment, 1 ); |
|
604 VGint numSegments; |
|
605 m_currentFunctionCall.GetParamValue( numSegments, 2 ); |
|
606 |
|
607 VGfloat ret = ::vgPathLength( path, startSegment, numSegments ); |
|
608 m_currentFunctionCall.SetReturnValue( (TUint32)ret ); |
|
609 return WriteReply(); |
|
610 } |
|
611 |
|
612 |
|
613 int OpenVGAPIWrapper::vgGetPaint() |
|
614 { |
|
615 VGPaintMode paintMode; |
|
616 m_currentFunctionCall.GetParamValue( paintMode, 0 ); |
|
617 VGPaint ret = ::vgGetPaint( paintMode ); |
|
618 m_currentFunctionCall.SetReturnValue( (TUint32)ret ); |
|
619 return WriteReply(); |
|
620 } |
|
621 |
|
622 |
|
623 int OpenVGAPIWrapper::vgSetColor() |
|
624 { |
|
625 VGPaint paint; |
|
626 m_currentFunctionCall.GetParamValue( paint, 0 ); |
|
627 VGuint rgba; |
|
628 m_currentFunctionCall.GetParamValue( rgba, 1 ); |
|
629 |
|
630 ::vgSetColor( paint, rgba ); |
|
631 return WriteReply(); |
|
632 } |
|
633 |
|
634 |
|
635 int OpenVGAPIWrapper::vgGetColor() |
|
636 { |
|
637 VGPaint paint; |
|
638 m_currentFunctionCall.GetParamValue( paint, 0 ); |
|
639 VGuint ret = ::vgGetColor( paint ); |
|
640 m_currentFunctionCall.SetReturnValue( (TUint32)ret ); |
|
641 return WriteReply(); |
|
642 } |
|
643 |
|
644 |
|
645 int OpenVGAPIWrapper::vgPaintPattern() |
|
646 { |
|
647 VGPaint paint; |
|
648 m_currentFunctionCall.GetParamValue( paint, 0 ); |
|
649 VGImage pattern; |
|
650 m_currentFunctionCall.GetParamValue( pattern, 1 ); |
|
651 |
|
652 ::vgPaintPattern( paint, pattern ); |
|
653 return WriteReply(); |
|
654 } |
|
655 |
|
656 |
|
657 int OpenVGAPIWrapper::vgCreateImage() |
|
658 { |
|
659 VGImageFormat format; |
|
660 m_currentFunctionCall.GetParamValue( format, 0 ); |
|
661 VGint width; |
|
662 m_currentFunctionCall.GetParamValue( width, 1 ); |
|
663 VGint height; |
|
664 m_currentFunctionCall.GetParamValue( height, 2 ); |
|
665 VGbitfield allowedQuality; |
|
666 m_currentFunctionCall.GetParamValue( allowedQuality, 3 ); |
|
667 |
|
668 VGImage ret = ::vgCreateImage( format, width, height, allowedQuality ); |
|
669 m_currentFunctionCall.SetReturnValue( (TUint32)ret ); |
|
670 return WriteReply(); |
|
671 } |
|
672 |
|
673 |
|
674 int OpenVGAPIWrapper::vgDestroyImage() |
|
675 { |
|
676 VGImage image; |
|
677 m_currentFunctionCall.GetParamValue( image, 0 ); |
|
678 ::vgDestroyImage( image ); |
|
679 return WriteReply(); |
|
680 } |
|
681 |
|
682 |
|
683 int OpenVGAPIWrapper::vgClearImage() |
|
684 { |
|
685 VGImage image; |
|
686 m_currentFunctionCall.GetParamValue( image, 0 ); |
|
687 VGint x; |
|
688 m_currentFunctionCall.GetParamValue( x, 1 ); |
|
689 VGint y; |
|
690 m_currentFunctionCall.GetParamValue( y, 2 ); |
|
691 VGint width; |
|
692 m_currentFunctionCall.GetParamValue( width, 3 ); |
|
693 VGint height; |
|
694 m_currentFunctionCall.GetParamValue( height, 4 ); |
|
695 |
|
696 doSync( 5, image ); |
|
697 |
|
698 ::vgClearImage( image, x, y, width, height ); |
|
699 return WriteReply(); |
|
700 } |
|
701 |
|
702 |
|
703 int OpenVGAPIWrapper::vgChildImage() |
|
704 { |
|
705 VGImage parent; |
|
706 m_currentFunctionCall.GetParamValue( parent, 0 ); |
|
707 VGint x; |
|
708 m_currentFunctionCall.GetParamValue( x, 1 ); |
|
709 VGint y; |
|
710 m_currentFunctionCall.GetParamValue( y, 2 ); |
|
711 VGint width; |
|
712 m_currentFunctionCall.GetParamValue( width, 3 ); |
|
713 VGint height; |
|
714 m_currentFunctionCall.GetParamValue( height, 4 ); |
|
715 VGImage ret = ::vgChildImage( parent, x, y, width, height ); |
|
716 m_currentFunctionCall.SetReturnValue( (TUint32)ret ); |
|
717 return WriteReply(); |
|
718 } |
|
719 |
|
720 |
|
721 int OpenVGAPIWrapper::vgGetParent() |
|
722 { |
|
723 VGImage image; |
|
724 m_currentFunctionCall.GetParamValue( image, 0 ); |
|
725 VGImage ret = ::vgGetParent( image ); |
|
726 m_currentFunctionCall.SetReturnValue( (TUint32)ret ); |
|
727 return WriteReply(); |
|
728 } |
|
729 |
|
730 |
|
731 int OpenVGAPIWrapper::vgCopyImage() |
|
732 { |
|
733 VGImage dst; |
|
734 m_currentFunctionCall.GetParamValue( dst, 0 ); |
|
735 VGint dx; |
|
736 m_currentFunctionCall.GetParamValue( dx, 1 ); |
|
737 VGint dy; |
|
738 m_currentFunctionCall.GetParamValue( dy, 2 ); |
|
739 VGImage src; |
|
740 m_currentFunctionCall.GetParamValue( src, 3 ); |
|
741 VGint sx; |
|
742 m_currentFunctionCall.GetParamValue( sx, 4 ); |
|
743 VGint sy; |
|
744 m_currentFunctionCall.GetParamValue( sy, 5 ); |
|
745 VGint width; |
|
746 m_currentFunctionCall.GetParamValue( width, 6 ); |
|
747 VGint height; |
|
748 m_currentFunctionCall.GetParamValue( height, 7 ); |
|
749 VGboolean dither; |
|
750 m_currentFunctionCall.GetParamValue( dither, 8 ); |
|
751 |
|
752 doSync( 9, dst, src ); |
|
753 |
|
754 ::vgCopyImage( dst, dx, dy, src, sx, sy, width, height, dither ); |
|
755 return WriteReply(); |
|
756 } |
|
757 |
|
758 |
|
759 int OpenVGAPIWrapper::vgDrawImage() |
|
760 { |
|
761 VGImage image; |
|
762 m_currentFunctionCall.GetParamValue( image, 0 ); |
|
763 |
|
764 |
|
765 ::vgDrawImage( image ); |
|
766 return WriteReply(); |
|
767 } |
|
768 |
|
769 |
|
770 int OpenVGAPIWrapper::vgSetPixels() |
|
771 { |
|
772 VGint dx; |
|
773 m_currentFunctionCall.GetParamValue( dx, 0 ); |
|
774 VGint dy; |
|
775 m_currentFunctionCall.GetParamValue( dy, 1 ); |
|
776 VGImage src; |
|
777 m_currentFunctionCall.GetParamValue( src, 2 ); |
|
778 VGint sx; |
|
779 m_currentFunctionCall.GetParamValue( sx, 3 ); |
|
780 VGint sy; |
|
781 m_currentFunctionCall.GetParamValue( sy, 4 ); |
|
782 VGint width; |
|
783 m_currentFunctionCall.GetParamValue( width, 5 ); |
|
784 VGint height; |
|
785 m_currentFunctionCall.GetParamValue( height, 6 ); |
|
786 |
|
787 doSync( 7, src ); |
|
788 |
|
789 ::vgSetPixels( dx, dy, src, sx, sy, width, height ); |
|
790 return WriteReply(); |
|
791 } |
|
792 |
|
793 |
|
794 int OpenVGAPIWrapper::vgGetPixels() |
|
795 { |
|
796 VGImage dst; |
|
797 m_currentFunctionCall.GetParamValue( dst, 0 ); |
|
798 VGint dx; |
|
799 m_currentFunctionCall.GetParamValue( dx, 1 ); |
|
800 VGint dy; |
|
801 m_currentFunctionCall.GetParamValue( dy, 2 ); |
|
802 VGint sx; |
|
803 m_currentFunctionCall.GetParamValue( sx, 3 ); |
|
804 VGint sy; |
|
805 m_currentFunctionCall.GetParamValue( sy, 4 ); |
|
806 VGint width; |
|
807 m_currentFunctionCall.GetParamValue( width, 5 ); |
|
808 VGint height; |
|
809 m_currentFunctionCall.GetParamValue( height, 6 ); |
|
810 |
|
811 doSync( 7, dst ); |
|
812 |
|
813 ::vgGetPixels( dst, dx, dy, sx, sy, width, height ); |
|
814 return WriteReply(); |
|
815 } |
|
816 |
|
817 |
|
818 int OpenVGAPIWrapper::vgCopyPixels() |
|
819 { |
|
820 VGint dx; |
|
821 m_currentFunctionCall.GetParamValue( dx, 0 ); |
|
822 VGint dy; |
|
823 m_currentFunctionCall.GetParamValue( dy, 1 ); |
|
824 VGint sx; |
|
825 m_currentFunctionCall.GetParamValue( sx, 2 ); |
|
826 VGint sy; |
|
827 m_currentFunctionCall.GetParamValue( sy, 3 ); |
|
828 VGint width; |
|
829 m_currentFunctionCall.GetParamValue( width, 4 ); |
|
830 VGint height; |
|
831 m_currentFunctionCall.GetParamValue( height, 5 ); |
|
832 |
|
833 ::vgCopyPixels( dx, dy, sx, sy, width, height ); |
|
834 return WriteReply(); |
|
835 } |
|
836 |
|
837 |
|
838 int OpenVGAPIWrapper::vgCreateFont() |
|
839 { |
|
840 VGint glyphCapacityHint; |
|
841 m_currentFunctionCall.GetParamValue( glyphCapacityHint, 0 ); |
|
842 VGFont ret = ::vgCreateFont( glyphCapacityHint ); |
|
843 m_currentFunctionCall.SetReturnValue( (TUint32)ret ); |
|
844 return WriteReply(); |
|
845 } |
|
846 |
|
847 |
|
848 int OpenVGAPIWrapper::vgDestroyFont() |
|
849 { |
|
850 VGFont font; |
|
851 m_currentFunctionCall.GetParamValue( font, 0 ); |
|
852 ::vgDestroyFont( font ); |
|
853 return WriteReply(); |
|
854 } |
|
855 |
|
856 |
|
857 int OpenVGAPIWrapper::vgClearGlyph() |
|
858 { |
|
859 VGFont font; |
|
860 m_currentFunctionCall.GetParamValue( font, 0 ); |
|
861 VGuint glyphIndex; |
|
862 m_currentFunctionCall.GetParamValue( glyphIndex, 1 ); |
|
863 ::vgClearGlyph( font, glyphIndex ); |
|
864 return WriteReply(); |
|
865 } |
|
866 |
|
867 |
|
868 int OpenVGAPIWrapper::vgDrawGlyph() |
|
869 { |
|
870 VGFont font; |
|
871 m_currentFunctionCall.GetParamValue( font, 0 ); |
|
872 |
|
873 VGuint glyphIndex; |
|
874 m_currentFunctionCall.GetParamValue( glyphIndex, 1 ); |
|
875 |
|
876 VGbitfield paintModes; |
|
877 m_currentFunctionCall.GetParamValue( paintModes, 2 ); |
|
878 |
|
879 VGboolean allowAutoHinting; |
|
880 m_currentFunctionCall.GetParamValue( allowAutoHinting, 3 ); |
|
881 |
|
882 ::vgDrawGlyph( font, glyphIndex, paintModes, allowAutoHinting ); |
|
883 return WriteReply(); |
|
884 } |
|
885 |
|
886 |
|
887 int OpenVGAPIWrapper::vgGaussianBlur() |
|
888 { |
|
889 VGImage dst; |
|
890 m_currentFunctionCall.GetParamValue( dst, 0 ); |
|
891 VGImage src; |
|
892 m_currentFunctionCall.GetParamValue( src, 1 ); |
|
893 VGfloat stdDeviationX; |
|
894 m_currentFunctionCall.GetParamValue( stdDeviationX, 2 ); |
|
895 VGfloat stdDeviationY; |
|
896 m_currentFunctionCall.GetParamValue( stdDeviationY, 3 ); |
|
897 VGTilingMode tilingMode; |
|
898 m_currentFunctionCall.GetParamValue( tilingMode, 4 ); |
|
899 |
|
900 doSync( 5, dst, src ); |
|
901 |
|
902 ::vgGaussianBlur( dst, src, stdDeviationX, stdDeviationY, tilingMode ); |
|
903 return WriteReply(); |
|
904 } |
|
905 |
|
906 |
|
907 int OpenVGAPIWrapper::vgHardwareQuery() |
|
908 { |
|
909 VGHardwareQueryType key; |
|
910 m_currentFunctionCall.GetParamValue( key, 0 ); |
|
911 VGint setting; |
|
912 m_currentFunctionCall.GetParamValue( setting, 1 ); |
|
913 VGHardwareQueryResult ret =::vgHardwareQuery( key, setting ); |
|
914 m_currentFunctionCall.SetReturnValue( (TUint32)ret ); |
|
915 return WriteReply(); |
|
916 } |
|
917 |
|
918 |
|
919 int OpenVGAPIWrapper::vgWritePixels() |
|
920 { |
|
921 void* data; |
|
922 TInt size; |
|
923 m_currentFunctionCall.GetVectorData( data, size, 0 ); |
|
924 VGint dataStride; |
|
925 m_currentFunctionCall.GetParamValue( dataStride, 1 ); |
|
926 VGImageFormat dataFormat; |
|
927 m_currentFunctionCall.GetParamValue( dataFormat, 2 ); |
|
928 VGint dx; |
|
929 m_currentFunctionCall.GetParamValue( dx, 3 ); |
|
930 VGint dy; |
|
931 m_currentFunctionCall.GetParamValue( dy, 4 ); |
|
932 VGint width; |
|
933 m_currentFunctionCall.GetParamValue( width, 5 ); |
|
934 VGint height; |
|
935 m_currentFunctionCall.GetParamValue( height, 6 ); |
|
936 |
|
937 ::vgWritePixels( data, dataStride, dataFormat, dx, dy, width, height ); |
|
938 return WriteReply(); |
|
939 } |
|
940 |
|
941 |
|
942 int OpenVGAPIWrapper::vgImageSubData() |
|
943 { |
|
944 VGImage image; |
|
945 m_currentFunctionCall.GetParamValue( image, 0 ); |
|
946 void* data; |
|
947 TInt size; |
|
948 m_currentFunctionCall.GetVectorData( data, size, 1 ); |
|
949 VGint dataStride; |
|
950 m_currentFunctionCall.GetParamValue( dataStride, 2 ); |
|
951 VGImageFormat dataFormat; |
|
952 m_currentFunctionCall.GetParamValue( dataFormat, 3 ); |
|
953 VGint x; |
|
954 m_currentFunctionCall.GetParamValue( x, 4 ); |
|
955 VGint y; |
|
956 m_currentFunctionCall.GetParamValue( y, 5 ); |
|
957 VGint width; |
|
958 m_currentFunctionCall.GetParamValue( width, 6 ); |
|
959 VGint height; |
|
960 m_currentFunctionCall.GetParamValue( height, 7 ); |
|
961 |
|
962 doSync( 8, image ); |
|
963 |
|
964 ::vgImageSubData( image, data, dataStride, dataFormat, x, y, width, height ); |
|
965 return WriteReply(); |
|
966 } |
|
967 |
|
968 |
|
969 int OpenVGAPIWrapper::vgSetParameteriv() |
|
970 { |
|
971 VGHandle object; |
|
972 m_currentFunctionCall.GetParamValue( object, 0 ); |
|
973 VGint paramType; |
|
974 m_currentFunctionCall.GetParamValue( paramType, 1 ); |
|
975 VGint count; |
|
976 m_currentFunctionCall.GetParamValue( count, 2 ); |
|
977 VGint * values; |
|
978 TInt size; |
|
979 m_currentFunctionCall.GetVectorData( values, size, 3 ); |
|
980 |
|
981 ::vgSetParameteriv( object, paramType, count, values ); |
|
982 return WriteReply(); |
|
983 } |
|
984 |
|
985 |
|
986 int OpenVGAPIWrapper::vgLoadMatrix() |
|
987 { |
|
988 VGfloat * m; |
|
989 TInt size; |
|
990 m_currentFunctionCall.GetVectorData( m, size, 0 ); |
|
991 ::vgLoadMatrix( m ); |
|
992 return WriteReply(); |
|
993 } |
|
994 |
|
995 |
|
996 int OpenVGAPIWrapper::vgMultMatrix() |
|
997 { |
|
998 VGfloat * m; |
|
999 TInt size; |
|
1000 m_currentFunctionCall.GetVectorData( m, size, 0 ); |
|
1001 ::vgMultMatrix( m ); |
|
1002 return WriteReply(); |
|
1003 } |
|
1004 |
|
1005 |
|
1006 int OpenVGAPIWrapper::vgModifyPathCoords() |
|
1007 { |
|
1008 VGPath dstPath; |
|
1009 m_currentFunctionCall.GetParamValue( dstPath, 0 ); |
|
1010 VGint startIndex; |
|
1011 m_currentFunctionCall.GetParamValue( startIndex, 1 ); |
|
1012 VGint numSegments; |
|
1013 m_currentFunctionCall.GetParamValue( numSegments, 2 ); |
|
1014 void * pathData; |
|
1015 TInt size; |
|
1016 m_currentFunctionCall.GetVectorData( pathData, size, 3 ); |
|
1017 |
|
1018 ::vgModifyPathCoords( dstPath, startIndex, numSegments, pathData); |
|
1019 return WriteReply(); |
|
1020 } |
|
1021 |
|
1022 |
|
1023 int OpenVGAPIWrapper::vgSetGlyphToPath() |
|
1024 { |
|
1025 VGFont font; |
|
1026 m_currentFunctionCall.GetParamValue( font, 0 ); |
|
1027 VGuint glyphIndex; |
|
1028 m_currentFunctionCall.GetParamValue( glyphIndex, 1 ); |
|
1029 VGPath path; |
|
1030 m_currentFunctionCall.GetParamValue( path, 2 ); |
|
1031 VGboolean isHinted; |
|
1032 m_currentFunctionCall.GetParamValue( isHinted, 3 ); |
|
1033 VGfloat* glyphOrigin; |
|
1034 TInt size; |
|
1035 m_currentFunctionCall.GetVectorData( glyphOrigin, size, 4 ); |
|
1036 VGfloat* escapement; |
|
1037 m_currentFunctionCall.GetVectorData( escapement, size, 5 ); |
|
1038 |
|
1039 ::vgSetGlyphToPath( font, glyphIndex, path, isHinted, glyphOrigin, escapement ); |
|
1040 return WriteReply(); |
|
1041 } |
|
1042 |
|
1043 |
|
1044 int OpenVGAPIWrapper::vgSetGlyphToImage() |
|
1045 { |
|
1046 VGFont font; |
|
1047 m_currentFunctionCall.GetParamValue( font, 0 ); |
|
1048 VGuint glyphIndex; |
|
1049 m_currentFunctionCall.GetParamValue( glyphIndex, 1 ); |
|
1050 VGImage image; |
|
1051 m_currentFunctionCall.GetParamValue( image, 2 ); |
|
1052 VGfloat* glyphOrigin; |
|
1053 TInt size; |
|
1054 m_currentFunctionCall.GetVectorData( glyphOrigin, size, 3 ); |
|
1055 VGfloat* escapement; |
|
1056 m_currentFunctionCall.GetVectorData( escapement, size, 4 ); |
|
1057 |
|
1058 ::vgSetGlyphToImage( font, glyphIndex, image, glyphOrigin, escapement ); |
|
1059 return WriteReply(); |
|
1060 } |
|
1061 |
|
1062 |
|
1063 int OpenVGAPIWrapper::vgDrawGlyphs() |
|
1064 { |
|
1065 VGFont font; |
|
1066 m_currentFunctionCall.GetParamValue( font, 0 ); |
|
1067 VGint glyphCount; |
|
1068 m_currentFunctionCall.GetParamValue( glyphCount, 1 ); |
|
1069 VGuint * glyphIndices; |
|
1070 TInt size; |
|
1071 m_currentFunctionCall.GetVectorData( glyphIndices, size, 2 ); |
|
1072 VGfloat * adjustments_x; |
|
1073 m_currentFunctionCall.GetVectorData( adjustments_x, size, 3 ); |
|
1074 VGfloat * adjustments_y; |
|
1075 m_currentFunctionCall.GetVectorData( adjustments_y, size, 4 ); |
|
1076 VGbitfield paintModes; |
|
1077 m_currentFunctionCall.GetParamValue( paintModes, 5 ); |
|
1078 VGboolean allowAutoHinting; |
|
1079 m_currentFunctionCall.GetParamValue( allowAutoHinting, 6 ); |
|
1080 |
|
1081 ::vgDrawGlyphs( font, glyphCount, glyphIndices, adjustments_x, adjustments_y, paintModes, allowAutoHinting ); |
|
1082 return WriteReply(); |
|
1083 } |
|
1084 |
|
1085 |
|
1086 int OpenVGAPIWrapper::vgColorMatrix() |
|
1087 { |
|
1088 VGImage dst; |
|
1089 m_currentFunctionCall.GetParamValue( dst, 0 ); |
|
1090 VGImage src; |
|
1091 m_currentFunctionCall.GetParamValue( src, 1 ); |
|
1092 VGfloat * matrix; |
|
1093 TInt size; |
|
1094 m_currentFunctionCall.GetVectorData( matrix, size, 2 ); |
|
1095 |
|
1096 doSync( 3, dst, src ); |
|
1097 |
|
1098 ::vgColorMatrix( dst, src, matrix ); |
|
1099 return WriteReply(); |
|
1100 } |
|
1101 |
|
1102 |
|
1103 int OpenVGAPIWrapper::vgConvolve() |
|
1104 { |
|
1105 VGImage dst; |
|
1106 m_currentFunctionCall.GetParamValue( dst, 0 ); |
|
1107 VGImage src; |
|
1108 m_currentFunctionCall.GetParamValue( src, 1 ); |
|
1109 VGint kernelWidth; |
|
1110 m_currentFunctionCall.GetParamValue( kernelWidth, 2 ); |
|
1111 VGint kernelHeight; |
|
1112 m_currentFunctionCall.GetParamValue( kernelHeight, 3 ); |
|
1113 VGint shiftX; |
|
1114 m_currentFunctionCall.GetParamValue( shiftX, 4 ); |
|
1115 VGint shiftY; |
|
1116 m_currentFunctionCall.GetParamValue( shiftY, 5 ); |
|
1117 VGshort * kernel; |
|
1118 TInt size; |
|
1119 m_currentFunctionCall.GetVectorData( kernel, size, 6 ); |
|
1120 VGfloat scale; |
|
1121 m_currentFunctionCall.GetParamValue( scale, 7 ); |
|
1122 VGfloat bias; |
|
1123 m_currentFunctionCall.GetParamValue( bias, 8 ); |
|
1124 VGTilingMode tilingMode; |
|
1125 m_currentFunctionCall.GetParamValue( tilingMode, 9 ); |
|
1126 |
|
1127 doSync( 10, dst, src ); |
|
1128 |
|
1129 ::vgConvolve( dst, src, kernelWidth, kernelHeight, shiftX, shiftY, kernel, scale, bias, tilingMode ); |
|
1130 return WriteReply(); |
|
1131 } |
|
1132 |
|
1133 |
|
1134 int OpenVGAPIWrapper::vgSeparableConvolve() |
|
1135 { |
|
1136 VGImage dst; |
|
1137 m_currentFunctionCall.GetParamValue( dst, 0 ); |
|
1138 VGImage src; |
|
1139 m_currentFunctionCall.GetParamValue( src, 1 ); |
|
1140 VGint kernelWidth; |
|
1141 m_currentFunctionCall.GetParamValue( kernelWidth, 2 ); |
|
1142 VGint kernelHeight; |
|
1143 m_currentFunctionCall.GetParamValue( kernelHeight, 3 ); |
|
1144 VGint shiftX; |
|
1145 m_currentFunctionCall.GetParamValue( shiftX, 4 ); |
|
1146 VGint shiftY; |
|
1147 m_currentFunctionCall.GetParamValue( shiftY, 5 ); |
|
1148 VGshort * kernelX; |
|
1149 TInt size; |
|
1150 m_currentFunctionCall.GetVectorData( kernelX, size, 6 ); |
|
1151 VGshort * kernelY; |
|
1152 m_currentFunctionCall.GetVectorData( kernelY, size, 7 ); |
|
1153 VGfloat scale; |
|
1154 m_currentFunctionCall.GetParamValue( scale, 8 ); |
|
1155 VGfloat bias; |
|
1156 m_currentFunctionCall.GetParamValue( bias, 9 ); |
|
1157 VGTilingMode tilingMode; |
|
1158 m_currentFunctionCall.GetParamValue( tilingMode, 10 ); |
|
1159 |
|
1160 doSync( 11, dst, src ); |
|
1161 |
|
1162 ::vgSeparableConvolve( dst, src, kernelWidth, kernelHeight, shiftX, shiftY, kernelX, kernelY, scale, bias, tilingMode ); |
|
1163 return WriteReply(); |
|
1164 } |
|
1165 |
|
1166 |
|
1167 int OpenVGAPIWrapper::vgLookup() |
|
1168 { |
|
1169 VGImage dst; |
|
1170 m_currentFunctionCall.GetParamValue( dst, 0 ); |
|
1171 VGImage src; |
|
1172 m_currentFunctionCall.GetParamValue( src, 1 ); |
|
1173 VGubyte * redLUT; |
|
1174 TInt size; |
|
1175 m_currentFunctionCall.GetVectorData( redLUT, size, 2 ); |
|
1176 VGubyte * greenLUT; |
|
1177 m_currentFunctionCall.GetVectorData( greenLUT, size, 3 ); |
|
1178 VGubyte * blueLUT; |
|
1179 m_currentFunctionCall.GetVectorData( blueLUT, size, 4 ); |
|
1180 VGubyte * alphaLUT; |
|
1181 m_currentFunctionCall.GetVectorData( alphaLUT, size, 5 ); |
|
1182 VGboolean outputLinear; |
|
1183 m_currentFunctionCall.GetParamValue( outputLinear, 6 ); |
|
1184 VGboolean outputPremultiplied; |
|
1185 m_currentFunctionCall.GetParamValue( outputPremultiplied, 7 ); |
|
1186 |
|
1187 doSync( 8, dst, src ); |
|
1188 |
|
1189 ::vgLookup( dst, src, redLUT, greenLUT, blueLUT, alphaLUT, outputLinear, outputPremultiplied ); |
|
1190 return WriteReply(); |
|
1191 } |
|
1192 |
|
1193 |
|
1194 int OpenVGAPIWrapper::vgLookupSingle() |
|
1195 { |
|
1196 VGImage dst; |
|
1197 m_currentFunctionCall.GetParamValue( dst, 0 ); |
|
1198 VGImage src; |
|
1199 m_currentFunctionCall.GetParamValue( src, 1 ); |
|
1200 VGuint * lookupTable; |
|
1201 TInt size; |
|
1202 m_currentFunctionCall.GetVectorData( lookupTable, size, 2 ); |
|
1203 VGImageChannel sourceChannel; |
|
1204 m_currentFunctionCall.GetParamValue( sourceChannel, 3 ); |
|
1205 VGboolean outputLinear; |
|
1206 m_currentFunctionCall.GetParamValue( outputLinear, 4 ); |
|
1207 VGboolean outputPremultiplied; |
|
1208 m_currentFunctionCall.GetParamValue( outputPremultiplied, 5 ); |
|
1209 |
|
1210 doSync( 6, dst, src ); |
|
1211 |
|
1212 ::vgLookupSingle( dst, src, lookupTable, sourceChannel, outputLinear, outputPremultiplied ); |
|
1213 return WriteReply(); |
|
1214 } |
|
1215 |
|
1216 |
|
1217 int OpenVGAPIWrapper::vgGetMatrix() |
|
1218 { |
|
1219 VGfloat m[9]; |
|
1220 ::vgGetMatrix( m ); |
|
1221 m_currentFunctionCall.SetVectorData( m, 9, 0 ); |
|
1222 return WriteReply(); |
|
1223 } |
|
1224 |
|
1225 |
|
1226 int OpenVGAPIWrapper::vgGetfv() |
|
1227 { |
|
1228 VGParamType type; |
|
1229 m_currentFunctionCall.GetParamValue( type, 0 ); |
|
1230 VGint count; |
|
1231 m_currentFunctionCall.GetParamValue( count, 1 ); |
|
1232 VGfloat *values = (VGfloat*)iStack->AllocFromStack( count*m_currentFunctionCall.GetTypeSize( OpenVgRFC::EVGfloat), |
|
1233 m_currentFunctionCall.GetTypeAlignment( OpenVgRFC::EVGfloat) ); |
|
1234 ::vgGetfv( type, count, values); |
|
1235 m_currentFunctionCall.SetVectorData( values, count, 2 ); |
|
1236 int ret = WriteReply(); |
|
1237 iStack->ClearStack(); |
|
1238 values = NULL; |
|
1239 return ret; |
|
1240 } |
|
1241 |
|
1242 |
|
1243 int OpenVGAPIWrapper::vgGetiv() |
|
1244 { |
|
1245 VGParamType type; |
|
1246 m_currentFunctionCall.GetParamValue( type, 0 ); |
|
1247 VGint count; |
|
1248 m_currentFunctionCall.GetParamValue( count, 1 ); |
|
1249 VGint* values = (VGint*)iStack->AllocFromStack( count*m_currentFunctionCall.GetTypeSize( OpenVgRFC::EVGint), |
|
1250 m_currentFunctionCall.GetTypeAlignment( OpenVgRFC::EVGint) ); |
|
1251 ::vgGetiv( type, count, values); |
|
1252 m_currentFunctionCall.SetVectorData( values, count, 2 ); |
|
1253 int ret = WriteReply(); |
|
1254 iStack->ClearStack(); |
|
1255 values = NULL; |
|
1256 return ret; |
|
1257 } |
|
1258 |
|
1259 |
|
1260 int OpenVGAPIWrapper::vgGetParameterfv() |
|
1261 { |
|
1262 VGHandle object; |
|
1263 m_currentFunctionCall.GetParamValue( object, 0 ); |
|
1264 VGint paramType; |
|
1265 m_currentFunctionCall.GetParamValue( paramType, 1 ); |
|
1266 VGint count; |
|
1267 m_currentFunctionCall.GetParamValue( count, 2 ); |
|
1268 VGfloat *values = (VGfloat*)iStack->AllocFromStack( count*m_currentFunctionCall.GetTypeSize( OpenVgRFC::EVGfloat), |
|
1269 m_currentFunctionCall.GetTypeAlignment( OpenVgRFC::EVGfloat) ); |
|
1270 |
|
1271 ::vgGetParameterfv( object, paramType, count, values ); |
|
1272 m_currentFunctionCall.SetVectorData( values, count, 3 ); |
|
1273 int ret = WriteReply(); |
|
1274 return ret; |
|
1275 } |
|
1276 |
|
1277 |
|
1278 int OpenVGAPIWrapper::vgGetParameteriv() |
|
1279 { |
|
1280 VGHandle object; |
|
1281 m_currentFunctionCall.GetParamValue( object, 0 ); |
|
1282 VGint paramType; |
|
1283 m_currentFunctionCall.GetParamValue( paramType, 1 ); |
|
1284 VGint count; |
|
1285 m_currentFunctionCall.GetParamValue( count, 2 ); |
|
1286 VGint* values = (VGint*)iStack->AllocFromStack( count*m_currentFunctionCall.GetTypeSize( OpenVgRFC::EVGint), |
|
1287 m_currentFunctionCall.GetTypeAlignment( OpenVgRFC::EVGint) ); |
|
1288 |
|
1289 ::vgGetParameteriv( object, paramType, count, values ); |
|
1290 m_currentFunctionCall.SetVectorData( values, count, 3 ); |
|
1291 int ret = WriteReply(); |
|
1292 iStack->ClearStack(); |
|
1293 values = NULL; |
|
1294 |
|
1295 return ret; |
|
1296 } |
|
1297 |
|
1298 |
|
1299 int OpenVGAPIWrapper::vgGetImageSubData() |
|
1300 { |
|
1301 VGImage image; |
|
1302 m_currentFunctionCall.GetParamValue( image, 0 ); |
|
1303 VGint dataStride; |
|
1304 m_currentFunctionCall.GetParamValue( dataStride, 2 ); |
|
1305 VGImageFormat dataFormat; |
|
1306 m_currentFunctionCall.GetParamValue( dataFormat, 3 ); |
|
1307 VGint x; |
|
1308 m_currentFunctionCall.GetParamValue( x, 4 ); |
|
1309 VGint y; |
|
1310 m_currentFunctionCall.GetParamValue( y, 5 ); |
|
1311 VGint width; |
|
1312 m_currentFunctionCall.GetParamValue( width, 6 ); |
|
1313 VGint height; |
|
1314 m_currentFunctionCall.GetParamValue( height, 7 ); |
|
1315 VGint pixmapSize; |
|
1316 m_currentFunctionCall.GetParamValue(pixmapSize, 8); |
|
1317 |
|
1318 void *data = iStack->AllocFromStack(pixmapSize, 4 ); |
|
1319 |
|
1320 ::vgGetImageSubData( image, data, dataStride, dataFormat, x, y, width, height ); |
|
1321 m_currentFunctionCall.SetVectorData( data, pixmapSize, 1 ); |
|
1322 |
|
1323 int ret = WriteReply(); |
|
1324 |
|
1325 iStack->ClearStack(); |
|
1326 data = NULL; |
|
1327 |
|
1328 return ret; |
|
1329 } |
|
1330 |
|
1331 |
|
1332 int OpenVGAPIWrapper::vgPointAlongPath() |
|
1333 { |
|
1334 VGPath path; |
|
1335 m_currentFunctionCall.GetParamValue( path, 0 ); |
|
1336 VGint startSegment; |
|
1337 m_currentFunctionCall.GetParamValue( startSegment, 1 ); |
|
1338 VGint numSegments; |
|
1339 m_currentFunctionCall.GetParamValue( numSegments, 2 ); |
|
1340 VGfloat distance; |
|
1341 m_currentFunctionCall.GetParamValue( distance, 3 ); |
|
1342 VGfloat * x(NULL); |
|
1343 VGfloat * y(NULL); |
|
1344 VGfloat * tangentX(NULL); |
|
1345 VGfloat * tangentY(NULL); |
|
1346 VGfloat xval; |
|
1347 VGfloat yval; |
|
1348 VGfloat tangentXval; |
|
1349 VGfloat tangentYval; |
|
1350 |
|
1351 TInt size; |
|
1352 VGfloat *data; |
|
1353 m_currentFunctionCall.GetVectorData( data, size, 4 ); |
|
1354 if ( size ) |
|
1355 { |
|
1356 x = &xval; |
|
1357 } |
|
1358 m_currentFunctionCall.GetVectorData( data, size, 5 ); |
|
1359 if ( size ) |
|
1360 { |
|
1361 y = &yval; |
|
1362 } |
|
1363 m_currentFunctionCall.GetVectorData( data, size, 6 ); |
|
1364 if ( size ) |
|
1365 { |
|
1366 tangentX = &tangentXval; |
|
1367 } |
|
1368 m_currentFunctionCall.GetVectorData( data, size, 7 ); |
|
1369 if ( size ) |
|
1370 { |
|
1371 tangentY = &tangentYval; |
|
1372 } |
|
1373 |
|
1374 ::vgPointAlongPath( path, startSegment, numSegments, distance, x, y, tangentX, tangentY ); |
|
1375 |
|
1376 if ( x ) |
|
1377 { |
|
1378 m_currentFunctionCall.SetVectorData( x, 1, 4 ); |
|
1379 } |
|
1380 if ( y ) |
|
1381 { |
|
1382 m_currentFunctionCall.SetVectorData( y, 1, 5 ); |
|
1383 } |
|
1384 if ( tangentX ) |
|
1385 { |
|
1386 m_currentFunctionCall.SetVectorData( tangentX, 1, 6 ); |
|
1387 } |
|
1388 if ( tangentY ) |
|
1389 { |
|
1390 m_currentFunctionCall.SetVectorData( tangentY, 1, 7 ); |
|
1391 } |
|
1392 |
|
1393 int ret = WriteReply(); |
|
1394 |
|
1395 return ret; |
|
1396 } |
|
1397 |
|
1398 |
|
1399 int OpenVGAPIWrapper::vgPathBounds() |
|
1400 { |
|
1401 VGPath path; |
|
1402 m_currentFunctionCall.GetParamValue( path, 0 ); |
|
1403 VGfloat minX; |
|
1404 VGfloat minY; |
|
1405 VGfloat width; |
|
1406 VGfloat height; |
|
1407 |
|
1408 ::vgPathBounds( path, &minX, &minY, &width, &height ); |
|
1409 |
|
1410 m_currentFunctionCall.SetVectorData( &minX, 1, 1 ); |
|
1411 m_currentFunctionCall.SetVectorData( &minY, 1, 2 ); |
|
1412 m_currentFunctionCall.SetVectorData( &width, 1, 3 ); |
|
1413 m_currentFunctionCall.SetVectorData( &height, 1, 4 ); |
|
1414 return WriteReply(); |
|
1415 } |
|
1416 |
|
1417 |
|
1418 int OpenVGAPIWrapper::vgPathTransformedBounds() |
|
1419 { |
|
1420 VGPath path; |
|
1421 m_currentFunctionCall.GetParamValue( path, 0 ); |
|
1422 VGfloat minX; |
|
1423 VGfloat minY; |
|
1424 VGfloat width; |
|
1425 VGfloat height; |
|
1426 |
|
1427 ::vgPathTransformedBounds( path, &minX, &minY, &width, &height ); |
|
1428 |
|
1429 m_currentFunctionCall.SetVectorData( &minX, 1, 1 ); |
|
1430 m_currentFunctionCall.SetVectorData( &minY, 1, 2 ); |
|
1431 m_currentFunctionCall.SetVectorData( &width, 1, 3 ); |
|
1432 m_currentFunctionCall.SetVectorData( &height, 1, 4 ); |
|
1433 return WriteReply(); |
|
1434 } |
|
1435 |
|
1436 //vgu 1.1 |
|
1437 int OpenVGAPIWrapper::vguLine() |
|
1438 { |
|
1439 VGHandle path; |
|
1440 VGfloat x0, y0, x1, y1; |
|
1441 |
|
1442 m_currentFunctionCall.GetParamValue( path, 0 ); |
|
1443 m_currentFunctionCall.GetParamValue( x0, 1 ); |
|
1444 m_currentFunctionCall.GetParamValue( y0, 2 ); |
|
1445 m_currentFunctionCall.GetParamValue( x1, 3 ); |
|
1446 m_currentFunctionCall.GetParamValue( y1, 4 ); |
|
1447 |
|
1448 VGUErrorCode error = ::vguLine(path, x0, y0, x1, y1); |
|
1449 m_currentFunctionCall.SetReturnValue((TUint32)error); |
|
1450 return WriteReply(); |
|
1451 } |
|
1452 |
|
1453 |
|
1454 int OpenVGAPIWrapper::vguPolygon() |
|
1455 { |
|
1456 VGHandle path; |
|
1457 VGint count; |
|
1458 VGfloat *points; |
|
1459 TInt size; |
|
1460 VGboolean closed; |
|
1461 |
|
1462 m_currentFunctionCall.GetParamValue( path, 0 ); |
|
1463 m_currentFunctionCall.GetParamValue( count, 1 ); |
|
1464 m_currentFunctionCall.GetParamValue( closed, 2 ); |
|
1465 m_currentFunctionCall.GetVectorData( points, size, 3 ); |
|
1466 |
|
1467 VGUErrorCode error = ::vguPolygon(path, points, count, closed ); |
|
1468 m_currentFunctionCall.SetReturnValue((TUint32)error); |
|
1469 return WriteReply(); |
|
1470 } |
|
1471 |
|
1472 |
|
1473 int OpenVGAPIWrapper::vguRect() |
|
1474 { |
|
1475 VGHandle path; |
|
1476 VGfloat x, y, width, height; |
|
1477 |
|
1478 m_currentFunctionCall.GetParamValue( path, 0 ); |
|
1479 m_currentFunctionCall.GetParamValue( x, 1 ); |
|
1480 m_currentFunctionCall.GetParamValue( y, 2 ); |
|
1481 m_currentFunctionCall.GetParamValue( width, 3 ); |
|
1482 m_currentFunctionCall.GetParamValue( height, 4 ); |
|
1483 |
|
1484 VGUErrorCode error = ::vguRect(path, x, y, width, height); |
|
1485 m_currentFunctionCall.SetReturnValue((TUint32)error); |
|
1486 return WriteReply(); |
|
1487 } |
|
1488 |
|
1489 |
|
1490 int OpenVGAPIWrapper::vguRoundRect() |
|
1491 { |
|
1492 VGHandle path; |
|
1493 VGfloat x, y, width, height, arcWidth, arcHeight; |
|
1494 |
|
1495 m_currentFunctionCall.GetParamValue( path, 0 ); |
|
1496 m_currentFunctionCall.GetParamValue( x, 1 ); |
|
1497 m_currentFunctionCall.GetParamValue( y, 2 ); |
|
1498 m_currentFunctionCall.GetParamValue( width, 3 ); |
|
1499 m_currentFunctionCall.GetParamValue( height, 4 ); |
|
1500 m_currentFunctionCall.GetParamValue( arcWidth, 5 ); |
|
1501 m_currentFunctionCall.GetParamValue( arcHeight, 6 ); |
|
1502 |
|
1503 VGUErrorCode error = ::vguRoundRect(path, x, y, width, height, |
|
1504 arcWidth, arcHeight); |
|
1505 m_currentFunctionCall.SetReturnValue((TUint32)error); |
|
1506 return WriteReply(); |
|
1507 } |
|
1508 |
|
1509 |
|
1510 int OpenVGAPIWrapper::vguEllipse() |
|
1511 { |
|
1512 VGHandle path; |
|
1513 VGfloat cx, cy, width, height; |
|
1514 |
|
1515 m_currentFunctionCall.GetParamValue( path, 0 ); |
|
1516 m_currentFunctionCall.GetParamValue( cx, 1 ); |
|
1517 m_currentFunctionCall.GetParamValue( cy, 2 ); |
|
1518 m_currentFunctionCall.GetParamValue( width, 3 ); |
|
1519 m_currentFunctionCall.GetParamValue( height, 4 ); |
|
1520 |
|
1521 VGUErrorCode error = ::vguEllipse(path, cx, cy, width, height); |
|
1522 m_currentFunctionCall.SetReturnValue((TUint32)error); |
|
1523 return WriteReply(); |
|
1524 } |
|
1525 |
|
1526 |
|
1527 int OpenVGAPIWrapper::vguArc() |
|
1528 { |
|
1529 VGHandle path; |
|
1530 VGfloat x, y, width, height, startAngle, angleExtent; |
|
1531 VGUArcType arcType; |
|
1532 m_currentFunctionCall.GetParamValue( path, 0 ); |
|
1533 m_currentFunctionCall.GetParamValue( x, 1 ); |
|
1534 m_currentFunctionCall.GetParamValue( y, 2 ); |
|
1535 m_currentFunctionCall.GetParamValue( width, 3 ); |
|
1536 m_currentFunctionCall.GetParamValue( height, 4 ); |
|
1537 m_currentFunctionCall.GetParamValue( startAngle, 5 ); |
|
1538 m_currentFunctionCall.GetParamValue( angleExtent, 6 ); |
|
1539 m_currentFunctionCall.GetParamValue( arcType, 7 ); |
|
1540 |
|
1541 VGUErrorCode error = ::vguArc(path, x, y, width, height, |
|
1542 startAngle, angleExtent, arcType); |
|
1543 m_currentFunctionCall.SetReturnValue((TUint32)error); |
|
1544 return WriteReply(); |
|
1545 } |
|
1546 |
|
1547 |
|
1548 int OpenVGAPIWrapper::vguComputeWarpQuadToSquare() |
|
1549 { |
|
1550 VGfloat sx0, sy0, sx1, sy1, sx2, sy2, sx3, sy3; |
|
1551 VGfloat matrix[9]; |
|
1552 |
|
1553 m_currentFunctionCall.GetParamValue( sx0, 0 ); |
|
1554 m_currentFunctionCall.GetParamValue( sy0, 1 ); |
|
1555 m_currentFunctionCall.GetParamValue( sx1, 2 ); |
|
1556 m_currentFunctionCall.GetParamValue( sy1, 3 ); |
|
1557 m_currentFunctionCall.GetParamValue( sx2, 4 ); |
|
1558 m_currentFunctionCall.GetParamValue( sy2, 5 ); |
|
1559 m_currentFunctionCall.GetParamValue( sx3, 6 ); |
|
1560 m_currentFunctionCall.GetParamValue( sy3, 7 ); |
|
1561 |
|
1562 VGUErrorCode error = ::vguComputeWarpQuadToSquare( sx0, sy0, |
|
1563 sx1, sy1, sx2, sy2, sx3, sy3, matrix ); |
|
1564 m_currentFunctionCall.SetVectorData( matrix, 9, 8 ); |
|
1565 m_currentFunctionCall.SetReturnValue((TUint32)error); |
|
1566 return WriteReply(); |
|
1567 } |
|
1568 |
|
1569 |
|
1570 int OpenVGAPIWrapper::vguComputeWarpSquareToQuad() |
|
1571 { |
|
1572 VGfloat dx0, dy0, dx1, dy1, dx2, dy2, dx3, dy3; |
|
1573 VGfloat matrix[9]; |
|
1574 |
|
1575 m_currentFunctionCall.GetParamValue( dx0, 0 ); |
|
1576 m_currentFunctionCall.GetParamValue( dy0, 1 ); |
|
1577 m_currentFunctionCall.GetParamValue( dx1, 2 ); |
|
1578 m_currentFunctionCall.GetParamValue( dy1, 3 ); |
|
1579 m_currentFunctionCall.GetParamValue( dx2, 4 ); |
|
1580 m_currentFunctionCall.GetParamValue( dy2, 5 ); |
|
1581 m_currentFunctionCall.GetParamValue( dx3, 6 ); |
|
1582 m_currentFunctionCall.GetParamValue( dy3, 7 ); |
|
1583 |
|
1584 VGUErrorCode error = ::vguComputeWarpSquareToQuad( dx0, dy0, |
|
1585 dx1, dy1, dx2, dy2, dx3, dy3, matrix ); |
|
1586 m_currentFunctionCall.SetVectorData( matrix, 9, 8 ); |
|
1587 m_currentFunctionCall.SetReturnValue((TUint32)error); |
|
1588 return WriteReply(); |
|
1589 } |
|
1590 |
|
1591 |
|
1592 int OpenVGAPIWrapper::vguComputeWarpQuadToQuad() |
|
1593 { |
|
1594 VGfloat dx0, dy0, dx1, dy1, dx2, dy2, dx3, dy3; |
|
1595 VGfloat sx0, sy0, sx1, sy1, sx2, sy2, sx3, sy3; |
|
1596 VGfloat matrix[9]; |
|
1597 |
|
1598 m_currentFunctionCall.GetParamValue( dx0, 0 ); |
|
1599 m_currentFunctionCall.GetParamValue( dy0, 1 ); |
|
1600 m_currentFunctionCall.GetParamValue( dx1, 2 ); |
|
1601 m_currentFunctionCall.GetParamValue( dy1, 3 ); |
|
1602 m_currentFunctionCall.GetParamValue( dx2, 4 ); |
|
1603 m_currentFunctionCall.GetParamValue( dy2, 5 ); |
|
1604 m_currentFunctionCall.GetParamValue( dx3, 6 ); |
|
1605 m_currentFunctionCall.GetParamValue( dy3, 7 ); |
|
1606 m_currentFunctionCall.GetParamValue( sx0, 8 ); |
|
1607 m_currentFunctionCall.GetParamValue( sy0, 9 ); |
|
1608 m_currentFunctionCall.GetParamValue( sx1, 10 ); |
|
1609 m_currentFunctionCall.GetParamValue( sy1, 11 ); |
|
1610 m_currentFunctionCall.GetParamValue( sx2, 12 ); |
|
1611 m_currentFunctionCall.GetParamValue( sy2, 13 ); |
|
1612 m_currentFunctionCall.GetParamValue( sx3, 14 ); |
|
1613 m_currentFunctionCall.GetParamValue( sy3, 15 ); |
|
1614 |
|
1615 VGUErrorCode error = ::vguComputeWarpQuadToQuad( dx0, dy0, dx1, dy1, dx2, |
|
1616 dy2, dx3, dy3, sx0, sy0, sx1, sy1, sx2, sy2, sx3, sy3, matrix ); |
|
1617 m_currentFunctionCall.SetVectorData( matrix, 9, 16 ); |
|
1618 m_currentFunctionCall.SetReturnValue((TUint32)error); |
|
1619 return WriteReply(); |
|
1620 } |
|
1621 |
|
1622 /** |
|
1623 * |
|
1624 *@param aParamIndex the index where the first pbuffer surface handle is located. The other(s) are located in the subsequent positions. |
|
1625 *@param aDst destination image |
|
1626 *@param aSrc source image |
|
1627 */ |
|
1628 |
|
1629 void OpenVGAPIWrapper::doSync( int aParamIndex, VGImage aDst, VGImage aSrc ) |
|
1630 { |
|
1631 TRACE("DriverAPIWrapper::doSync ->\n"); |
|
1632 int pbuffer(0); |
|
1633 |
|
1634 if( aParamIndex >= m_currentFunctionCall.Data().Header().iParameterCount ){return;} |
|
1635 m_currentFunctionCall.GetParamValue( pbuffer, aParamIndex++ ); |
|
1636 if( pbuffer ) |
|
1637 { |
|
1638 m_APIWrapper->GetDriverWrapper()->SyncVGImageFromPBuffer( (EGLSurface)pbuffer, aDst ); |
|
1639 } |
|
1640 |
|
1641 if( aParamIndex >= m_currentFunctionCall.Data().Header().iParameterCount ){return;} |
|
1642 m_currentFunctionCall.GetParamValue( pbuffer, aParamIndex++ ); |
|
1643 if( pbuffer ) |
|
1644 { |
|
1645 m_APIWrapper->GetDriverWrapper()->SyncVGImageFromPBuffer( (EGLSurface)pbuffer, aSrc ); |
|
1646 } |
|
1647 TRACE("DriverAPIWrapper::doSync <-\n"); |
|
1648 } |
|
1649 |
|
1650 OpenVGAPIWrapper::OpenVGAPIWrapper(RemoteFunctionCallData& currentFunctionCallData, APIWrapperStack* stack, void* result, MGraphicsVHWCallback* serviceIf, KhronosAPIWrapper *aAPIWrapper ): |
|
1651 APIWrapper( currentFunctionCallData, stack, result, serviceIf ), |
|
1652 m_currentFunctionCall( m_currentFunctionCallData ), |
|
1653 vgePathCoordsSizeInBytesPtr( NULL ), |
|
1654 m_APIWrapper( aAPIWrapper ) |
|
1655 { |
|
1656 //vgePathCoordsSizeInBytesPtr = (vgePathCoordsSizeInBytesPtrType)::eglGetProcAddress("vgePathCoordsSizeInBytes"); |
|
1657 } |
|
1658 |
|
1659 int OpenVGAPIWrapper::WriteReply() |
|
1660 { |
|
1661 #ifdef LOG_ERROR |
|
1662 int operationid = (int)m_currentFunctionCall.Data().Header().iOpCode; |
|
1663 |
|
1664 /*int vgerror*/VGErrorCode vgerror = ::vgPlatsimGetError(); |
|
1665 if ( m_lastVgError != vgerror ) |
|
1666 { |
|
1667 if ( VG_NO_ERROR != vgerror ) |
|
1668 { |
|
1669 printf("OpenVG error 0x%X, for request %d\n", vgerror, operationid ); |
|
1670 } |
|
1671 m_lastVgError = vgerror; |
|
1672 } |
|
1673 #endif |
|
1674 return APIWrapper::WriteReply(); |
|
1675 } |
|
1676 |
|
1677 int OpenVGAPIWrapper::DispatchRequest( unsigned long aCode ) |
|
1678 { |
|
1679 int ret(0); |
|
1680 switch ( aCode ) |
|
1681 { |
|
1682 case OpenVgRFC::EvgCreatePaint: |
|
1683 { |
|
1684 ret = vgCreatePaint(); |
|
1685 break; |
|
1686 } |
|
1687 case OpenVgRFC::EvgDestroyPaint: |
|
1688 { |
|
1689 ret = vgDestroyPaint(); |
|
1690 break; |
|
1691 } |
|
1692 case OpenVgRFC::EvgSetPaint: |
|
1693 { |
|
1694 ret = vgSetPaint(); |
|
1695 break; |
|
1696 } |
|
1697 case OpenVgRFC::EvgSetParameteri: |
|
1698 { |
|
1699 ret = vgSetParameteri(); |
|
1700 break; |
|
1701 } |
|
1702 case OpenVgRFC::EvgSetParameterfv: |
|
1703 { |
|
1704 ret = vgSetParameterfv(); |
|
1705 break; |
|
1706 } |
|
1707 case OpenVgRFC::EvgCreatePath: |
|
1708 { |
|
1709 ret = vgCreatePath(); |
|
1710 break; |
|
1711 } |
|
1712 case OpenVgRFC::EvgDrawPath: |
|
1713 { |
|
1714 ret = vgDrawPath(); |
|
1715 break; |
|
1716 } |
|
1717 case OpenVgRFC::EvgDestroyPath: |
|
1718 { |
|
1719 ret = vgDestroyPath(); |
|
1720 break; |
|
1721 } |
|
1722 case OpenVgRFC::EvgAppendPathData: |
|
1723 { |
|
1724 ret = vgAppendPathData(); |
|
1725 break; |
|
1726 } |
|
1727 case OpenVgRFC::EvgGetError: |
|
1728 { |
|
1729 ret = vgGetError(); |
|
1730 break; |
|
1731 } |
|
1732 case OpenVgRFC::EvgSeti: |
|
1733 { |
|
1734 ret = vgSeti(); |
|
1735 break; |
|
1736 } |
|
1737 case OpenVgRFC::EvgSetf: |
|
1738 { |
|
1739 ret = vgSetf(); |
|
1740 break; |
|
1741 } |
|
1742 case OpenVgRFC::EvgSetfv: |
|
1743 { |
|
1744 ret = vgSetfv(); |
|
1745 break; |
|
1746 } |
|
1747 case OpenVgRFC::EvgClear: |
|
1748 { |
|
1749 ret = vgClear(); |
|
1750 break; |
|
1751 } |
|
1752 case OpenVgRFC::EvgLoadIdentity: |
|
1753 { |
|
1754 ret = vgLoadIdentity(); |
|
1755 break; |
|
1756 } |
|
1757 case OpenVgRFC::EvgRotate: |
|
1758 { |
|
1759 ret = vgRotate(); |
|
1760 break; |
|
1761 } |
|
1762 case OpenVgRFC::EvgScale: |
|
1763 { |
|
1764 ret = vgScale(); |
|
1765 break; |
|
1766 } |
|
1767 case OpenVgRFC::EvgTranslate: |
|
1768 { |
|
1769 ret = vgTranslate(); |
|
1770 break; |
|
1771 } |
|
1772 case OpenVgRFC::EvgReadPixels: |
|
1773 { |
|
1774 ret = vgReadPixels(); |
|
1775 break; |
|
1776 } |
|
1777 case OpenVgRFC::EvgFlush: |
|
1778 { |
|
1779 ret = vgFlush(); |
|
1780 break; |
|
1781 } |
|
1782 case OpenVgRFC::EvgFinish: |
|
1783 { |
|
1784 ret = vgFinish(); |
|
1785 break; |
|
1786 } |
|
1787 case OpenVgRFC::EvgSetiv: |
|
1788 { |
|
1789 ret = vgSetiv(); |
|
1790 break; |
|
1791 } |
|
1792 case OpenVgRFC::EvgGetPaint: |
|
1793 { |
|
1794 ret = vgGetPaint(); |
|
1795 break; |
|
1796 } |
|
1797 case OpenVgRFC::EvgInterpolatePath: |
|
1798 { |
|
1799 ret =vgInterpolatePath(); |
|
1800 break; |
|
1801 } |
|
1802 case OpenVgRFC::EvgPathLength: |
|
1803 { |
|
1804 ret = vgPathLength(); |
|
1805 break; |
|
1806 } |
|
1807 case OpenVgRFC::EvgGetPathCapabilities: |
|
1808 { |
|
1809 ret = vgGetPathCapabilities(); |
|
1810 break; |
|
1811 } |
|
1812 case OpenVgRFC::EvgGetf: |
|
1813 { |
|
1814 ret = vgGetf(); |
|
1815 break; |
|
1816 } |
|
1817 case OpenVgRFC::EvgGeti: |
|
1818 { |
|
1819 ret = vgGeti(); |
|
1820 break; |
|
1821 } |
|
1822 case OpenVgRFC::EvgGetVectorSize: |
|
1823 { |
|
1824 ret = vgGetVectorSize(); |
|
1825 break; |
|
1826 } |
|
1827 case OpenVgRFC::EvgGetParameterf://10 |
|
1828 { |
|
1829 ret = vgGetParameterf(); |
|
1830 break; |
|
1831 } |
|
1832 case OpenVgRFC::EvgGetParameteri: |
|
1833 { |
|
1834 ret = vgGetParameteri(); |
|
1835 break; |
|
1836 } |
|
1837 case OpenVgRFC::EvgGetParameterVectorSize: |
|
1838 { |
|
1839 ret = vgGetParameterVectorSize(); |
|
1840 break; |
|
1841 } |
|
1842 case OpenVgRFC::EvgCreateMaskLayer: |
|
1843 { |
|
1844 ret = vgCreateMaskLayer(); |
|
1845 break; |
|
1846 } |
|
1847 case OpenVgRFC::EvgGetColor: |
|
1848 { |
|
1849 ret = vgGetColor(); |
|
1850 break; |
|
1851 } |
|
1852 case OpenVgRFC::EvgCreateImage: |
|
1853 { |
|
1854 ret = vgCreateImage(); |
|
1855 break; |
|
1856 } |
|
1857 case OpenVgRFC::EvgChildImage: |
|
1858 { |
|
1859 ret = vgChildImage(); |
|
1860 break; |
|
1861 } |
|
1862 case OpenVgRFC::EvgGetParent: |
|
1863 { |
|
1864 ret = vgGetParent(); |
|
1865 break; |
|
1866 } |
|
1867 case OpenVgRFC::EvgCreateFont: |
|
1868 { |
|
1869 ret = vgCreateFont(); |
|
1870 break; |
|
1871 } |
|
1872 case OpenVgRFC::EvgHardwareQuery: |
|
1873 { |
|
1874 ret = vgHardwareQuery(); |
|
1875 break; |
|
1876 } |
|
1877 //20 |
|
1878 case OpenVgRFC::EvgGetParameterfv: |
|
1879 { |
|
1880 ret = vgGetParameterfv(); |
|
1881 break; |
|
1882 } |
|
1883 case OpenVgRFC::EvgGetParameteriv: |
|
1884 { |
|
1885 ret = vgGetParameteriv(); |
|
1886 break; |
|
1887 } |
|
1888 case OpenVgRFC::EvgGetfv: |
|
1889 { |
|
1890 ret = vgGetfv(); |
|
1891 break; |
|
1892 } |
|
1893 case OpenVgRFC::EvgGetiv: |
|
1894 { |
|
1895 ret = vgGetiv(); |
|
1896 break; |
|
1897 } |
|
1898 case OpenVgRFC::EvgGetMatrix: |
|
1899 { |
|
1900 ret = vgGetMatrix(); |
|
1901 break; |
|
1902 } |
|
1903 case OpenVgRFC::EvgGetImageSubData: |
|
1904 { |
|
1905 ret = vgGetImageSubData(); |
|
1906 break; |
|
1907 } |
|
1908 case OpenVgRFC::EvgSetParameterf: |
|
1909 { |
|
1910 ret = vgSetParameterf(); |
|
1911 break; |
|
1912 } |
|
1913 case OpenVgRFC::EvgSetParameteriv: |
|
1914 { |
|
1915 ret = vgSetParameteriv(); |
|
1916 break; |
|
1917 } |
|
1918 case OpenVgRFC::EvgLoadMatrix: |
|
1919 { |
|
1920 ret = vgLoadMatrix(); |
|
1921 break; |
|
1922 } |
|
1923 case OpenVgRFC::EvgMultMatrix: //40 |
|
1924 { |
|
1925 ret = vgMultMatrix(); |
|
1926 break; |
|
1927 } |
|
1928 case OpenVgRFC::EvgShear: |
|
1929 { |
|
1930 ret = vgShear(); |
|
1931 break; |
|
1932 } |
|
1933 case OpenVgRFC::EvgMask: |
|
1934 { |
|
1935 ret = vgMask(); |
|
1936 break; |
|
1937 } |
|
1938 case OpenVgRFC::EvgRenderToMask: |
|
1939 { |
|
1940 ret = vgRenderToMask(); |
|
1941 break; |
|
1942 } |
|
1943 case OpenVgRFC::EvgDestroyMaskLayer: |
|
1944 { |
|
1945 ret = vgDestroyMaskLayer(); |
|
1946 break; |
|
1947 } |
|
1948 case OpenVgRFC::EvgFillMaskLayer: |
|
1949 { |
|
1950 ret = vgFillMaskLayer(); |
|
1951 break; |
|
1952 } |
|
1953 case OpenVgRFC::EvgCopyMask: |
|
1954 { |
|
1955 ret = vgCopyMask(); |
|
1956 break; |
|
1957 } |
|
1958 case OpenVgRFC::EvgClearPath: |
|
1959 { |
|
1960 ret = vgClearPath(); |
|
1961 break; |
|
1962 } |
|
1963 case OpenVgRFC::EvgRemovePathCapabilities: |
|
1964 { |
|
1965 ret = vgRemovePathCapabilities(); |
|
1966 break; |
|
1967 } |
|
1968 case OpenVgRFC::EvgAppendPath: |
|
1969 { |
|
1970 ret = vgAppendPath(); |
|
1971 break; |
|
1972 } |
|
1973 case OpenVgRFC::EvgModifyPathCoords: |
|
1974 { |
|
1975 ret = vgModifyPathCoords(); |
|
1976 break; |
|
1977 } |
|
1978 case OpenVgRFC::EvgTransformPath: |
|
1979 { |
|
1980 ret = vgTransformPath(); |
|
1981 break; |
|
1982 } |
|
1983 case OpenVgRFC::EvgPointAlongPath: |
|
1984 { |
|
1985 ret = vgPointAlongPath(); |
|
1986 break; |
|
1987 } |
|
1988 case OpenVgRFC::EvgPathBounds: |
|
1989 { |
|
1990 ret = vgPathBounds(); |
|
1991 break; |
|
1992 } |
|
1993 case OpenVgRFC::EvgPathTransformedBounds: |
|
1994 { |
|
1995 ret = vgPathTransformedBounds(); |
|
1996 break; |
|
1997 } |
|
1998 case OpenVgRFC::EvgSetColor: |
|
1999 { |
|
2000 ret = vgSetColor(); |
|
2001 break; |
|
2002 } |
|
2003 case OpenVgRFC::EvgPaintPattern: |
|
2004 { |
|
2005 ret = vgPaintPattern(); |
|
2006 break; |
|
2007 } |
|
2008 case OpenVgRFC::EvgDestroyImage: |
|
2009 { |
|
2010 ret = vgDestroyImage(); |
|
2011 break; |
|
2012 } |
|
2013 case OpenVgRFC::EvgClearImage: |
|
2014 { |
|
2015 ret = vgClearImage(); |
|
2016 break; |
|
2017 } |
|
2018 case OpenVgRFC::EvgImageSubData: |
|
2019 { |
|
2020 ret = vgImageSubData(); |
|
2021 break; |
|
2022 } |
|
2023 case OpenVgRFC::EvgCopyImage: |
|
2024 { |
|
2025 ret = vgCopyImage(); |
|
2026 break; |
|
2027 } |
|
2028 case OpenVgRFC::EvgDrawImage: |
|
2029 { |
|
2030 ret = vgDrawImage(); |
|
2031 break; |
|
2032 } |
|
2033 case OpenVgRFC::EvgSetPixels: |
|
2034 { |
|
2035 ret = vgSetPixels(); |
|
2036 break; |
|
2037 } |
|
2038 case OpenVgRFC::EvgWritePixels: |
|
2039 { |
|
2040 ret = vgWritePixels(); |
|
2041 break; |
|
2042 } |
|
2043 case OpenVgRFC::EvgGetPixels: |
|
2044 { |
|
2045 ret = vgGetPixels(); |
|
2046 break; |
|
2047 } |
|
2048 case OpenVgRFC::EvgCopyPixels: |
|
2049 { |
|
2050 ret = vgCopyPixels(); |
|
2051 break; |
|
2052 } |
|
2053 case OpenVgRFC::EvgDestroyFont: |
|
2054 { |
|
2055 ret = vgDestroyFont(); |
|
2056 break; |
|
2057 } |
|
2058 case OpenVgRFC::EvgSetGlyphToPath: |
|
2059 { |
|
2060 ret = vgSetGlyphToPath(); |
|
2061 break; |
|
2062 } |
|
2063 case OpenVgRFC::EvgSetGlyphToImage: |
|
2064 { |
|
2065 ret = vgSetGlyphToImage(); |
|
2066 break; |
|
2067 } |
|
2068 case OpenVgRFC::EvgClearGlyph: |
|
2069 { |
|
2070 ret = vgClearGlyph(); |
|
2071 break; |
|
2072 } |
|
2073 case OpenVgRFC::EvgDrawGlyph: |
|
2074 { |
|
2075 ret = vgDrawGlyph(); |
|
2076 break; |
|
2077 } |
|
2078 case OpenVgRFC::EvgDrawGlyphs: |
|
2079 { |
|
2080 ret = vgDrawGlyphs(); |
|
2081 break; |
|
2082 } |
|
2083 case OpenVgRFC::EvgColorMatrix: |
|
2084 { |
|
2085 ret = vgColorMatrix(); |
|
2086 break; |
|
2087 } |
|
2088 case OpenVgRFC::EvgConvolve: |
|
2089 { |
|
2090 ret = vgConvolve(); |
|
2091 break; |
|
2092 } |
|
2093 case OpenVgRFC::EvgSeparableConvolve: |
|
2094 { |
|
2095 ret = vgSeparableConvolve(); |
|
2096 break; |
|
2097 } |
|
2098 case OpenVgRFC::EvgGaussianBlur: |
|
2099 { |
|
2100 ret = vgGaussianBlur(); |
|
2101 break; |
|
2102 } |
|
2103 case OpenVgRFC::EvgLookup: |
|
2104 { |
|
2105 ret = vgLookup(); |
|
2106 break; |
|
2107 } |
|
2108 case OpenVgRFC::EvgLookupSingle: |
|
2109 { |
|
2110 ret = vgLookupSingle(); |
|
2111 break; |
|
2112 } |
|
2113 case OpenVgRFC::EvgePathCoordsSizeInBytes: |
|
2114 { |
|
2115 ret = vgePathCoordsSizeInBytes(); |
|
2116 break; |
|
2117 } |
|
2118 case OpenVgRFC::EvgGetString: |
|
2119 // { |
|
2120 // ret = vgGetString(); |
|
2121 // break; |
|
2122 // } |
|
2123 case OpenVgRFC::EvguLine: |
|
2124 { |
|
2125 ret = vguLine(); |
|
2126 break; |
|
2127 } |
|
2128 case OpenVgRFC::EvguPolygon: |
|
2129 { |
|
2130 ret = vguPolygon(); |
|
2131 break; |
|
2132 } |
|
2133 case OpenVgRFC::EvguRect: |
|
2134 { |
|
2135 ret = vguRect(); |
|
2136 break; |
|
2137 } |
|
2138 case OpenVgRFC::EvguRoundRect: |
|
2139 { |
|
2140 ret = vguRoundRect(); |
|
2141 break; |
|
2142 } |
|
2143 case OpenVgRFC::EvguEllipse: |
|
2144 { |
|
2145 ret = vguEllipse(); |
|
2146 break; |
|
2147 } |
|
2148 case OpenVgRFC::EvguArc: |
|
2149 { |
|
2150 ret = vguArc(); |
|
2151 break; |
|
2152 } |
|
2153 case OpenVgRFC::EvguComputeWarpQuadToSquare: |
|
2154 { |
|
2155 ret = vguComputeWarpQuadToSquare(); |
|
2156 break; |
|
2157 } |
|
2158 case OpenVgRFC::EvguComputeWarpSquareToQuad: |
|
2159 { |
|
2160 ret = vguComputeWarpSquareToQuad(); |
|
2161 break; |
|
2162 } |
|
2163 case OpenVgRFC::EvguComputeWarpQuadToQuad: |
|
2164 { |
|
2165 ret = vguComputeWarpQuadToQuad(); |
|
2166 break; |
|
2167 } |
|
2168 default: |
|
2169 TRACE("Unimplemented Openvg Op code %u\n",aCode); |
|
2170 break; |
|
2171 } |
|
2172 return ret; |
|
2173 } |