javauis/m2g_qt/inc/CM2GRenderContext.h
changeset 87 1627c337e51e
parent 56 abc41079b313
equal deleted inserted replaced
80:d6dafc5d983f 87:1627c337e51e
     1 /*
     1 /*
     2 * Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
   107         TM2GRenderRect& aRect);
   107         TM2GRenderRect& aRect);
   108     virtual void RenderESWTL(
   108     virtual void RenderESWTL(
   109         TM2GSvgDocumentHandle& aSvgDocHandle,
   109         TM2GSvgDocumentHandle& aSvgDocHandle,
   110         const TReal32 aCurrentTime,
   110         const TReal32 aCurrentTime,
   111         TInt aSvgW, TInt aSvgH,
   111         TInt aSvgW, TInt aSvgH,
   112         TM2GRenderRect& aRect,       
   112         TM2GRenderRect& aRect,
   113         TBool aUseNativeClear,
   113         TBool aUseNativeClear,
   114         TInt* aReturnData);
   114         TInt* aReturnData);
   115 
   115 
   116     /**
   116     /**
   117      * @see MM2GRenderContext::SetRenderingQualityL()
   117      * @see MM2GRenderContext::SetRenderingQualityL()
   121     /**
   121     /**
   122      * @see MM2GRenderContext::SetTransparency()
   122      * @see MM2GRenderContext::SetTransparency()
   123      */
   123      */
   124     virtual void SetTransparency(TReal32 aAlpha);
   124     virtual void SetTransparency(TReal32 aAlpha);
   125 
   125 
   126     
   126 
   127     TInt SaveBitmapL(const CFbsBitmap& aNVGBitmap, const TFileName& aFileName);
       
   128 protected: // METHODS
       
   129     /**
       
   130      * Get the image's bitmap handle
       
   131      *
       
   132      * @return Svg surface handle.
       
   133      * @throws Exception if not ok.
       
   134      */
       
   135     TM2GBitmapHandle GetImgHandleL() const;
       
   136 
   127 
   137 private:
   128 private:
   138     /**
   129     /**
   139      * Prepare viewbox and anchor
   130      * Prepare viewbox and anchor
   140      *
   131      *
   177         const TRect& aViewbox,
   168         const TRect& aViewbox,
   178         const TPoint& aAnchor,
   169         const TPoint& aAnchor,
   179         TBool aUseNativeClear,
   170         TBool aUseNativeClear,
   180         TInt* aReturnData);
   171         TInt* aReturnData);
   181 
   172 
   182     /**
       
   183      * Clear the bitmap with 0
       
   184      * Fills all pixel with 0 value
       
   185      *
       
   186      * @param aBmp the bitmap to be filled
       
   187      */
       
   188     void CM2GRenderContext::ClearBitmapL(CFbsBitmap* aBmp);
       
   189 
       
   190     /**
       
   191      * Fills all the pixels of a bitmap with a specific byte
       
   192      *
       
   193      * @param aBmp the bitmap to be filled
       
   194      * @param aChar the character(byte) to fill with
       
   195      */
       
   196     void FillBitmapL(CFbsBitmap* aBmp, const TUint8& aChar);
       
   197 
       
   198 
       
   199 private: // VARIABLES
   173 private: // VARIABLES
   200     
   174 
   201     //For WindowsSurface CFbsBitmap || Qimage 
       
   202     Java::GFX::WindowSurface*   iWindowSurface;
       
   203     
       
   204     
       
   205     MM2GSVGProxy*       iProxy;
   175     MM2GSVGProxy*       iProxy;
   206 
   176 
   207     TM2GSvgEngineHandle iEngineHandle;
   177     TM2GSvgEngineHandle iEngineHandle;
   208 
   178 
   209     TReal32             iAlpha;
   179     TReal32             iAlpha;
   210     TUint8              iScaledAlpha;
   180     TUint8              iScaledAlpha;
   211     
   181 
   212 //for eswt compatibility
   182 //for eswt compatibility
   213     CFbsBitmap*         iImgBmp;
   183     CFbsBitmap*         iImgBmp;
   214     RFbsSession         iFbsSession;
   184     RFbsSession         iFbsSession;
   215     
   185 
   216     
   186 //For WindowsSurface CFbsBitmap || Qimage
       
   187     Java::GFX::WindowSurface*   iWindowSurface;
       
   188 
       
   189 
       
   190 
   217 // Temporary buffer ( offscreen ) for QImage support
   191 // Temporary buffer ( offscreen ) for QImage support
   218     QImage*                         iOffScreenQImage;
   192     QImage*                         iOffScreenQImage;
   219     CFbsBitmap*                     iOffScreenBitmap;
   193     CFbsBitmap*                     iOffScreenBitmap;
   220             
   194 
   221     QImage*                         iTargetQImage;
   195     QImage*                         iTargetQImage;
   222 
   196 
   223     Java::GFX::WindowSurfaceType    wSurfaceType;
   197     Java::GFX::WindowSurfaceType    wSurfaceType;
   224     CSvgtBitmap * targetBitmap;
   198     CSvgtBitmap * targetBitmap;
   225     
   199 
   226     CFbsBitmap* tempBitmapForMask ;
   200     CFbsBitmap* tempBitmapForMask ;
   227 
   201 
   228 protected:
   202 
   229     TM2GSvgBitmapHandle GetBufferHandleL() const;
       
   230     void InitializeQImageOffscreenBufferL(TSize aScreenSize,QImage* aQimage);
       
   231     void InitializeCFbsBitmapOffscreenBufferL(TSize aScreenSize,CFbsBitmap* aBitmap);
       
   232     void ClearSurfaceL(TM2GSvgBitmapHandle aSvgtBmpHandle);
       
   233 private:
   203 private:
   234     
   204 
   235 };
   205 };
   236 /*-----------------------------------------------------------
   206 /*-----------------------------------------------------------
   237 class  : CFbsBitmapHack
   207 class  : CFbsBitmapHack
   238 purpose: Class is provided as a solution for double render
   208 purpose: Class is provided as a solution for double render
   239          issue in eSWT
   209          issue in eSWT