|
1 // Copyright (c) 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 /** |
|
17 @file |
|
18 @test |
|
19 @internalComponent - Internal Symbian test code |
|
20 */ |
|
21 |
|
22 |
|
23 #include "tflowwindowopenvg.h" |
|
24 |
|
25 |
|
26 // defines after how many updates the scene is actually drawn to the screen |
|
27 const TInt KSceneInterleaver = 5; |
|
28 |
|
29 |
|
30 CTWindow* CTFlowWindowOpenVG::NewL(RWsSession &aWs, |
|
31 const RWindowTreeNode &aParent, |
|
32 const TPoint& aStartingPoint, |
|
33 const TSize& aWindowSize) |
|
34 { |
|
35 CTFlowWindowOpenVG* self = new (ELeave)CTFlowWindowOpenVG(aStartingPoint, aWindowSize); |
|
36 CleanupStack::PushL(self); |
|
37 self->ConstructL(aWs, aParent); |
|
38 CleanupStack::Pop(self); |
|
39 return self; |
|
40 } |
|
41 |
|
42 CTFlowWindowOpenVG::CTFlowWindowOpenVG(const TPoint& aStartingPoint, const TSize& aWindowSize) : |
|
43 CTWindow(aStartingPoint, aWindowSize) |
|
44 { |
|
45 // empty |
|
46 } |
|
47 |
|
48 CTFlowWindowOpenVG::~CTFlowWindowOpenVG() |
|
49 { |
|
50 delete iVGRendering; |
|
51 } |
|
52 |
|
53 void CTFlowWindowOpenVG::ConstructL(RWsSession &aWs, const RWindowTreeNode &aParent) |
|
54 { |
|
55 CTWindow::ConstructL(aWs, aParent); |
|
56 iVGRendering = CEGLRendering::NewL(iWindow); |
|
57 } |
|
58 |
|
59 /** |
|
60 * Renders the next scene and draws it to the screen. |
|
61 * |
|
62 */ |
|
63 void CTFlowWindowOpenVG::RenderL() |
|
64 { |
|
65 CTWindow::RenderL(); |
|
66 // don't update the cover flow display every time |
|
67 iInterleaveCounter++; |
|
68 if (iInterleaveCounter >= KSceneInterleaver) // todo: should be removed |
|
69 { |
|
70 iVGRendering->UpdateDisplay(); |
|
71 iInterleaveCounter = 0; |
|
72 } |
|
73 } |
|
74 |