sl@0: // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @test sl@0: @internalComponent - Internal Symbian test code sl@0: */ sl@0: sl@0: sl@0: #include "tflowwindowopenvg.h" sl@0: sl@0: sl@0: // defines after how many updates the scene is actually drawn to the screen sl@0: const TInt KSceneInterleaver = 5; sl@0: sl@0: sl@0: CTWindow* CTFlowWindowOpenVG::NewL(RWsSession &aWs, sl@0: const RWindowTreeNode &aParent, sl@0: const TPoint& aStartingPoint, sl@0: const TSize& aWindowSize) sl@0: { sl@0: CTFlowWindowOpenVG* self = new (ELeave)CTFlowWindowOpenVG(aStartingPoint, aWindowSize); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(aWs, aParent); sl@0: CleanupStack::Pop(self); sl@0: return self; sl@0: } sl@0: sl@0: CTFlowWindowOpenVG::CTFlowWindowOpenVG(const TPoint& aStartingPoint, const TSize& aWindowSize) : sl@0: CTWindow(aStartingPoint, aWindowSize) sl@0: { sl@0: // empty sl@0: } sl@0: sl@0: CTFlowWindowOpenVG::~CTFlowWindowOpenVG() sl@0: { sl@0: delete iVGRendering; sl@0: } sl@0: sl@0: void CTFlowWindowOpenVG::ConstructL(RWsSession &aWs, const RWindowTreeNode &aParent) sl@0: { sl@0: CTWindow::ConstructL(aWs, aParent); sl@0: iVGRendering = CEGLRendering::NewL(iWindow); sl@0: } sl@0: sl@0: /** sl@0: * Renders the next scene and draws it to the screen. sl@0: * sl@0: */ sl@0: void CTFlowWindowOpenVG::RenderL() sl@0: { sl@0: CTWindow::RenderL(); sl@0: // don't update the cover flow display every time sl@0: iInterleaveCounter++; sl@0: if (iInterleaveCounter >= KSceneInterleaver) // todo: should be removed sl@0: { sl@0: iVGRendering->UpdateDisplay(); sl@0: iInterleaveCounter = 0; sl@0: } sl@0: } sl@0: