equal
deleted
inserted
replaced
1 /* Copyright (c) 2009 The Khronos Group Inc. |
1 /* Copyright (c) 2009-2010 The Khronos Group Inc. |
|
2 * Portions copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies) |
2 * |
3 * |
3 * Permission is hereby granted, free of charge, to any person obtaining a |
4 * Permission is hereby granted, free of charge, to any person obtaining a |
4 * copy of this software and/or associated documentation files (the |
5 * copy of this software and/or associated documentation files (the |
5 * "Materials"), to deal in the Materials without restriction, including |
6 * "Materials"), to deal in the Materials without restriction, including |
6 * without limitation the rights to use, copy, modify, merge, publish, |
7 * without limitation the rights to use, copy, modify, merge, publish, |
256 |
257 |
257 if (screenNumber == WFC_DEFAULT_SCREEN_NUMBER) |
258 if (screenNumber == WFC_DEFAULT_SCREEN_NUMBER) |
258 { |
259 { |
259 screenNumber = OWF_Screen_GetDefaultNumber(); |
260 screenNumber = OWF_Screen_GetDefaultNumber(); |
260 } |
261 } |
261 else |
262 |
262 { |
263 /* check screen number validity */ |
263 /* check screen number validity */ |
264 if (!OWF_Screen_Valid(screenNumber)) |
264 if (!OWF_Screen_Valid(screenNumber)) |
265 { |
265 { |
266 FAIL(WFC_ERROR_UNSUPPORTED, WFC_INVALID_HANDLE); |
266 FAIL(WFC_ERROR_UNSUPPORTED, WFC_INVALID_HANDLE); |
|
267 } |
|
268 } |
267 } |
269 |
268 |
270 /* check that no other context currently uses this screen */ |
269 /* check that no other context currently uses this screen */ |
271 if (!OWF_Screen_Valid_And_Available(screenNumber)) |
270 if (WFC_Device_FindScreenNumber(screenNumber)) |
272 { |
271 { |
273 FAIL(WFC_ERROR_IN_USE, WFC_INVALID_HANDLE); |
272 FAIL(WFC_ERROR_IN_USE, WFC_INVALID_HANDLE); |
274 } |
273 } |
275 |
274 |
276 |
275 |
943 tmp = &wfc_strings[WFC_VERSION_INDEX]; |
942 tmp = &wfc_strings[WFC_VERSION_INDEX]; |
944 break; |
943 break; |
945 |
944 |
946 case WFC_EXTENSIONS: |
945 case WFC_EXTENSIONS: |
947 tmp = &wfc_extensions[0]; |
946 tmp = &wfc_extensions[0]; |
|
947 /* we know that wfc_extensions always has NULL as the last member |
|
948 so this loop will never exceed the size of tmp */ |
|
949 /* coverity[overrun-local] */ |
948 for (retVal=0; tmp[retVal] != NULL; retVal++) |
950 for (retVal=0; tmp[retVal] != NULL; retVal++) |
949 { |
951 { |
950 /* get extensions array size */ |
952 /* get extensions array size */ |
951 } |
953 } |
952 break; |
954 break; |
999 /*=========================================================================*/ |
1001 /*=========================================================================*/ |
1000 /* 11. TEST ONLY API FOR ON SCREEN IMAGE EXPORTING */ |
1002 /* 11. TEST ONLY API FOR ON SCREEN IMAGE EXPORTING */ |
1001 /*=========================================================================*/ |
1003 /*=========================================================================*/ |
1002 |
1004 |
1003 WFC_API_CALL WFCNativeStreamType WFC_APIENTRY |
1005 WFC_API_CALL WFCNativeStreamType WFC_APIENTRY |
1004 wfcGetOnScreenStream(WFCDevice dev, WFCContext ctx) WFC_APIEXIT |
1006 extwfcGetOnScreenStream(WFCDevice dev, WFCContext ctx) WFC_APIEXIT |
1005 { |
1007 { |
1006 WFC_DEVICE* device; |
1008 WFC_DEVICE* device; |
1007 WFC_CONTEXT* context; |
1009 WFC_CONTEXT* context; |
1008 |
1010 |
1009 GET_DEVICE(device, dev, WFC_INVALID_HANDLE); |
1011 GET_DEVICE(device, dev, WFC_INVALID_HANDLE); |
1013 DPRINT((" context = %p", context)); |
1015 DPRINT((" context = %p", context)); |
1014 |
1016 |
1015 /* Protect context's target stream from being destroyed by the user |
1017 /* Protect context's target stream from being destroyed by the user |
1016 * WFC_CONTEXT_Dtor will reset this flag. */ |
1018 * WFC_CONTEXT_Dtor will reset this flag. */ |
1017 owfNativeStreamSetProtectionFlag(context->stream, OWF_TRUE); |
1019 owfNativeStreamSetProtectionFlag(context->stream, OWF_TRUE); |
|
1020 |
|
1021 OWF_DisplayContext_FlagInternalStreamAccessed(context->displayContext); |
1018 |
1022 |
1019 SUCCEED(context->stream); |
1023 SUCCEED(context->stream); |
1020 } |
1024 } |