graphicstest/uibench/s60/src/tests_pan/tpan.h
author Matt Plumtree <matt.plumtree@nokia.com>
Fri, 23 Apr 2010 17:57:02 +0100
branchNewGraphicsArchitecture
changeset 39 a4b63488e0b0
parent 0 5d03bc08d59c
permissions -rw-r--r--
Revise some of the compositor performance improvements to improve correctness. Implement pixel blending using a variation of Jim Blinn's no-division blending algorithm. Move transparency type simplification further up the composition code. Remove some unnecessary fields. Output to YUV implementation needs revision as it is actually converting from YUV (copy of source conversion code).

// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
//

/**
 @file
 @test
 @internalComponent - Internal Symbian test code 
*/

#ifndef __TPAN_H__
#define __TPAN_H__


#include "te_conestepbase.h"

#include <coecntrl.h> 
#include <eikappui.h>


_LIT(KTPan,"tpan");


class CPanAppUi;
class CPanControl;


class CTPan : public CTe_ConeStepBase
	{
public:
	CTPan();

private:
    void PanBitmapL();
    
	// from CTestStep
    virtual TVerdict doTestStepPreambleL();
	virtual TVerdict doTestStepL();
	virtual TVerdict doTestStepPostambleL();
	
	// from CTe_graphicsperformanceSuiteStepBase
	virtual void InitUIL(CCoeEnv* aCoeEnv);
	
private:
    RSemaphore iSemaphore; // used to wait for font control to finish drawing
    CPanAppUi*  iAppUi;
	};


class CPanAppUi : public CEikAppUi 
    {
public:
    CPanAppUi();
    ~CPanAppUi();
    void ConstructL(const TRect& aRect);
    CPanControl* PanControl();
    
private:
    CPanControl* iPanControl;
    };


class CPanControl : public CCoeControl
	{	
public:
    static CPanControl* NewL(const TRect& aRect, const CCoeControl* aParent = NULL);
    static CPanControl* NewLC(const TRect& aRect, const CCoeControl* aParent = NULL);
    virtual ~CPanControl();
    TInt Iterations();
    CFbsBitmap* Bitmap();

private: 
	CPanControl();
    void ConstructL(const TRect& aRect, const CCoeControl* aParent);
    
    // from CCoeControl
    void Draw(const TRect& aRect) const;
    void HandlePointerEventL(const TPointerEvent& aPointerEvent);
    
private:
    RSemaphore iSemaphore; // handle to a Semaphore which is owned by the test step
	// The pixel position of the most recent PointerEvent
	TPoint iCurrentPointerPos;	
	CFbsBitmap* iSourceBitmap;
	TInt iIterations;
	RWsSession& iWsSession;
	};

#endif