uigraphics/NVGRenderStage/src/nvgrenderstagefactory.cpp
author William Roberts <williamr@symbian.org>
Wed, 21 Apr 2010 16:01:50 +0100
changeset 47 bb62470f88ca
permissions -rw-r--r--
Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
47
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
     1
// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
     2
// All rights reserved.
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
     7
//
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
     8
// Initial Contributors:
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    10
//
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    11
// Contributors:
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    12
//
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    13
// Description:
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    14
//
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    15
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    16
#include "nvgrenderstagefactory.h"
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    17
#include "nvgrenderstage.h"
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    18
#include "nvgrenderstagepanic.h"
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    19
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    20
_LIT(KNvgRenderStageName, "NVGRenderStage");
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    21
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    22
void Panic(TNvgRenderStagePanic aPanic)
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    23
	{
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    24
	_LIT(KNvgRenderStagePanic, "NvgRenderStage");
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    25
	User::Panic(KNvgRenderStagePanic, aPanic);
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    26
	}
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    27
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    28
CNvgRenderStageFactory* CNvgRenderStageFactory::CreateL()
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    29
	{
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    30
	return new(ELeave) CNvgRenderStageFactory;
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    31
	}
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    32
	
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    33
void CNvgRenderStageFactory::ConstructL(MWsGraphicDrawerEnvironment& aEnv, const TDesC8& /*aData*/)
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    34
	{
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    35
	BaseConstructL(aEnv);
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    36
	}
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    37
	
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    38
CNvgRenderStageFactory::CNvgRenderStageFactory()
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    39
	{
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    40
	}
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    41
	
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    42
CNvgRenderStageFactory::~CNvgRenderStageFactory()
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    43
	{
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    44
	}
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    45
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    46
/**
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    47
Overidding MWsObjectProvider
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    48
*/
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    49
TAny* CNvgRenderStageFactory::ResolveObjectInterface(TUint aTypeId)
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    50
	{
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    51
	switch (aTypeId)
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    52
		{
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    53
		case KMWsRenderStageFactory:
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    54
			return static_cast<MWsRenderStageFactory*>(this);
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    55
		}
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    56
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    57
	return NULL;
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    58
	}
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    59
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    60
CWsRenderStage* CNvgRenderStageFactory::CreateFinalRenderStageL(MWsScreen* /*aScreen*/, MWsScreenRedraw* /*aScreenRedraw*/, TInt /*aScreenNumber*/)
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    61
	{	
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    62
	Panic(EExtendedBitmapRenderStageMustNotBeFinal);
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    63
	return NULL;
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    64
	}
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    65
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    66
#ifndef SYMBIAN_GRAPHICS_GCE
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    67
#error ("must compile with SYMBIAN_GRAPHICS_GCE")
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    68
#endif
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    69
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    70
CWsRenderStage* CNvgRenderStageFactory::CreateRenderStageL(MWsScreen* aScreen, MWsScreenRedraw* aScreenRedraw, CWsRenderStage* aNextStage)
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    71
	{
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    72
	CNvgRenderStage* stage = CNvgRenderStage::NewL(&Env(), aScreen, aScreenRedraw, aNextStage);
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    73
	return stage;
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    74
	}
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    75
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    76
const TDesC& CNvgRenderStageFactory::PluginName() const
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    77
	{
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    78
	return KNvgRenderStageName;
bb62470f88ca Add NVGRenderStage code, and reapply associated changes to epoc.ini and wsini.ini
William Roberts <williamr@symbian.org>
parents:
diff changeset
    79
	}