fbs/fontandbitmapserver/sfbs/FBSCLI.CPP
branchRCL_3
changeset 18 57c618273d5c
parent 4 15986eb6c500
child 19 bbf46f59e123
equal deleted inserted replaced
17:e375a7921169 18:57c618273d5c
    19 #include "fbsmessage.h"
    19 #include "fbsmessage.h"
    20 #include "SERVER.H"
    20 #include "SERVER.H"
    21 #include "BackGroundCompression.h"
    21 #include "BackGroundCompression.h"
    22 #include <shapeinfo.h>
    22 #include <shapeinfo.h>
    23 #include <graphics/shaperparams.h>
    23 #include <graphics/shaperparams.h>
       
    24 #include "OstTraceDefinitions.h"
       
    25 #include "fbstrace.h"
       
    26 #ifdef OST_TRACE_COMPILER_IN_USE
       
    27 #include "FBSCLITraces.h"
       
    28 #endif
       
    29 
    24 
    30 
    25 /** Helper function for converting a pointer to an offset from the passed
    31 /** Helper function for converting a pointer to an offset from the passed
    26 heap base. Use OffsetToPointer() to convert the returned offset back to a
    32 heap base. Use OffsetToPointer() to convert the returned offset back to a
    27 useable pointer.
    33 useable pointer.
    28 @param aAny A pointer to be converted to an offset.
    34 @param aAny A pointer to be converted to an offset.
   208 			break;
   214 			break;
   209 			}
   215 			}
   210 		iIx->Remove(localhandle);
   216 		iIx->Remove(localhandle);
   211 		iResourceCount--;
   217 		iResourceCount--;
   212 		aMessage.Complete(KErrNone);
   218 		aMessage.Complete(KErrNone);
       
   219 		FBS_OST(OstTraceExt3( GRAPHICS_RESOURCE_MANAGEMENT_SEMANTICS, CFBCLIENT_SERVICEL_INFO, "# Server resource destroyed; iSSH=0x%08x; rc=%d; iH=0x%08x;", iSessionHandle, iResourceCount, localhandle);)
   213 #ifdef _DEBUG
   220 #ifdef _DEBUG
   214 		iRet=KErrNone;
   221 		iRet=KErrNone;
   215 #endif				
   222 #endif				
   216 		break;
   223 		break;
   217 		}
   224 		}
   397 		return ret;
   404 		return ret;
   398 		}
   405 		}
   399 
   406 
   400 	// success
   407 	// success
   401 	iResourceCount++;
   408 	iResourceCount++;
       
   409     FBS_OST(OstTraceExt3( GRAPHICS_RESOURCE_MANAGEMENT_SEMANTICS, CFBCLIENT_HANDLEMESGFONTDUPLICATE_INFO, "# Server font duplicated; iSSH=0x%08x; rc=%d; iH=0x%08x;", iSessionHandle, iResourceCount, localhandle);)
   402 	return KErrNone;
   410 	return KErrNone;
   403 	}
   411 	}
   404 
   412 
   405 
   413 
   406 /** Handler for EFbsMessGetNearestFontToDesignHeightInTwips, EFbsMessGetNearestFontToDesignHeightInPixels, 
   414 /** Handler for EFbsMessGetNearestFontToDesignHeightInTwips, EFbsMessGetNearestFontToDesignHeightInPixels, 
   486 		aPanicRequired = ETrue;
   494 		aPanicRequired = ETrue;
   487 		return ret;
   495 		return ret;
   488 		}
   496 		}
   489 	// success
   497 	// success
   490 	iResourceCount++;
   498 	iResourceCount++;
       
   499 	FBS_OST(OstTraceExt3( GRAPHICS_RESOURCE_MANAGEMENT_SEMANTICS, CFBCLIENT_COPYFONTINFOINTORETURNMESSAGE_INFO, "# Server font duplicated; iSSH=0x%08x; rc=%d; iH=0x%08x;", iSessionHandle, iResourceCount, localhandle);)
   491 	return KErrNone;
   500 	return KErrNone;
   492 	}
   501 	}
   493 
   502 
   494 
   503 
   495 /** Handler for EFbsMessGetFontById message
   504 /** Handler for EFbsMessGetFontById message
   969 		if(ret!=KErrNone)
   978 		if(ret!=KErrNone)
   970 			{
   979 			{
   971 			bmpptr->Close();
   980 			bmpptr->Close();
   972 			break;
   981 			break;
   973 			}
   982 			}
       
   983 		
   974 		bmpSpec.iHandle=localhandle;
   984 		bmpSpec.iHandle=localhandle;
   975 		bmpSpec.iServerHandle = bmpptr->Handle();
   985 		bmpSpec.iServerHandle = bmpptr->Handle();
   976 		bmpSpec.iAddressOffset=TInt(bmpptr->Address())-TopLevelStore()->HeapBase();
   986 		bmpSpec.iAddressOffset=TInt(bmpptr->Address())-TopLevelStore()->HeapBase();
   977 		ret = aMessage.Write(0,bs);
   987 		ret = aMessage.Write(0,bs);
   978 		if(ret!=KErrNone)
   988 		if(ret!=KErrNone)
   980 			iIx->Remove(localhandle);
   990 			iIx->Remove(localhandle);
   981 			aMessage.Panic(KFBSERVPanicCategory,ret);
   991 			aMessage.Panic(KFBSERVPanicCategory,ret);
   982 			return;
   992 			return;
   983 			}
   993 			}
   984 		iResourceCount++;
   994 		iResourceCount++;
       
   995 		FBS_OST(OstTraceExt5( GRAPHICS_RESOURCE_MANAGEMENT_SEMANTICS, CFBCLIENT_PROCBITMAPMESSAGE_INFO, "# Server bitmap created; iSSH=0x%08x; rc=%d; iH=0x%08x; iSH=0x%08x; bytes=%d;", iSessionHandle, iResourceCount, bmpSpec.iHandle, bmpSpec.iServerHandle, bmpptr->Address()->DataStride() * bmpSpec.iSizeInPixels.iHeight);)		
   985 		break;
   996 		break;
   986 		}
   997 		}
   987 
   998 
   988 	case EFbsMessBitmapLoad:
   999 	case EFbsMessBitmapLoad:
   989 	case EFbsMessBitmapLoadFast:
  1000 	case EFbsMessBitmapLoadFast:
  1087 			iIx->Remove(localhandle);
  1098 			iIx->Remove(localhandle);
  1088 			aMessage.Panic(KFBSERVPanicCategory,ret);
  1099 			aMessage.Panic(KFBSERVPanicCategory,ret);
  1089 			return;
  1100 			return;
  1090 			}
  1101 			}
  1091 		iResourceCount++;
  1102 		iResourceCount++;
       
  1103         FBS_OST(OstTraceExt5( GRAPHICS_RESOURCE_MANAGEMENT_SEMANTICS, CFBCLIENT_PROCBITMAPMESSAGE_INFO2, "# Server bitmap loaded; iSSH=0x%08x; rc=%d; iH=0x%08x; iSH=0x%08x; bytes=%d;", iSessionHandle, iResourceCount, handlebuffer().iHandle, handlebuffer().iServerHandle, bmpptr->Address()->DataStride() * bmpptr->Address()->SizeInPixels().iHeight);)
  1092 		break;
  1104 		break;
  1093 		}
  1105 		}
  1094 	case EFbsMessBitmapResize:
  1106 	case EFbsMessBitmapResize:
  1095 		{
  1107 		{
  1096 		localhandle=aMessage.Int0();
  1108 		localhandle=aMessage.Int0();
  1156 			{
  1168 			{
  1157 			iIx->Remove(newlocalhandle);
  1169 			iIx->Remove(newlocalhandle);
  1158 			aMessage.Panic(KFBSERVPanicCategory, ret);
  1170 			aMessage.Panic(KFBSERVPanicCategory, ret);
  1159 			return;
  1171 			return;
  1160 			}
  1172 			}
       
  1173         FBS_OST(OstTraceExt5( GRAPHICS_RESOURCE_MANAGEMENT_SEMANTICS, CFBCLIENT_PROCBITMAPMESSAGE_INFO4, "# Server bitmap resized; iSSH=0x%08x; iOldH=0x%08x; iNewH=0x%08x; iNewSH=0x%08x; newbytes=%d;", iSessionHandle, localhandle, newlocalhandle, newbmpptr->Handle(), newbmpptr->Address()->DataStride() * newsize.iHeight);)
  1161 		break;
  1174 		break;
  1162 		}
  1175 		}
  1163 	case EFbsMessBitmapDuplicate:
  1176 	case EFbsMessBitmapDuplicate:
  1164 		{
  1177 		{
  1165 		bmpptr = TopLevelStore()->FindBitmap(aMessage.Int0());
  1178 		bmpptr = TopLevelStore()->FindBitmap(aMessage.Int0());
  1190 			iIx->Remove(localhandle);
  1203 			iIx->Remove(localhandle);
  1191 			aMessage.Panic(KFBSERVPanicCategory,ret);
  1204 			aMessage.Panic(KFBSERVPanicCategory,ret);
  1192 			return;
  1205 			return;
  1193 			}
  1206 			}
  1194 		iResourceCount++;
  1207 		iResourceCount++;
       
  1208         FBS_OST(OstTraceExt5( GRAPHICS_RESOURCE_MANAGEMENT_SEMANTICS, CFBCLIENT_PROCBITMAPMESSAGE_INFO3, "# Server bitmap duplicated; iSSH=0x%08x; rc=%d; iH=0x%08x; iSH=0x%08x; bytes=%d;", iSessionHandle, iResourceCount, handlebuffer().iHandle, handlebuffer().iServerHandle, bmpptr->Address()->DataStride() * bmpptr->Address()->SizeInPixels().iHeight);)
  1195 		break;
  1209 		break;
  1196 		}
  1210 		}
  1197 	case EFbsMessBitmapCompress:
  1211 	case EFbsMessBitmapCompress:
  1198 		{
  1212 		{
  1199 		localhandle = aMessage.Int0();
  1213 		localhandle = aMessage.Int0();
  1251 			{
  1265 			{
  1252 			iIx->Remove(newlocalhandle);
  1266 			iIx->Remove(newlocalhandle);
  1253 			aMessage.Panic(KFBSERVPanicCategory, ret);
  1267 			aMessage.Panic(KFBSERVPanicCategory, ret);
  1254 			return;
  1268 			return;
  1255 			}
  1269 			}
       
  1270         FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_SEMANTICS, CFBCLIENT_PROCBITMAPMESSAGE_INFO5, "# Server bitmap compressed; iSSH=0x%08x; iOldH=0x%08x; iNewH=0x%08x; iNewSH=0x%08x;", (TUint)iSessionHandle, localhandle, newlocalhandle, handlebuffer().iServerHandle);)
  1256 		break;
  1271 		break;
  1257 		}
  1272 		}
  1258 	case EFbsMessBitmapBgCompress:
  1273 	case EFbsMessBitmapBgCompress:
  1259 		{
  1274 		{
  1260 		localhandle = aMessage.Int0();
  1275 		localhandle = aMessage.Int0();
  1318 			{
  1333 			{
  1319 			iIx->Remove(cleanlocalhandle);
  1334 			iIx->Remove(cleanlocalhandle);
  1320 			aMessage.Panic(KFBSERVPanicCategory, ret);
  1335 			aMessage.Panic(KFBSERVPanicCategory, ret);
  1321 			return;
  1336 			return;
  1322 			}
  1337 			}
       
  1338 		FBS_OST(OstTraceExt3( GRAPHICS_RESOURCE_MANAGEMENT_SEMANTICS, CFBCLIENT_PROCBITMAPMESSAGE_INFO6, "# Server bitmap cleaned; iSSH=0x%08x; iOldH=0x%08x; iNewH=0x%08x;", iSessionHandle, localhandle, cleanlocalhandle);)
  1323 		break;
  1339 		break;
  1324 		}
  1340 		}
  1325 	case EFbsGetAllBitmapHandles:
  1341 	case EFbsGetAllBitmapHandles:
  1326 		{
  1342 		{
  1327 		ret = TopLevelStore()->GetAllBitmapHandles(aMessage);		
  1343 		ret = TopLevelStore()->GetAllBitmapHandles(aMessage);