|
1 /* |
|
2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Definition of CHuiCanvasAlfPainter. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #include "uiacceltk/HuiCanvasVisual.h" |
|
22 #include "HuiRenderPlugin.h" |
|
23 #include "uiacceltk/HuiGc.h" |
|
24 #include "uiacceltk/HuiPanic.h" |
|
25 #include "uiacceltk/HuiUtil.h" |
|
26 #include "uiacceltk/HuiStatic.h" |
|
27 #include "uiacceltk/HuiEnv.h" |
|
28 #include "uiacceltk/HuiControl.h" |
|
29 #include "uiacceltk/HuiVisual.h" |
|
30 #include "uiacceltk/HuiTextMesh.h" |
|
31 #include "uiacceltk/HuiCanvasCmdBufferReader.h" |
|
32 #include "huicanvasgc.h" |
|
33 #include "HuiRenderSurface.h" |
|
34 #include "huicanvastexturecache.h" |
|
35 #include "huicanvasbackground.h" |
|
36 #include <graphics/wsgraphicscontext.h> |
|
37 #include <e32cmn.h> |
|
38 #include <AknLayoutFont.h> |
|
39 #include "huicanvasalfpainter.h" |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 template <class T> |
|
45 void HuiCanavasGcInternalizeL( const TDesC8& aDes, RArray<T>& aArray ) |
|
46 { |
|
47 aArray.Reset(); |
|
48 if ( !aDes.Length() ) |
|
49 { |
|
50 return; |
|
51 } |
|
52 |
|
53 TInt itemCount = 0; |
|
54 memcpy(&itemCount, &aDes[0], sizeof(TInt)); |
|
55 |
|
56 TPtrC8 buffer( &aDes[4], itemCount*sizeof(T) ); |
|
57 |
|
58 for ( TInt i = 0 ; i < itemCount ; i++ ) |
|
59 { |
|
60 T* itemPtr = (T*)&buffer[i*sizeof(T)]; |
|
61 T item = *itemPtr; |
|
62 User::LeaveIfError( aArray.Append( item ) ); |
|
63 } |
|
64 } |
|
65 |
|
66 |
|
67 CHuiCanvasAlfPainter* CHuiCanvasAlfPainter::NewL() |
|
68 { |
|
69 CHuiCanvasAlfPainter* self = new ( ELeave ) CHuiCanvasAlfPainter; |
|
70 CleanupStack::PushL( self ); |
|
71 self->ConstructL(); |
|
72 CleanupStack::Pop(); |
|
73 |
|
74 return self; |
|
75 } |
|
76 |
|
77 |
|
78 CHuiCanvasAlfPainter::CHuiCanvasAlfPainter() |
|
79 { |
|
80 } |
|
81 |
|
82 void CHuiCanvasAlfPainter::ConstructL() |
|
83 { |
|
84 iPartialCommandBuffer = NULL; |
|
85 iCanvasGc = CHuiStatic::Renderer().CreateCanvasGcL(); |
|
86 } |
|
87 |
|
88 |
|
89 CHuiCanvasAlfPainter::~CHuiCanvasAlfPainter() |
|
90 { |
|
91 iCachedTexts.Close(); |
|
92 iPointCords.Close(); |
|
93 delete iCanvasGc; |
|
94 iCanvasGc = NULL; |
|
95 } |
|
96 |
|
97 |
|
98 void CHuiCanvasAlfPainter::HandleBufferL(TRect& aDisplayRect, TInt aAction, const CHuiCanvasVisual& aUser, CHuiGc* aGc, TPoint/* aPos*/ ) |
|
99 { |
|
100 TInt commandNumber = 0; |
|
101 TInt currentText = -1; |
|
102 TInt bufferCount = iCommandBuffers.Count(); |
|
103 iCanvasGc->SetVisual(aUser); |
|
104 if ( aGc ) |
|
105 { |
|
106 iCanvasGc->SetGc(*aGc); |
|
107 } |
|
108 iCanvasGc->SetDefaults(); |
|
109 |
|
110 for (TInt cb = 0; cb < bufferCount; cb++) |
|
111 { |
|
112 TPtrC8 ptr = *iCommandBuffers[cb]->iCommands; |
|
113 while ( ptr.Length() ) |
|
114 { |
|
115 TInt command = 0; |
|
116 memcpy(&command, &ptr[0], sizeof(TInt)); |
|
117 |
|
118 ptr.Set( ptr.Right( ptr.Length() - 4 ) ); |
|
119 |
|
120 TInt bufferLength = 0; |
|
121 memcpy(&bufferLength, &ptr[0], sizeof(TInt)); |
|
122 |
|
123 // Make sure we are aligned by 4 bytes |
|
124 TInt padding = 0; |
|
125 if (bufferLength % 4) |
|
126 { |
|
127 padding = 4 - (bufferLength % 4); |
|
128 } |
|
129 bufferLength += padding; |
|
130 |
|
131 ptr.Set( ptr.Right( ptr.Length() - 4 ) ); |
|
132 |
|
133 TPtrC8 buffer( ptr.Left( bufferLength ).Ptr(), bufferLength ); |
|
134 |
|
135 ptr.Set( ptr.Right( ptr.Length() - bufferLength) ); |
|
136 |
|
137 commandNumber++; |
|
138 switch( command ) |
|
139 { |
|
140 case EHuiCanvasDrawImage: |
|
141 { |
|
142 const THuiCanvasDrawImageParams* const params = (THuiCanvasDrawImageParams*)buffer.Ptr(); |
|
143 |
|
144 CHuiTexture* texture = (CHuiTexture*)(params->iTexture); |
|
145 |
|
146 THuiRealPoint topLeft = THuiRealPoint(params->iDestinationRectTopLeftX, |
|
147 params->iDestinationRectTopLeftY); |
|
148 |
|
149 THuiRealPoint bottomRight = THuiRealPoint(params->iDestinationRectBottomRightX, |
|
150 params->iDestinationRectBottomRightY); |
|
151 |
|
152 // Conversion to pixels (if needed) and to screen coordinates from visual coordinates |
|
153 THuiRealRect destRect = THuiRealRect(aUser.ConvertPoint(topLeft), aUser.ConvertPoint(bottomRight)); |
|
154 |
|
155 if (aAction == EDrawBuffer) |
|
156 { |
|
157 iCanvasGc->DrawImage(*texture, destRect); |
|
158 } |
|
159 else |
|
160 { |
|
161 aUser.ExpandRect(aDisplayRect, destRect); |
|
162 } |
|
163 break; |
|
164 } |
|
165 case EHuiCanvasPrepareDrawText: |
|
166 { |
|
167 TPtrC text((const TUint16*)buffer.Ptr(), buffer.Length()/2); |
|
168 |
|
169 // Check if we already have created a rasterized version of text into cache... |
|
170 TInt cachedEntry = -1; |
|
171 for (TInt i=0; i < iCachedTexts.Count(); i++) |
|
172 { |
|
173 if (iCachedTexts[i].iId == commandNumber) |
|
174 { |
|
175 cachedEntry = i; |
|
176 } |
|
177 } |
|
178 |
|
179 // ...no, this is first drawing time so we need to rasterize text |
|
180 if (cachedEntry == -1) |
|
181 { |
|
182 // Create new text mesh |
|
183 CHuiTextMesh* mesh = CHuiStatic::Renderer().CreateTextMeshL(); |
|
184 CleanupStack::PushL(mesh); |
|
185 mesh->SetTextStyle(iCanvasGc->TextStyle()); |
|
186 mesh->SetTextL(text, ETrue); |
|
187 |
|
188 THuiCanvasDrawTextCachedTextEntry newEntry; |
|
189 newEntry.iId = commandNumber; |
|
190 newEntry.iTextMesh = mesh; |
|
191 iCachedTexts.AppendL(newEntry); |
|
192 CleanupStack::Pop(mesh); |
|
193 cachedEntry = iCachedTexts.Count() - 1; |
|
194 } |
|
195 |
|
196 currentText = commandNumber; |
|
197 break; |
|
198 } |
|
199 case EHuiCanvasDrawText: |
|
200 { |
|
201 const THuiCanvasDrawTextParams* const params = (THuiCanvasDrawTextParams*)buffer.Ptr(); |
|
202 |
|
203 THuiRealPoint topLeft = THuiRealPoint(params->iDestinationRectTopLeftX, |
|
204 params->iDestinationRectTopLeftY); |
|
205 |
|
206 THuiRealPoint bottomRight = THuiRealPoint(params->iDestinationRectBottomRightX, |
|
207 params->iDestinationRectBottomRightY); |
|
208 |
|
209 // Conversion to pixels (if needed) and to screen coordinates from visual coordinates |
|
210 THuiRealRect destRect = THuiRealRect(aUser.ConvertPoint(topLeft), aUser.ConvertPoint(bottomRight)); |
|
211 |
|
212 // Check if we already have created a rasterized version of text into cache... |
|
213 TInt cachedEntry = -1; |
|
214 for (TInt i=0; i < iCachedTexts.Count(); i++) |
|
215 { |
|
216 if (iCachedTexts[i].iId == currentText) |
|
217 { |
|
218 cachedEntry = i; |
|
219 } |
|
220 } |
|
221 |
|
222 if (cachedEntry != -1 && iCachedTexts[cachedEntry].iTextMesh) |
|
223 { |
|
224 if (aAction == EDrawBuffer) |
|
225 { |
|
226 iCanvasGc->DrawText(*iCachedTexts[cachedEntry].iTextMesh, destRect); |
|
227 } |
|
228 else if (aAction == EScanBuffer) |
|
229 { |
|
230 TSize extents = iCachedTexts[cachedEntry].iTextMesh->Extents(); |
|
231 TRect destinationRect = destRect; |
|
232 TPoint tl = destinationRect.Center(); |
|
233 switch( iCanvasGc->TextHorizontalAlign() ) |
|
234 { |
|
235 case EHuiAlignHLeft: |
|
236 tl.iX = destinationRect.iTl.iX; |
|
237 break; |
|
238 case EHuiAlignHCenter: |
|
239 tl.iX -= extents.iWidth/2; |
|
240 break; |
|
241 case EHuiAlignHRight: |
|
242 tl.iX = destinationRect.iBr.iX - extents.iWidth; |
|
243 break; |
|
244 default: |
|
245 break; |
|
246 } |
|
247 |
|
248 // check top left Y |
|
249 switch( iCanvasGc->TextVerticalAlign() ) |
|
250 { |
|
251 case EHuiAlignVTop: |
|
252 tl.iY = destinationRect.iTl.iY; |
|
253 break; |
|
254 case EHuiAlignVCenter: |
|
255 tl.iY -= extents.iHeight/2; |
|
256 break; |
|
257 case EHuiAlignVBottom: |
|
258 tl.iY = destinationRect.iBr.iY - extents.iHeight; |
|
259 break; |
|
260 default: |
|
261 break; |
|
262 } |
|
263 |
|
264 TRect textExtendsRect(tl, extents); |
|
265 aUser.ExpandRect(aDisplayRect, textExtendsRect); |
|
266 } |
|
267 } |
|
268 |
|
269 break; |
|
270 } |
|
271 case EHuiCanvasDrawLines: |
|
272 { |
|
273 iPointCords.Reset(); |
|
274 TRAP_IGNORE(HuiCanavasGcInternalizeL(buffer, iPointCords)) |
|
275 TInt linecount = iPointCords.Count()/4; |
|
276 RArray<THuiRealLine> lines; |
|
277 for(TInt i=0, j=0; i<linecount; i++) |
|
278 { |
|
279 THuiRealPoint start(iPointCords[j], iPointCords[j+1]); |
|
280 THuiRealPoint end(iPointCords[j+2], iPointCords[j+3]); |
|
281 THuiRealLine line(aUser.ConvertPoint(start), aUser.ConvertPoint(end)); |
|
282 lines.Append(line); |
|
283 j += 4; |
|
284 } |
|
285 |
|
286 if (aAction == EDrawBuffer) |
|
287 { |
|
288 iCanvasGc->DrawLines(lines); |
|
289 } |
|
290 else |
|
291 { |
|
292 for (TInt i=0;i<lines.Count();i++) |
|
293 { |
|
294 TRect pointRect = TRect(lines[i].iStart,lines[i].iStart ); |
|
295 pointRect.Grow(iCanvasGc->PenWidth(), iCanvasGc->PenWidth()); |
|
296 aUser.ExpandRect(aDisplayRect, pointRect); |
|
297 |
|
298 pointRect = TRect(lines[i].iEnd,lines[i].iEnd ); |
|
299 pointRect.Grow(iCanvasGc->PenWidth(), iCanvasGc->PenWidth()); |
|
300 aUser.ExpandRect(aDisplayRect, pointRect); |
|
301 } |
|
302 } |
|
303 lines.Close(); |
|
304 break; |
|
305 } |
|
306 |
|
307 case EHuiCanvasDrawEllipse: |
|
308 { |
|
309 const THuiCanvasDrawEllipseParams* const params = (THuiCanvasDrawEllipseParams*)buffer.Ptr(); |
|
310 |
|
311 THuiRealPoint topLeft = THuiRealPoint(params->iDestinationRectTopLeftX, params->iDestinationRectTopLeftY); |
|
312 |
|
313 THuiRealPoint bottomRight = THuiRealPoint(params->iDestinationRectBottomRightX, params->iDestinationRectBottomRightY); |
|
314 |
|
315 // Conversion to pixels (if needed) and to screen coordinates from visual coordinates |
|
316 THuiRealRect destRect = THuiRealRect(aUser.ConvertPoint(topLeft), aUser.ConvertPoint(bottomRight)); |
|
317 |
|
318 if (aAction == EDrawBuffer) |
|
319 { |
|
320 iCanvasGc->DrawEllipse(destRect); |
|
321 } |
|
322 else |
|
323 { |
|
324 aUser.ExpandRect(aDisplayRect, destRect); |
|
325 } |
|
326 break; |
|
327 } |
|
328 case EHuiCanvasDrawPoints: |
|
329 { |
|
330 iPointCords.Reset(); |
|
331 TRAP_IGNORE(HuiCanavasGcInternalizeL(buffer, iPointCords)) |
|
332 TInt pointcount = iPointCords.Count()/2; |
|
333 RArray<THuiRealPoint> points; |
|
334 for(TInt i=0, j=0; i<pointcount; i++) |
|
335 { |
|
336 THuiRealPoint point(iPointCords[j], iPointCords[j+1]); |
|
337 points.Append(aUser.ConvertPoint(point)); |
|
338 j += 2; |
|
339 } |
|
340 |
|
341 if (aAction == EDrawBuffer) |
|
342 { |
|
343 iCanvasGc->DrawPoints(points); |
|
344 } |
|
345 else |
|
346 { |
|
347 for (TInt i=0;i<points.Count();i++) |
|
348 { |
|
349 TRect pointRect = TRect(points[i],points[i]); |
|
350 pointRect.Grow(iCanvasGc->PenWidth(), iCanvasGc->PenWidth()); |
|
351 aUser.ExpandRect(aDisplayRect, pointRect); |
|
352 } |
|
353 } |
|
354 points.Close(); |
|
355 break; |
|
356 } |
|
357 case EHuiCanvasDrawPolygon: |
|
358 { |
|
359 iPointCords.Reset(); |
|
360 TRAP_IGNORE(HuiCanavasGcInternalizeL(buffer, iPointCords)) |
|
361 TInt pointcount = iPointCords.Count()/2; |
|
362 RArray<THuiRealPoint> points; |
|
363 for(TInt i=0, j=0; i<pointcount; i++) |
|
364 { |
|
365 THuiRealPoint point(iPointCords[j], iPointCords[j+1]); |
|
366 points.Append(aUser.ConvertPoint(point)); |
|
367 j += 2; |
|
368 } |
|
369 |
|
370 if (aAction == EDrawBuffer) |
|
371 { |
|
372 iCanvasGc->DrawPolygon(points); |
|
373 } |
|
374 else |
|
375 { |
|
376 for (TInt i=0;i<points.Count();i++) |
|
377 { |
|
378 TRect pointRect = TRect(points[i],points[i]); |
|
379 pointRect.Grow(iCanvasGc->PenWidth(), iCanvasGc->PenWidth()); |
|
380 aUser.ExpandRect(aDisplayRect, pointRect); |
|
381 } |
|
382 } |
|
383 |
|
384 points.Close(); |
|
385 break; |
|
386 } |
|
387 case EHuiCanvasDrawRects: |
|
388 { |
|
389 iPointCords.Reset(); |
|
390 TRAP_IGNORE(HuiCanavasGcInternalizeL(buffer, iPointCords)) |
|
391 TInt rectcount = iPointCords.Count()/4; |
|
392 RArray<THuiRealRect> rects; |
|
393 for(TInt i=0, j=0; i<rectcount; i++) |
|
394 { |
|
395 THuiRealPoint topleft(iPointCords[j], iPointCords[j+1]); |
|
396 THuiRealPoint bottomright(iPointCords[j+2], iPointCords[j+3]); |
|
397 THuiRealRect rect(aUser.ConvertPoint(topleft), aUser.ConvertPoint(bottomright)); |
|
398 rects.Append(rect); |
|
399 j += 4; |
|
400 } |
|
401 |
|
402 if (aAction == EDrawBuffer) |
|
403 { |
|
404 iCanvasGc->DrawRects(rects); |
|
405 } |
|
406 else |
|
407 { |
|
408 for (TInt i=0;i<rects.Count();i++) |
|
409 { |
|
410 TRect pointRect = rects[i]; |
|
411 pointRect.Grow(iCanvasGc->PenWidth(), iCanvasGc->PenWidth()); |
|
412 aUser.ExpandRect(aDisplayRect, pointRect); |
|
413 } |
|
414 } |
|
415 |
|
416 rects.Close(); |
|
417 break; |
|
418 } |
|
419 |
|
420 case EHuiCanvasSetTextStyle: |
|
421 { |
|
422 const THuiCanvasSetTextStyleParams* const params = (THuiCanvasSetTextStyleParams*)buffer.Ptr(); |
|
423 iCanvasGc->SetTextStyle(params->iTextStyleId); |
|
424 break; |
|
425 } |
|
426 |
|
427 case EHuiCanvasSetPenColor: |
|
428 { |
|
429 const THuiCanvasSetPenColorParams* const params = (THuiCanvasSetPenColorParams*)buffer.Ptr(); |
|
430 iCanvasGc->SetPenColor(params->iPenColor); |
|
431 break; |
|
432 } |
|
433 case EHuiCanvasSetPenWidth: |
|
434 { |
|
435 const THuiCanvasSetPenWidthParams* const params = (THuiCanvasSetPenWidthParams*)buffer.Ptr(); |
|
436 iCanvasGc->SetPenWidth(params->iPenWidth); |
|
437 break; |
|
438 } |
|
439 case EHuiCanvasSetOpacity: |
|
440 { |
|
441 const THuiCanvasSetOpacityParams* const params = (THuiCanvasSetOpacityParams*)buffer.Ptr(); |
|
442 iCanvasGc->SetOpacity(params->iOpacity); |
|
443 break; |
|
444 } |
|
445 case EHuiCanvasSetPolygonDrawMode: |
|
446 { |
|
447 const THuiCanvasSetPolygonDrawModeParams* const params = (THuiCanvasSetPolygonDrawModeParams*)buffer.Ptr(); |
|
448 iCanvasGc->SetPolygonDrawMode(params->iPolygonDrawMode); |
|
449 break; |
|
450 } |
|
451 case EHuiCanvasSetTextAlign: |
|
452 { |
|
453 const THuiCanvasSetTextAlignParams* const params = (THuiCanvasSetTextAlignParams*)buffer.Ptr(); |
|
454 iCanvasGc->SetTextAlign(THuiAlignHorizontal(params->iTextAlignHorizontal), THuiAlignVertical(params->iTextAlignVertical)); |
|
455 break; |
|
456 } |
|
457 |
|
458 case EHuiCanvasLoadIdentity: |
|
459 { |
|
460 if (aAction == EDrawBuffer) |
|
461 { |
|
462 iCanvasGc->LoadIdentity(); |
|
463 } |
|
464 break; |
|
465 } |
|
466 case EHuiCanvasTranslate: |
|
467 { |
|
468 const THuiCanvasTranslateParams* const params = (THuiCanvasTranslateParams*)buffer.Ptr(); |
|
469 if (aAction == EDrawBuffer) |
|
470 { |
|
471 iCanvasGc->Translate(aUser.ConvertPoint(THuiRealPoint(params->iX,0)).iX, |
|
472 aUser.ConvertPoint(THuiRealPoint(params->iY,0)).iX, |
|
473 aUser.ConvertPoint(THuiRealPoint(params->iZ,0)).iX); |
|
474 } |
|
475 else |
|
476 { |
|
477 // Calculating transformations may be too difficult, so just set largest possible rect |
|
478 if (aUser.Clipping() || !aUser.Display()) |
|
479 { |
|
480 aUser.ExpandRect(aDisplayRect, aUser.DisplayRect()); |
|
481 } |
|
482 else |
|
483 { |
|
484 aUser.ExpandRect(aDisplayRect, aUser.Display()->VisibleArea()); |
|
485 } |
|
486 } |
|
487 break; |
|
488 } |
|
489 case EHuiCanvasScale: |
|
490 { |
|
491 const THuiCanvasScaleParams* const params = (THuiCanvasScaleParams*)buffer.Ptr(); |
|
492 if (aAction == EDrawBuffer) |
|
493 { |
|
494 iCanvasGc->Scale(params->iX, params->iY, params->iZ); |
|
495 } |
|
496 else |
|
497 { |
|
498 // Calculating transformations may be too difficult, so just set largest possible rect |
|
499 if (aUser.Clipping() || !aUser.Display()) |
|
500 { |
|
501 aUser.ExpandRect(aDisplayRect, aUser.DisplayRect()); |
|
502 } |
|
503 else |
|
504 { |
|
505 aUser.ExpandRect(aDisplayRect, aUser.Display()->VisibleArea()); |
|
506 } |
|
507 } |
|
508 break; |
|
509 } |
|
510 case EHuiCanvasRotate: |
|
511 { |
|
512 const THuiCanvasRotateParams* const params = (THuiCanvasRotateParams*)buffer.Ptr(); |
|
513 if (aAction == EDrawBuffer) |
|
514 { |
|
515 iCanvasGc->Rotate(params->iAngle, params->iX, params->iY, params->iZ); |
|
516 } |
|
517 else |
|
518 { |
|
519 // Calculating transformations may be too difficult, so just set largest possible rect |
|
520 if (aUser.Clipping() || !aUser.Display()) |
|
521 { |
|
522 aUser.ExpandRect(aDisplayRect, aUser.DisplayRect()); |
|
523 } |
|
524 else |
|
525 { |
|
526 aUser.ExpandRect(aDisplayRect, aUser.Display()->VisibleArea()); |
|
527 } |
|
528 } |
|
529 break; |
|
530 } |
|
531 default: |
|
532 { |
|
533 __ASSERT_DEBUG(EFalse, THuiPanic::Panic(THuiPanic::EUnknown)); |
|
534 break; |
|
535 } |
|
536 } |
|
537 } |
|
538 } |
|
539 iPaintedRect = aUser.DisplayRect(); |
|
540 } |
|
541 |
|
542 |
|
543 |
|
544 void CHuiCanvasAlfPainter::SetCommandSetL( const TDesC8& aCommands ) |
|
545 { |
|
546 CHuiCanvasPainter::SetCommandSetL(aCommands); |
|
547 } |
|
548 |
|
549 void CHuiCanvasAlfPainter::ClearCommandSet() |
|
550 { |
|
551 CHuiCanvasPainter::ClearCommandSet(); |
|
552 } |
|
553 |
|
554 void CHuiCanvasAlfPainter::AddCommandSetL( const TDesC8& aMoreCommands ) |
|
555 { |
|
556 CHuiCanvasPainter::AddCommandSetL(aMoreCommands); |
|
557 } |
|
558 |
|
559 void CHuiCanvasAlfPainter::AddPartialCommandSetL( const TDesC8& aMoreCommands, TBool aLastPart ) |
|
560 { |
|
561 CHuiCanvasPainter::AddPartialCommandSetL(aMoreCommands,aLastPart); |
|
562 } |
|
563 |
|
564 #ifdef HUI_DEBUG_TRACK_DRAWING |
|
565 void CHuiCanvasAlfPainter::SetTrackCommandSet( TFileName& aFileName, TBool aTrack ) |
|
566 { |
|
567 CHuiCanvasPainter::SetTrackCommandSet( aFileName, aTrack ); |
|
568 } |
|
569 #endif |
|
570 |
|
571 void CHuiCanvasAlfPainter::ClearCache() |
|
572 { |
|
573 ClearHuiTextCache(); |
|
574 } |
|
575 |
|
576 void CHuiCanvasAlfPainter::ClearHuiTextCache() |
|
577 { |
|
578 // Hui text meshes |
|
579 for (TInt i=0; i < iCachedTexts.Count(); i++) |
|
580 { |
|
581 delete iCachedTexts[i].iTextMesh; |
|
582 iCachedTexts[i].iTextMesh = NULL; |
|
583 } |
|
584 iCachedTexts.Reset(); |
|
585 } |
|
586 |
|
587 CHuiCanvasGc& CHuiCanvasAlfPainter::CanvasGc() const |
|
588 { |
|
589 return *iCanvasGc; |
|
590 } |
|
591 |
|
592 TInt CHuiCanvasAlfPainter::PaintedAreaCount() const |
|
593 { |
|
594 return 1; |
|
595 } |
|
596 |
|
597 THuiCanvasPaintedArea CHuiCanvasAlfPainter::PaintedArea(TInt /*aIndex*/) |
|
598 { |
|
599 THuiCanvasPaintedArea area; |
|
600 area.iPaintedRect = iPaintedRect; |
|
601 area.iPaintType = EHuiCanvasPaintTypeTransparent; |
|
602 area.iFlags = 0; |
|
603 return area; |
|
604 } |
|
605 |
|
606 TInt CHuiCanvasAlfPainter::SetCapturingBufferL(CFbsBitmap* /*aTarget*/) |
|
607 { |
|
608 return KErrNotSupported; |
|
609 } |
|
610 |
|
611 TInt CHuiCanvasAlfPainter::EnableRenderBuffer(TBool /*aEnable*/) |
|
612 { |
|
613 return KErrNotSupported; |
|
614 } |