windowing/windowserver/inc/Graphics/wsscreendevice.h
author Faisal Memon <faisal.memon@nokia.com>
Fri, 14 May 2010 15:41:33 +0100
branchNewGraphicsArchitecture
changeset 64 5c983aa672ea
parent 0 5d03bc08d59c
permissions -rw-r--r--
Merge 1. Pull in cpp files in the performance enhanced Khronos RI OVG files which are newly added. I've ignored platform-specific cpp files for linux, macosx, and null operating systems because this local solution has its own platform glue (i.e. facility to target Bitmaps but no full windowing support). I've ignored sfEGLInterface.cpp because this is used as a bridge to go from EGL to Nokia's Platsim which offers an EGL service. That's not relevant to this implementation because this is ARM side code, not Intel side. I just left a comment to sfEGLInterface.cpp in case we need to pick up this later on. The current code compiles on winscw. Prior to this fix, the code works on winscw, and can launch the SVG tiger (tiger.exe). That takes about 20 seconds to render. I hope to always be able to show this icon on each commit, and the plan is for the render time to reduce with this series of submissions. On this commit, the tiger renders ok in 20 seconds.

// 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:
// Interface for Render Stage Screen Abstraction
// 
//

/**
 @publishedPartner
 @prototype
*/

#ifndef WSSCREENDEVICE_H
#define WSSCREENDEVICE_H

#include <w32std.h>
#include <graphics/wsgraphicdrawerinterface.h>

/** Render Stage Palette support.

This interface is intended to be optionally provided by a Render Stage
when the pixel target can provide a Colour Palette.  Not all pixel targets have
this feature, for example OpenVG only targets.
@publishedPartner
@prototype
*/
class MWsPalette : public MWsObjectProvider
	{
public:
	DECLARE_WS_TYPE_ID(KMWsPalette)
	virtual void PaletteAttributes(TBool& aModifiable,TInt& aNumEntries) const = 0;
	virtual TInt GetPalette(CPalette*& aPalette) const = 0;
	virtual TInt SetCustomPalette(const CPalette* aPalette) = 0;
	};


/** Render Stage Screen Device abstraction.

Render Stages provide this interface as an abstraction of the target screen.
The screen may not be pixel based, in which case read back of pixel data may
not be a reflection of what appears on the screen.  The screen might also only
be partially readable, for example external video surfaces may be blanked out
when a read back is done.  The intention of the CopyScreenToBitmap methods is
to provide a means to obtain a snapshot of the entire screen for architectures
where a composition of the screen can be done once followed by a read back
of the entire screen, as opposed to servicing a sequence of GetScanLine calls
which may be prohibitively expensive.

@publishedPartner
@prototype
*/
class MWsScreenDevice : public MWsObjectProvider
	{
public:
	DECLARE_WS_TYPE_ID(KMWsScreenDevice)

	virtual TInt ScreenNumber() const = 0;
	virtual TDisplayMode DisplayMode() const = 0;
	virtual TSize SizeInPixels() const = 0;
	virtual TSize SizeInTwips() const = 0;
	virtual TRect PointerRect() const = 0;
	virtual void GetPixel(TRgb& aColor,const TPoint& aPixel) const = 0;
	virtual void GetScanLine(TDes8& aScanLine,const TPoint& aStartPixel,TInt aPixelLength, TDisplayMode aDispMode) const = 0;
	virtual TBool RectCompare(const TRect& aRect1, const TRect& aRect2) const = 0;
	virtual void CopyScreenToBitmapL(CFbsBitmap* aBitmap, const TRect& aRect) const = 0;
	virtual void ClearDisplay(TRgb aBackColor)=0;
	};

#endif // WSSCREENDEVICE_H