os/mm/mdfdevvideoextensions/nga_mdf_postprocessor/src/NGAPostProcSurfaceHandler.cpp
Update contrib.
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
20 #include <graphics/surface.h> //TSurfaceId
21 #include <graphics/surfacemanager.h> //RSurfaceManager
22 #include "MdfRDebug.h"
24 #include "NGAPostProcSurfaceHandler.h"
26 //**************************************************
28 CNGAPostProcSurfaceHandler* CNGAPostProcSurfaceHandler::NewL()
30 PP_DEBUG(_L("CNGAPostProcSurfaceHandler:NewL() ++"));
32 CNGAPostProcSurfaceHandler* self = new (ELeave) CNGAPostProcSurfaceHandler;
33 CleanupStack::PushL(self);
37 PP_DEBUG(_L("CNGAPostProcSurfaceHandler:NewL() --"));
41 void CNGAPostProcSurfaceHandler::ConstructL()
43 PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:ConstructL() ++"), this);
44 iSurfaceManager = new (ELeave) RSurfaceManager();
45 User::LeaveIfError(iSurfaceManager->Open());
46 PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:ConstructL() --"), this);
49 CNGAPostProcSurfaceHandler::CNGAPostProcSurfaceHandler()
50 :iSurfaceManager(NULL)
54 CNGAPostProcSurfaceHandler::~CNGAPostProcSurfaceHandler()
56 PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:~() ++"), this);
59 iSurfaceManager->Close();
60 delete iSurfaceManager;
61 iSurfaceManager = NULL;
63 PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:~() --"), this);
66 TInt CNGAPostProcSurfaceHandler::CreateSurface(
67 const RSurfaceManager::TSurfaceCreationAttributesBuf & aAttributes,
68 TSurfaceId& aSurfaceId)
70 PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:CreateSurface() ++"), this);
71 PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:CreateSurface() --"), this);
72 return(iSurfaceManager->CreateSurface(aAttributes, aSurfaceId));
76 TInt CNGAPostProcSurfaceHandler::OpenSurface(const TSurfaceId& aSurfaceId)
78 PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:OpenSurface() ++"), this);
79 PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:OpenSurface() --"), this);
80 return(iSurfaceManager->OpenSurface(aSurfaceId));
84 TInt CNGAPostProcSurfaceHandler::MapSurface(const TSurfaceId& aSurfaceId, RChunk& aHandle)
86 PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:MapSurface() ++"), this);
87 PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:MapSurface() --"), this);
88 return(iSurfaceManager->MapSurface(aSurfaceId, aHandle));
91 TInt CNGAPostProcSurfaceHandler::SurfaceInfo(const TSurfaceId& aSurfaceId,
92 RSurfaceManager::TInfoBuf& aInfo)
94 PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:SurfaceInfo() ++"), this);
95 PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:SurfaceInfo() --"), this);
96 return(iSurfaceManager->SurfaceInfo(aSurfaceId, aInfo));
99 TInt CNGAPostProcSurfaceHandler::DestroySurface(const TSurfaceId& aSurfaceId)
101 PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:DestroySurface() ++"), this);
102 PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:DestroySurface() --"), this);
103 return(iSurfaceManager->CloseSurface(aSurfaceId));
106 TInt CNGAPostProcSurfaceHandler::GetBufferOffset(const TSurfaceId& aSurfaceId, TInt aBuffer, TInt& aOffset)
108 PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:GetBufferOffset() aBuffer = %d++"), this, aBuffer);
109 PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:GetBufferOffset() --"), this);
110 return(iSurfaceManager->GetBufferOffset(aSurfaceId, aBuffer, aOffset));
113 TInt CNGAPostProcSurfaceHandler::AddSurfaceHint(const TSurfaceId& aSurfaceId,const RSurfaceManager::THintPair& aHint)
115 PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:AddSurfaceHint() ++"), this);
116 PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:AddSurfaceHint() --"), this);
117 return(iSurfaceManager->AddSurfaceHint(aSurfaceId, aHint));
120 TInt CNGAPostProcSurfaceHandler::SetSurfaceHint(const TSurfaceId& aSurfaceId,const RSurfaceManager::THintPair& aHint)
122 PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:SetSurfaceHint() ++"), this);
123 PP_DEBUG(_L("CNGAPostProcSurfaceHandler[%x]:SetSurfaceHint() --"), this);
124 return(iSurfaceManager->SetSurfaceHint(aSurfaceId, aHint));