uiacceltk/hitchcock/coretoolkit/rendervg10/inc/huivg10canvasrenderbuffer.h
changeset 0 15bf7259bb7c
child 17 3ac8bf5c5014
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     1 /*
       
     2 * Copyright (c) 2006-2007 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:   Definition of CHuiVg10CanvasRenderBuffer
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef HUIVG10CANVASRENDERBUFFER_H_
       
    21 #define HUIVG10CANVASRENDERBUFFER_H_
       
    22 
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <VG/openvg.h>
       
    26 #include <EGL/egl.h>
       
    27 #include "huicanvasrenderbuffer.h"
       
    28 #include "uiacceltk/HuiGc.h"
       
    29 #include "HuiVg10RenderPlugin.h"
       
    30     
       
    31 /* Forward declarations. */    
       
    32 class CHuiRenderPlugin;
       
    33 
       
    34 NONSHARABLE_CLASS (CHuiVg10CanvasRenderBuffer) : public CHuiCanvasRenderBuffer
       
    35     {
       
    36 public:
       
    37 
       
    38     /**
       
    39      * Constructor.
       
    40      */
       
    41     CHuiVg10CanvasRenderBuffer();
       
    42 
       
    43     /**
       
    44      * Destructor.
       
    45      */ 
       
    46     ~CHuiVg10CanvasRenderBuffer();
       
    47     
       
    48     
       
    49 public: // From CHuiCanvasRenderBuffer    
       
    50 
       
    51     /**
       
    52      * Initializes render buffer.
       
    53      */
       
    54     void InitializeL(const TSize& aSize);
       
    55     
       
    56     /**
       
    57      * Releases render target resources.
       
    58      */
       
    59     void UnInitialize();
       
    60     
       
    61     /**
       
    62      * Binds as render buffer.
       
    63      */ 
       
    64     void Bind();
       
    65     
       
    66     /**
       
    67      * Unbinds as render target and restores the previous target.
       
    68      */ 
       
    69     void UnBind();
       
    70     
       
    71     /**
       
    72      * Copies content from the given buffer
       
    73      */ 
       
    74     void Copy(const CHuiCanvasRenderBuffer& aSourceBuffer);    
       
    75 
       
    76     /**
       
    77      * Copies content from the active surface.
       
    78      */ 
       
    79     void Copy(TPoint aPoint);    
       
    80     
       
    81 public:
       
    82     
       
    83     VGImage Image() const;
       
    84     
       
    85 private:
       
    86     
       
    87     void PushEGLContext();
       
    88     void PopEGLContext();
       
    89     void ReadBackground(TPoint aPosition);
       
    90         
       
    91 private:
       
    92  
       
    93     CHuiGc*                 iGc;
       
    94     VGImage                 iImage;
       
    95     VGImage                 iRotatedImage;
       
    96     EGLContext              iContext;
       
    97     EGLSurface              iSurface;    
       
    98     EGLContext              iSavedContext;
       
    99     EGLSurface              iSavedReadSurface;
       
   100     EGLSurface              iSavedDrawSurface;
       
   101     TEGLState               iPreviousEGLState;
       
   102     };
       
   103 
       
   104 #endif /* HUIVG10CANVASRENDERBUFFER_H_ */