sl@0: /* sl@0: * Copyright (c) 2006 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: sl@0: #include sl@0: #include //TSurfaceId sl@0: #include //RSurfaceManager sl@0: #include "MdfRDebug.h" sl@0: sl@0: #include "NGAPostProcSurfaceHandler.h" sl@0: sl@0: //************************************************** sl@0: sl@0: CNGAPostProcSurfaceHandler* CNGAPostProcSurfaceHandler::NewL() sl@0: { sl@0: PP_DEBUG(_L("CNGAPostProcSurfaceHandler:NewL() ++")); sl@0: sl@0: CNGAPostProcSurfaceHandler* self = new (ELeave) CNGAPostProcSurfaceHandler; sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(); sl@0: CleanupStack::Pop(); sl@0: sl@0: PP_DEBUG(_L("CNGAPostProcSurfaceHandler:NewL() --")); sl@0: return self; sl@0: } sl@0: sl@0: void CNGAPostProcSurfaceHandler::ConstructL() sl@0: { sl@0: PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:ConstructL() ++"), this); sl@0: iSurfaceManager = new (ELeave) RSurfaceManager(); sl@0: User::LeaveIfError(iSurfaceManager->Open()); sl@0: PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:ConstructL() --"), this); sl@0: } sl@0: sl@0: CNGAPostProcSurfaceHandler::CNGAPostProcSurfaceHandler() sl@0: :iSurfaceManager(NULL), sl@0: iSurfaceAttributes(iSurfaceAttributesBuf()) sl@0: { sl@0: } sl@0: sl@0: CNGAPostProcSurfaceHandler::~CNGAPostProcSurfaceHandler() sl@0: { sl@0: PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:~() ++"), this); sl@0: if (iSurfaceManager) sl@0: { sl@0: iSurfaceManager->Close(); sl@0: delete iSurfaceManager; sl@0: iSurfaceManager = NULL; sl@0: } sl@0: PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:~() --"), this); sl@0: } sl@0: sl@0: TInt CNGAPostProcSurfaceHandler::CreateSurface( sl@0: const RSurfaceManager::TSurfaceCreationAttributes & aAttributes, sl@0: TSurfaceId& aSurfaceId, const RChunk& aChunk) sl@0: { sl@0: PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:CreateSurface() ++"), this); sl@0: PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:CreateSurface() --"), this); sl@0: sl@0: sl@0: iSurfaceAttributes = aAttributes; sl@0: return(iSurfaceManager->CreateSurface(iSurfaceAttributesBuf, aSurfaceId, aChunk)); sl@0: } sl@0: TInt CNGAPostProcSurfaceHandler::CreateSurface( sl@0: const RSurfaceManager::TSurfaceCreationAttributesBuf & aAttributes, sl@0: TSurfaceId& aSurfaceId) sl@0: { sl@0: PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:CreateSurface() ++"), this); sl@0: PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:CreateSurface() --"), this); sl@0: return(iSurfaceManager->CreateSurface(aAttributes, aSurfaceId)); sl@0: } sl@0: sl@0: sl@0: TInt CNGAPostProcSurfaceHandler::OpenSurface(const TSurfaceId& aSurfaceId) sl@0: { sl@0: PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:OpenSurface() ++"), this); sl@0: PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:OpenSurface() --"), this); sl@0: return(iSurfaceManager->OpenSurface(aSurfaceId)); sl@0: sl@0: } sl@0: sl@0: TInt CNGAPostProcSurfaceHandler::MapSurface(const TSurfaceId& aSurfaceId, RChunk& aHandle) sl@0: { sl@0: PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:MapSurface() ++"), this); sl@0: PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:MapSurface() --"), this); sl@0: return(iSurfaceManager->MapSurface(aSurfaceId, aHandle)); sl@0: } sl@0: sl@0: TInt CNGAPostProcSurfaceHandler::SurfaceInfo(const TSurfaceId& aSurfaceId, sl@0: RSurfaceManager::TInfoBuf& aInfo) sl@0: { sl@0: PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:SurfaceInfo() ++"), this); sl@0: PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:SurfaceInfo() --"), this); sl@0: return(iSurfaceManager->SurfaceInfo(aSurfaceId, aInfo)); sl@0: } sl@0: sl@0: TInt CNGAPostProcSurfaceHandler::DestroySurface(const TSurfaceId& aSurfaceId) sl@0: { sl@0: PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:DestroySurface() ++"), this); sl@0: PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:DestroySurface() --"), this); sl@0: return(iSurfaceManager->CloseSurface(aSurfaceId)); sl@0: } sl@0: sl@0: TInt CNGAPostProcSurfaceHandler::GetBufferOffset(const TSurfaceId& aSurfaceId, TInt aBuffer, TInt& aOffset) sl@0: { sl@0: PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:GetBufferOffset() aBuffer = %d++"), this, aBuffer); sl@0: PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:GetBufferOffset() --"), this); sl@0: return(iSurfaceManager->GetBufferOffset(aSurfaceId, aBuffer, aOffset)); sl@0: } sl@0: sl@0: TInt CNGAPostProcSurfaceHandler::AddSurfaceHint(const TSurfaceId& aSurfaceId,const RSurfaceManager::THintPair& aHint) sl@0: { sl@0: PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:AddSurfaceHint() ++"), this); sl@0: PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:AddSurfaceHint() --"), this); sl@0: return(iSurfaceManager->AddSurfaceHint(aSurfaceId, aHint)); sl@0: } sl@0: sl@0: TInt CNGAPostProcSurfaceHandler::SetSurfaceHint(const TSurfaceId& aSurfaceId,const RSurfaceManager::THintPair& aHint) sl@0: { sl@0: PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:SetSurfaceHint() ++"), this); sl@0: PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:SetSurfaceHint() --"), this); sl@0: return(iSurfaceManager->SetSurfaceHint(aSurfaceId, aHint)); sl@0: } sl@0: