--- a/graphicscomposition/openwfsupport/src/streammap.cpp Thu Aug 19 11:11:18 2010 +0300
+++ b/graphicscomposition/openwfsupport/src/streammap.cpp Tue Aug 31 16:31:06 2010 +0300
@@ -17,6 +17,7 @@
#include "streammap.h"
#include <graphics/updateserverprovider.h>
+#include <graphics/surfacemanager.h>
#include <e32property.h>
#include <e32std.h>
#include <e32cmn.h>
@@ -26,20 +27,6 @@
static const TInt KOpenWfcInteropCleanupKey = 0x10286FC5;
-TEMPLATE_SPECIALIZATION class RHashTableBase::Defaults<TSurfaceId, RHashTableBase::EDefaultSpecifier_Normal>
- {
-public:
- inline static TGeneralHashFunction32 Hash();
- inline static TGeneralIdentityRelation Id();
- };
-
-inline TGeneralHashFunction32 RHashTableBase::Defaults<TSurfaceId, RHashTableBase::EDefaultSpecifier_Normal>::Hash()
- {return (TGeneralHashFunction32)&DefaultHash::Integer;}
-
-inline TGeneralIdentityRelation RHashTableBase::Defaults<TSurfaceId, RHashTableBase::EDefaultSpecifier_Normal>::Id()
- {return (TGeneralIdentityRelation)&DefaultIdentity::Integer;}
-
-
COpenWfcStreamMap* COpenWfcStreamMap::pInstance = NULL;
TUint32 COpenWfcStreamMap::HashFunction(const TSurfaceId& aHashKey)
@@ -65,13 +52,6 @@
return *pInstance;
}
-EXPORT_C TInt COpenWfcStreamMap::Reserve(TInt aExpand)
- {
- Guard g(iMutex);
- TInt ret = iMap.Reserve(aExpand);
- return ret;
- }
-
CSurfaceStream* COpenWfcStreamMap::Find(const TSurfaceId& aSurfaceId)
{
Guard g(iMutex);
@@ -117,9 +97,10 @@
return count;
}
-RSurfaceManager& COpenWfcStreamMap::SurfaceManager()
+EXPORT_C RSurfaceManager& COpenWfcStreamMap::SurfaceManager()
{
- return iSurfaceManager;
+ WFCI_ASSERT_DEBUG(iSurfaceManager, EOwfPanicInvalidHasMap);
+ return *iSurfaceManager;
}
TInt COpenWfcStreamMap::LockDestroy(CSurfaceStream* aStream)
@@ -157,6 +138,7 @@
COpenWfcStreamMap::COpenWfcStreamMap():
iMap(THashFunction32<TSurfaceId>(COpenWfcStreamMap::HashFunction), TIdentityRelation<TSurfaceId>()),
+iSurfaceManager(NULL),
iRegisteredUpdaters()
{
}
@@ -193,7 +175,7 @@
CSurfaceStream* const* ns = NULL;
while (nextKey)
{
- ns = iter.NextValue();
+ ns = iter.CurrentValue();
if (ns && *ns)
{
delete (*ns);
@@ -202,7 +184,12 @@
}
}
iMap.Close();
- iSurfaceManager.Close();
+ if (iSurfaceManager)
+ {
+ iSurfaceManager->Close();
+ delete iSurfaceManager;
+ iSurfaceManager = NULL;
+ }
iMutex.Signal();
iMutex.Close();
@@ -212,7 +199,7 @@
CExtensionContainer* const* extensionContainer = NULL;
while (nextKey)
{
- extensionContainer = iter.NextValue();
+ extensionContainer = iter.CurrentValue();
if (extensionContainer && *extensionContainer)
{
delete (*extensionContainer);
@@ -223,17 +210,6 @@
iRegisteredUpdaters.Close();
}
-COpenWfcStreamMap::COpenWfcStreamMap(const COpenWfcStreamMap&)
- {
- Panic(EOwfPanicInvalidCallStreamMap);
- }
-
-COpenWfcStreamMap& COpenWfcStreamMap::operator= (const COpenWfcStreamMap&)
- {
- Panic(EOwfPanicInvalidCallStreamMap);
- return *this;
- }
-
void COpenWfcStreamMap::ConstructL()
{
User::LeaveIfError(iMutex.CreateLocal());
@@ -241,7 +217,8 @@
TSurfaceId surface = TSurfaceId::CreateNullId();
User::LeaveIfError(iMap.Insert(surface, NULL));
- User::LeaveIfError(iSurfaceManager.Open());
+ iSurfaceManager = new(ELeave) RSurfaceManager();
+ User::LeaveIfError(iSurfaceManager->Open());
RProcess process;
TUidType uidType = process.Type();
const TInt32 KWservUid = 268450592;