First public contribution.
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Graphics-Out-Of-Memory plugin for Font and Bitmap server.
18 #include <ecom/ecom.h>
19 #include <ecom/implementationproxy.h>
20 #include <graphics/fbsoogmmessage.h>
24 #include "fbsoogmplugin.h"
25 #include "OstTraceDefinitions.h"
26 #ifdef OST_TRACE_COMPILER_IN_USE
27 #include "fbsoogmpluginTraces.h"
32 Called by the GOoM monitor framework in the case of low GPU memory.
34 Note: In the case of failure, this framework method will do so silently.
36 @param aBytesToFree The amount of GPU memory to be freed.
38 void CFbsOogmMonitorPlugin::FreeRam( TInt aBytesToFree, TInt aFlags )
40 OstTrace0( TRACE_NORMAL, CFBSOOGMMONITORPLUGIN_FREERAM, "> " );
42 if ( (NULL == RFbsSession::GetSession()) )
44 if ( KErrNone != RFbsSession::Connect() )
46 OstTrace0( TRACE_NORMAL, DUP2_CFBSOOGMMONITORPLUGIN_FREERAM, "< No FbsSession" );
53 TFbsOogmMessage oogmMessage( TFbsOogmMessage::EFbsOogmLowNotification, aBytesToFree, aFlags );
54 (void)RFbsSession::GetSession()->ConveyOogmMessage( oogmMessage );
56 OstTrace0( TRACE_NORMAL, DUP1_CFBSOOGMMONITORPLUGIN_FREERAM, "< " );
62 Called by the GOoM monitor framework in the case of normal GPU memory-usage being permissible.
64 Note: In the case of failure, this framework method will do so silently.
66 void CFbsOogmMonitorPlugin::MemoryGood( TInt aFlags )
68 OstTrace0( TRACE_NORMAL, CFBSOOGMMONITORPLUGIN_MEMORYGOOD, ">" );
70 if ( (NULL == RFbsSession::GetSession()) )
72 if ( KErrNone != RFbsSession::Connect() )
74 OstTrace0( TRACE_NORMAL, DUP2_CFBSOOGMMONITORPLUGIN_MEMORYGOOD, "< No FbsSession" );
81 const TInt KOogmDummyIntegerArgument = 0;
82 TFbsOogmMessage oogmMessage( TFbsOogmMessage::EFbsOogmOkayNotification, KOogmDummyIntegerArgument, aFlags );
83 (void)RFbsSession::GetSession()->ConveyOogmMessage( oogmMessage );
85 OstTrace0( TRACE_NORMAL, DUP1_CFBSOOGMMONITORPLUGIN_MEMORYGOOD, "<" );
93 CFbsOogmMonitorPlugin::CFbsOogmMonitorPlugin()
102 CFbsOogmMonitorPlugin::~CFbsOogmMonitorPlugin()
104 RFbsSession::Disconnect();
112 void CFbsOogmMonitorPlugin::ConstructL()
114 CGOomMonitorPluginBase::ConstructL();
124 CFbsOogmMonitorPlugin* self = new CFbsOogmMonitorPlugin;
127 TRAPD( err, self->ConstructL() );
128 if ( err != KErrNone )
143 const TImplementationProxy ImplementationTable[] =
145 { {0x2002B638}, ::CreatePlugin }
153 EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
155 OstTrace0( TRACE_NORMAL, _IMPLEMENTATIONGROUPPROXY, "> ::ImplementationGroupProxy" );
157 aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ) ;
158 return ImplementationTable;