graphicscomposition/openwfcompositionengine/composition/src/wfcapi.c
branchRCL_3
changeset 163 bbf46f59e123
parent 0 5d03bc08d59c
child 164 25ffed67c7ef
--- a/graphicscomposition/openwfcompositionengine/composition/src/wfcapi.c	Thu Aug 19 11:11:18 2010 +0300
+++ b/graphicscomposition/openwfcompositionengine/composition/src/wfcapi.c	Tue Aug 31 16:31:06 2010 +0300
@@ -1,4 +1,5 @@
-/* Copyright (c) 2009 The Khronos Group Inc.
+/* Copyright (c) 2009-2010 The Khronos Group Inc.
+ * Portions copyright (c) 2009-2010  Nokia Corporation and/or its subsidiary(-ies)
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and/or associated documentation files (the
@@ -258,17 +259,15 @@
     {
         screenNumber = OWF_Screen_GetDefaultNumber();
     }
-    else
+    
+    /* check screen number validity */
+    if (!OWF_Screen_Valid(screenNumber))
     {
-        /* check screen number validity */
-        if (!OWF_Screen_Valid(screenNumber))
-        {
-            FAIL(WFC_ERROR_UNSUPPORTED, WFC_INVALID_HANDLE);
-        }
+        FAIL(WFC_ERROR_UNSUPPORTED, WFC_INVALID_HANDLE);
     }
 
     /* check that no other context currently uses this screen */
-    if (!OWF_Screen_Valid_And_Available(screenNumber))
+    if (WFC_Device_FindScreenNumber(screenNumber))
     {
         FAIL(WFC_ERROR_IN_USE, WFC_INVALID_HANDLE);
     }
@@ -945,6 +944,9 @@
 
     case WFC_EXTENSIONS:
         tmp = &wfc_extensions[0];
+		/* we know that wfc_extensions always has NULL as the last member 
+		   so this loop will never exceed the size of tmp */
+		/* coverity[overrun-local] */
         for (retVal=0; tmp[retVal] != NULL; retVal++)
         {
             /* get extensions array size */
@@ -1001,7 +1003,7 @@
 /*=========================================================================*/
 
 WFC_API_CALL WFCNativeStreamType WFC_APIENTRY
-wfcGetOnScreenStream(WFCDevice dev, WFCContext ctx) WFC_APIEXIT
+extwfcGetOnScreenStream(WFCDevice dev, WFCContext ctx) WFC_APIEXIT
 {
 	WFC_DEVICE*             device;
 	WFC_CONTEXT*            context;
@@ -1015,6 +1017,8 @@
 	/* Protect context's target stream from being destroyed by the user
 	 * WFC_CONTEXT_Dtor will reset this flag. */
 	owfNativeStreamSetProtectionFlag(context->stream, OWF_TRUE);
+	
+	OWF_DisplayContext_FlagInternalStreamAccessed(context->displayContext);
 
 	SUCCEED(context->stream);
 }