uigraphics/NVGRenderStage/src/vgigraphicsinterface.cpp
changeset 102 556a54d643b8
equal deleted inserted replaced
101:4129cc017eb5 102:556a54d643b8
       
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:    CVGIGraphicsInterface implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 #include "vgigraphicsinterface.h"
       
    19 #include <vgcontext_symbian.h>
       
    20 
       
    21 CVGIGraphicsInterface::CVGIGraphicsInterface()
       
    22     {
       
    23     }
       
    24 
       
    25 CVGIGraphicsInterface::~CVGIGraphicsInterface()
       
    26     {
       
    27     Terminate();
       
    28     }
       
    29 
       
    30 void CVGIGraphicsInterface::InitializeL(TSize aSurfaceSize)
       
    31     {
       
    32         
       
    33     TInt err = VGISymbianInitialize( aSurfaceSize, VGI_COLORSPACE_SRGB );
       
    34     
       
    35     if ((err != KErrNone) && (err != KErrAlreadyExists))
       
    36         {
       
    37         User::Leave(err);
       
    38         }
       
    39     VGISymbianResize(aSurfaceSize);
       
    40     }
       
    41 
       
    42 void CVGIGraphicsInterface::CopyBitmapL(CFbsBitmap* aPixMap, CFbsBitmap* aMask)
       
    43     {
       
    44     TInt error;
       
    45     if( !aMask )
       
    46         {
       
    47         error = VGISymbianCopyToBitmap(aPixMap, aMask, VGI_SKIP_TRANSPARENT_PIXELS);
       
    48         }
       
    49     else
       
    50         {
       
    51         error = VGISymbianCopyToBitmap(aPixMap, aMask, VGI_COPY_TRANSPARENT_PIXELS);
       
    52         }
       
    53     User::LeaveIfError(error);
       
    54     }
       
    55 
       
    56 void CVGIGraphicsInterface::Terminate()
       
    57     {
       
    58     VGISymbianTerminate();
       
    59     }
       
    60 
       
    61 TInt CVGIGraphicsInterface::BindClientBuffer(TUint aBuffer)
       
    62     {
       
    63         return VGISymbianBindToImage(aBuffer);
       
    64     }
       
    65 
       
    66 TInt CVGIGraphicsInterface::UnBindClientBuffer()
       
    67     {
       
    68     return VGISymbianUnBindImage();
       
    69     }