34 return self; |
34 return self; |
35 } |
35 } |
36 |
36 |
37 // Run the GOOM plugin in order to free memory |
37 // Run the GOOM plugin in order to free memory |
38 // Call the CGOomAction::MemoryFreed when it is done |
38 // Call the CGOomAction::MemoryFreed when it is done |
39 void CGOomRunPlugin::FreeMemory(TInt aBytesRequested) |
39 void CGOomRunPlugin::FreeMemory(TInt aBytesRequested, TBool aUseSwRendering) |
40 { |
40 { |
41 FUNC_LOG; |
41 FUNC_LOG; |
42 TRACES1("CGOomRunPlugin::FreeMemory: iPluginId = 0x%x", iPluginId); |
42 TRACES1("CGOomRunPlugin::FreeMemory: iPluginId = 0x%x", iPluginId); |
43 TRACES1("CGOomRunPlugin::FreeMemory: aBytesRequested = %d", aBytesRequested); |
43 TRACES1("CGOomRunPlugin::FreeMemory: aBytesRequested = %d", aBytesRequested); |
44 |
44 |
45 // Ask the plugin to free some memory, should actually ask the difference |
45 // Ask the plugin to free some memory, should actually ask the difference |
46 // between existing and required amount.. |
46 // between existing and required amount.. |
47 TInt clientId = iStateChangeObserver.ClientId(); |
47 TInt clientId = iStateChangeObserver.ClientId(); |
48 TAny* anyp = (TAny*) &clientId; |
48 TAny* anyp = (TAny*) &clientId; |
49 iPlugin.ExtensionInterface(TUid::Uid(KGoomClientSecureId), anyp); |
49 iPlugin.ExtensionInterface(TUid::Uid(KGoomClientSecureId), anyp); |
50 iPlugin.FreeRam(aBytesRequested); |
50 |
|
51 if(aUseSwRendering && iConfig.IsSwRendSupported()) |
|
52 { |
|
53 TInt flags = KGOomUseSwRendering; |
|
54 iPlugin.FreeRam(aBytesRequested, flags); |
|
55 iFreeMemoryWithSwRenderingCalled = ETrue; |
|
56 } |
|
57 else |
|
58 { |
|
59 iPlugin.FreeRam(aBytesRequested, 0); |
|
60 } |
51 |
61 |
52 iFreeMemoryCalled = ETrue; |
62 iFreeMemoryCalled = ETrue; |
53 |
63 |
54 // Wait for the required time before we signal completion. |
64 // Wait for the required time before we signal completion. |
55 if(iPluginWaiter) |
65 if(iPluginWaiter) |
64 { |
74 { |
65 FUNC_LOG; |
75 FUNC_LOG; |
66 |
76 |
67 if (iFreeMemoryCalled) |
77 if (iFreeMemoryCalled) |
68 { |
78 { |
69 iPlugin.MemoryGood(); |
79 TInt flags = 0; |
|
80 if(iFreeMemoryWithSwRenderingCalled) |
|
81 flags = KGOomUseSwRendering; |
|
82 iPlugin.MemoryGood(flags); |
70 iFreeMemoryCalled = EFalse; |
83 iFreeMemoryCalled = EFalse; |
|
84 iFreeMemoryWithSwRenderingCalled = EFalse; |
71 } |
85 } |
72 } |
86 } |
73 |
87 |
74 CGOomRunPlugin::~CGOomRunPlugin() |
88 CGOomRunPlugin::~CGOomRunPlugin() |
75 { |
89 { |