uiacceltk/hitchcock/plugins/openwfcrs/inc/screencaptureutil.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 02 Feb 2010 07:56:43 +0200
changeset 0 15bf7259bb7c
child 11 46927d61fef3
permissions -rw-r--r--
Revision: 201003

// Copyright (c) 2008-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:
//

#ifndef __SCREENCAPTURERENDERSTAGE_H__
#define __SCREENCAPTURERENDERSTAGE_H__

#include <graphics/wsrenderstage.h>
#include <graphics/wstestscreencapture.h>
#include <graphics/testscreencapture.h>
#include <graphics/surface.h>
#include <graphics/surfacemanager.h>
#include <graphics/surfaceupdateclient.h>

class MWsScene;
class MWsDisplayControl;
class MWsDisplayMapping;
class MWsScreenDevice;

/**
This is the implementation of CWsRenderStage which is created by a CScreenCaptureUtilFactory
*/

class CScreenCaptureUtil : public CBase
	{
public:
	static CScreenCaptureUtil * NewL(CWsRenderStage* aOwner);
	~CScreenCaptureUtil();

	CScreenCaptureUtil();
	void ConstructL(CWsRenderStage* aOwner);
	void ComposeScreenL(TInt aHandle);
	void CreateLocalSurfaceL();
	void GetCompositionAreaSize(TSize& aSize) const;
	TSurfaceId CreateSurfaceL(const TSize& aSize, TUidPixelFormat aPixelFormat, TInt aStride);
	TBool VerifyBitmapFormatL(const CFbsBitmap& aBitmap);
	TInt CopySurfaceToBitmapL(CFbsBitmap& aCopyToBitmap);
	
private:
	MWsScene* iScene;
	MWsDisplayMapping* iDisplayMapping;
	MWsScreenDevice* iScreenDevice;
	TSurfaceId iLocalSurface;
	RSurfaceManager iSurfaceManager;
	RSurfaceUpdateSession iSurfaceUpdateSession;
	RTimer iTimer;
	static const TUidPixelFormat KSurfacePixelFormat = EUidPixelFormatXRGB_8888;
	static const TInt KSurfaceBytesPerPixel = 4;
	};

#endif //__SCREENCAPTURERENDERSTAGE_H__