|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include "tdirectgdi_server.h" |
|
17 #include "tbitblt.h" |
|
18 #include "tbitbltmasked.h" |
|
19 #include "tdrawbitmap.h" |
|
20 #include "tdrawbitmapmasked.h" |
|
21 #include "tgeneraldrawing.h" |
|
22 #include "tclear.h" |
|
23 #include "tdrawshapes.h" |
|
24 #include "tbrushandpen.h" |
|
25 #include "tclipping.h" |
|
26 #include "tcopyrect.h" |
|
27 #include "tdrawtext.h" |
|
28 #include "tdirectgdidriver.h" |
|
29 #include "tdirectgdicontext.h" |
|
30 #include "tpanictests.h" |
|
31 #include "tdirectgdicontexttarget.h" |
|
32 #include "tmultithread.h" |
|
33 #include "tglyphimagecache.h" |
|
34 #include "tvgimagecache.h" |
|
35 #include "tdirectgdiresource.h" |
|
36 #include "tdirectgdioom.h" |
|
37 #include "tinterleaving.h" |
|
38 #include "tdirectgdinoadapter.h" |
|
39 #include "textendedbitmap.h" |
|
40 #include <graphics/fbsdefs.h> |
|
41 |
|
42 _LIT(KServerName,"tdirectgdi_server"); |
|
43 |
|
44 |
|
45 CTDirectGdiServer* CTDirectGdiServer::NewL() |
|
46 { |
|
47 CTDirectGdiServer* server = new (ELeave) CTDirectGdiServer(); |
|
48 CleanupStack::PushL(server); |
|
49 // CServer base class call |
|
50 server->StartL(KServerName); |
|
51 CleanupStack::Pop(server); |
|
52 return server; |
|
53 } |
|
54 |
|
55 LOCAL_C void MainL() |
|
56 { |
|
57 CActiveScheduler* sched=NULL; |
|
58 sched=new(ELeave) CActiveScheduler; |
|
59 CActiveScheduler::Install(sched); |
|
60 CTDirectGdiServer* server = NULL; |
|
61 |
|
62 // Create the CTestServer derived server |
|
63 server = CTDirectGdiServer::NewL(); |
|
64 // startup fbs server |
|
65 FbsStartup(); |
|
66 // Sync with the client and enter the active scheduler |
|
67 RProcess::Rendezvous(KErrNone); |
|
68 sched->Start(); |
|
69 |
|
70 delete server; |
|
71 delete sched; |
|
72 } |
|
73 |
|
74 |
|
75 GLDEF_C TInt E32Main() |
|
76 { |
|
77 __UHEAP_MARK; |
|
78 CTrapCleanup* cleanup = CTrapCleanup::New(); |
|
79 if(cleanup == NULL) |
|
80 { |
|
81 return KErrNoMemory; |
|
82 } |
|
83 TRAPD(err,MainL()); |
|
84 if (err) |
|
85 { |
|
86 RDebug::Print(_L("TDirectGdiServer::MainL - Error: %d"), err); |
|
87 User::Panic(KServerName,err); |
|
88 } |
|
89 delete cleanup; |
|
90 __UHEAP_MARKEND; |
|
91 return KErrNone; |
|
92 } |
|
93 |
|
94 |
|
95 CTestStep* CTDirectGdiServer::CreateTestStep(const TDesC& aStepName) |
|
96 { |
|
97 CTestStep* testStep = NULL; |
|
98 |
|
99 if (aStepName == KTDirectGdiBitBltStep) |
|
100 { |
|
101 testStep = new CTBitBlt(); |
|
102 } |
|
103 else if(aStepName == KTDirectGdiBitBltMaskedStep) |
|
104 { |
|
105 testStep = new CTBitBltMasked(); |
|
106 } |
|
107 else if(aStepName == KTDirectGdiDrawBitmapStep) |
|
108 { |
|
109 testStep = new CTDrawBitmap(); |
|
110 } |
|
111 else if(aStepName == KTDirectGdiDrawBitmapMaskedStep) |
|
112 { |
|
113 testStep = new CTDrawBitmapMasked(); |
|
114 } |
|
115 else if(aStepName == KTDirectGdiDriverStep) |
|
116 { |
|
117 testStep = new CTDirectGdiDriver(); |
|
118 } |
|
119 else if(aStepName == KTDirectGdiContextStep) |
|
120 { |
|
121 testStep = new CTDirectGdiContext(); |
|
122 } |
|
123 else if(aStepName == KTDirectGdiGeneralDrawingStep) |
|
124 { |
|
125 testStep = new CTGeneralDrawing(); |
|
126 } |
|
127 else if(aStepName == KTDirectGdiClearStep) |
|
128 { |
|
129 testStep = new CTClear(); |
|
130 } |
|
131 else if(aStepName == KTDirectGdiDrawShapeStep) |
|
132 { |
|
133 testStep = new CTDrawShapes(); |
|
134 } |
|
135 else if(aStepName == KTDirectGdiBrushAndPenStep) |
|
136 { |
|
137 testStep = new CTBrushAndPen(); |
|
138 } |
|
139 else if(aStepName == KTDirectGdiDrawTextStep) |
|
140 { |
|
141 testStep = new CTDrawText(); |
|
142 } |
|
143 else if(aStepName == KTDirectGdiClippingStep) |
|
144 { |
|
145 testStep = new CTClipping(); |
|
146 } |
|
147 else if(aStepName == KTDirectGdiCopyRectStep) |
|
148 { |
|
149 testStep = new CTCopyRect(); |
|
150 } |
|
151 else if(aStepName == KTDirectGdiPanicTestsStep) |
|
152 { |
|
153 testStep = new CTPanicTests(); |
|
154 } |
|
155 else if(aStepName == KTDirectGdiContextTargetStep) |
|
156 { |
|
157 testStep = new CTDirectGdiContextTarget(); |
|
158 } |
|
159 else if(aStepName == KTMultiThreadStep) |
|
160 { |
|
161 testStep = new CTMultiThread(); |
|
162 } |
|
163 else if(aStepName == KTGlyphImageCacheStep) |
|
164 { |
|
165 testStep = new CTGlyphImageCache(); |
|
166 } |
|
167 else if(aStepName == KTDirectGdiVgImageCacheStep) |
|
168 { |
|
169 testStep = new CTVgImageCache(); |
|
170 } |
|
171 else if(aStepName == KTDirectGdiResourceStep) |
|
172 { |
|
173 testStep = new CTDirectGdiResource(); |
|
174 } |
|
175 else if(aStepName == KTDirectGdiOom) |
|
176 { |
|
177 testStep = new CTDirectGdiOom(); |
|
178 } |
|
179 else if(aStepName == KTDirectGdiInterleavingStep) |
|
180 { |
|
181 testStep = new CTInterleaving(); |
|
182 } |
|
183 else if(aStepName == KTDirectGdiNoAdapter) |
|
184 { |
|
185 testStep = new CTNoAdapter(); |
|
186 } |
|
187 else if(aStepName == KTDirectGdiExtendedBitmapStep) |
|
188 { |
|
189 testStep = new CTExtendedBitmap(); |
|
190 } |
|
191 return testStep; |
|
192 } |
|
193 |