uigraphics/NVGRenderStage/src/nvgrenderstage.cpp
changeset 15 1bd1043e4812
parent 14 dfd4516c2f08
child 20 f6fd4830a02c
equal deleted inserted replaced
14:dfd4516c2f08 15:1bd1043e4812
    97 CGraphicsContext as this renderstage uses MWsGraphicsContext interface from the
    97 CGraphicsContext as this renderstage uses MWsGraphicsContext interface from the
    98 next stage to draw to. A pointer to the MWsGraphicsContext interface is saved here
    98 next stage to draw to. A pointer to the MWsGraphicsContext interface is saved here
    99 and is used for all subsequent MWsGraphicsContext operations called on this
    99 and is used for all subsequent MWsGraphicsContext operations called on this
   100 render stage. 
   100 render stage. 
   101 
   101 
   102 This render stage draws all extended bitmaps of type 0x10285A78
   102 This render stage draws all extended bitmaps of type 0x39b9273e
   103 and passes all other drawing operations directly to the next render stage through
   103 and passes all other drawing operations directly to the next render stage through
   104 its MWsGraphicsContext interface.
   104 its MWsGraphicsContext interface.
   105 
   105 
   106 @see CWsRenderStage::Begin()
   106 @see CWsRenderStage::Begin()
   107 
   107 
   144 		{		
   144 		{		
   145 		Next()->End(aCompositorReady);
   145 		Next()->End(aCompositorReady);
   146 		}
   146 		}
   147 	}
   147 	}
   148 
   148 
   149 /** If the passed bitmap is an extended bitmap of type 0x10285A78, draw it to the stored
   149 /** If the passed bitmap is an extended bitmap of type 0x39b9273e, draw it to the stored
   150 graphics context of the next render stage using  DrawExtendedBitmap(), if the passed bitmap
   150 graphics context of the next render stage using  DrawExtendedBitmap(), if the passed bitmap
   151 is not an extended bitmap just pass it on to the next render stage directly.
   151 is not an extended bitmap just pass it on to the next render stage directly.
   152 
   152 
   153 @see CFbsBitGc::BitBlt(const TPoint&, const CFbsBitmap&)
   153 @see CFbsBitGc::BitBlt(const TPoint&, const CFbsBitmap&)
   154  */
   154  */
   166 			iGc->BitBlt(aDestPos, aSourceBitmap);
   166 			iGc->BitBlt(aDestPos, aSourceBitmap);
   167 			}
   167 			}
   168 		}
   168 		}
   169 	}
   169 	}
   170 
   170 
   171 /** If the passed bitmap is an extended bitmap of type 0x10285A78, draw it to the 
   171 /** If the passed bitmap is an extended bitmap of type 0x39b9273e, draw it to the 
   172 stored graphics context of the next render stage using  DrawExtendedBitmap(), if the
   172 stored graphics context of the next render stage using  DrawExtendedBitmap(), if the
   173 passed bitmap is not an extended bitmap just pass it on to the next render stage directly.
   173 passed bitmap is not an extended bitmap just pass it on to the next render stage directly.
   174 
   174 
   175 @see CFbsBitGc::BitBlt(const TPoint&, const CFbsBitmap&, const TRect&)
   175 @see CFbsBitGc::BitBlt(const TPoint&, const CFbsBitmap&, const TRect&)
   176  */
   176  */
   188 			iGc->BitBlt(aDestPos, aSourceBitmap, aSourceRect);
   188 			iGc->BitBlt(aDestPos, aSourceBitmap, aSourceRect);
   189 			}
   189 			}
   190 		}
   190 		}
   191 	}
   191 	}
   192 
   192 
   193 /** If either of the passed bitmaps is an extended bitmap of type 0x10285A78 convert
   193 /** If either of the passed bitmaps is an extended bitmap of type 0x39b9273e convert
   194 to a normal bitmap before passing to the next render stage, otherwise
   194 to a normal bitmap before passing to the next render stage, otherwise
   195 just pass to the next render stage directly.
   195 just pass to the next render stage directly.
   196 
   196 
   197 @see CFbsBitGc::BitBltMasked(const TPoint& aDestPos, const CFbsBitmap&, const TRect&, const CFbsBitmap&, TBool)
   197 @see CFbsBitGc::BitBltMasked(const TPoint& aDestPos, const CFbsBitmap&, const TRect&, const CFbsBitmap&, TBool)
   198  */
   198  */
   217 		
   217 		
   218 		iGc->BitBltMasked(aDestPos, *sourceBitmap, aSourceRect, *maskBitmap, aInvertMask);
   218 		iGc->BitBltMasked(aDestPos, *sourceBitmap, aSourceRect, *maskBitmap, aInvertMask);
   219 		}
   219 		}
   220 	}
   220 	}
   221 
   221 
   222 /** If either of the passed bitmaps is an extended bitmap of type 0x10285A78
   222 /** If either of the passed bitmaps is an extended bitmap of type 0x39b9273e
   223 convert to a normal bitmap before passing to the next render stage, otherwise
   223 convert to a normal bitmap before passing to the next render stage, otherwise
   224 just pass to the next render stage directly.
   224 just pass to the next render stage directly.
   225 
   225 
   226 @see CFbsBitGc::BitBltMasked(const TPoint& aDestPos, const CFbsBitmap&, const TRect&, const CFbsBitmap&, TPoint)
   226 @see CFbsBitGc::BitBltMasked(const TPoint& aDestPos, const CFbsBitmap&, const TRect&, const CFbsBitmap&, TPoint)
   227  */
   227  */
   316 		{
   316 		{
   317 		iGc->DrawPie(aRect, aStart, aEnd);
   317 		iGc->DrawPie(aRect, aStart, aEnd);
   318 		}
   318 		}
   319 	}
   319 	}
   320 
   320 
   321 /** If the passed bitmap is an extended bitmap of type 0x10285A78, draw it to the 
   321 /** If the passed bitmap is an extended bitmap of type 0x39b9273e, draw it to the 
   322 stored graphics context of the next render stage using DrawExtendedBitmap(), if the
   322 stored graphics context of the next render stage using DrawExtendedBitmap(), if the
   323 passed bitmap is not an extended bitmap just pass it on to the next render stage directly.
   323 passed bitmap is not an extended bitmap just pass it on to the next render stage directly.
   324 
   324 
   325 @see CFbsBitGc::DrawBitmap(const TRect&, const CFbsBitmap&)
   325 @see CFbsBitGc::DrawBitmap(const TRect&, const CFbsBitmap&)
   326  */
   326  */
   338 				
   338 				
   339 		iGc->DrawBitmap(aDestRect, *sourceBitmap);	
   339 		iGc->DrawBitmap(aDestRect, *sourceBitmap);	
   340 		}
   340 		}
   341 	}
   341 	}
   342 
   342 
   343 /** If the passed bitmap is an extended bitmap of type 0x10285A78, draw it to the 
   343 /** If the passed bitmap is an extended bitmap of type 0x39b9273e, draw it to the 
   344 stored graphics context of the next render stage using DrawExtendedBitmap(), if the
   344 stored graphics context of the next render stage using DrawExtendedBitmap(), if the
   345 passed bitmap is not an extended bitmap just pass it on to the next render stage directly.
   345 passed bitmap is not an extended bitmap just pass it on to the next render stage directly.
   346 
   346 
   347 @see CFbsBitGc::DrawBitmap(const TRect&, const CFbsBitmap&, const TRect&)
   347 @see CFbsBitGc::DrawBitmap(const TRect&, const CFbsBitmap&, const TRect&)
   348  */
   348  */
   360 				
   360 				
   361 		iGc->DrawBitmap(aDestRect, *sourceBitmap, aSourceRect);		
   361 		iGc->DrawBitmap(aDestRect, *sourceBitmap, aSourceRect);		
   362 		}
   362 		}
   363 	}
   363 	}
   364 
   364 
   365 /** If the passed bitmap or mask bitmap is an extended bitmap of type 0x10285A78
   365 /** If the passed bitmap or mask bitmap is an extended bitmap of type 0x39b9273e
   366 convert it to a normal bitmap before calling DrawBitmapMasked(), normal bitmaps
   366 convert it to a normal bitmap before calling DrawBitmapMasked(), normal bitmaps
   367 are passed straight through to the next render stage without conversion.
   367 are passed straight through to the next render stage without conversion.
   368 
   368 
   369 @see CFbsBitGc::DrawBitmapMasked(const TRect&, const CFbsBitmap&, const TRect&, const CFbsBitmap&, TBool)
   369 @see CFbsBitGc::DrawBitmapMasked(const TRect&, const CFbsBitmap&, const TRect&, const CFbsBitmap&, TBool)
   370  */
   370  */
   753 		{
   753 		{
   754 		iGc->SetStrikethroughStyle(aStrikethroughStyle);
   754 		iGc->SetStrikethroughStyle(aStrikethroughStyle);
   755 		}
   755 		}
   756 	}
   756 	}
   757 
   757 
   758 /** If the passed bitmap is an extended bitmap of type 0x10285A78
   758 /** If the passed bitmap is an extended bitmap of type 0x39b9273e
   759 convert the extended bitmap to a normal bitmap and set the converted bitmap
   759 convert the extended bitmap to a normal bitmap and set the converted bitmap
   760 as the current brush pattern. If the passed bitmap is a normal
   760 as the current brush pattern. If the passed bitmap is a normal
   761 bitmap just pass it on to the next render stage.
   761 bitmap just pass it on to the next render stage.
   762 
   762 
   763 @see SetBrushPattern(TInt)
   763 @see SetBrushPattern(TInt)
   766 void CNvgRenderStage::SetBrushPattern(const CFbsBitmap& aBitmap)
   766 void CNvgRenderStage::SetBrushPattern(const CFbsBitmap& aBitmap)
   767 	{
   767 	{
   768 	SetBrushPattern(aBitmap.Handle());	
   768 	SetBrushPattern(aBitmap.Handle());	
   769 	}
   769 	}
   770 
   770 
   771 /** If the passed bitmap handle refers to an extended bitmap of type 0x10285A78
   771 /** If the passed bitmap handle refers to an extended bitmap of type 0x39b9273e
   772 convert the extended bitmap to a normal bitmap and set the converted bitmap
   772 convert the extended bitmap to a normal bitmap and set the converted bitmap
   773 as the current brush pattern. If the passed bitmap handle refers to a normal
   773 as the current brush pattern. If the passed bitmap handle refers to a normal
   774 bitmap just pass it on to the next render stage.
   774 bitmap just pass it on to the next render stage.
   775 
   775 
   776 @see SetBrushPattern(const CFbsBitmap&)
   776 @see SetBrushPattern(const CFbsBitmap&)
   986 
   986 
   987 /** Helper method used by BitBlt() and DrawBitmap() 
   987 /** Helper method used by BitBlt() and DrawBitmap() 
   988 
   988 
   989 @param aGc The graphics context to draw the extended bitmap to.
   989 @param aGc The graphics context to draw the extended bitmap to.
   990 @param aDestRect The rectangle that the source bitmap will be drawn to.
   990 @param aDestRect The rectangle that the source bitmap will be drawn to.
   991 @param aSourceBitmap The extended bitmap of type 0x10285A78 to be drawn.
   991 @param aSourceBitmap The extended bitmap of type 0x39b9273e to be drawn.
   992 
   992 
   993 @pre aSourceBitmap must be an extended bitmap of type 0x10285A78.
   993 @pre aSourceBitmap must be an extended bitmap of type 0x39b9273e.
   994 @post Sets an error that can be retrieved using GetError() is an error occurs. 
   994 @post Sets an error that can be retrieved using GetError() is an error occurs. 
   995  */
   995  */
   996 void CNvgRenderStage::DrawExtendedBitmap(MWsGraphicsContext& aGc, const TRect& aDestRect, const CFbsBitmap& aSourceBitmap)
   996 void CNvgRenderStage::DrawExtendedBitmap(MWsGraphicsContext& aGc, const TRect& aDestRect, const CFbsBitmap& aSourceBitmap)
   997 	{
   997 	{
   998   CopyExtendedBitmapToNormalBitmap(aSourceBitmap, *iBmp); 		
   998   CopyExtendedBitmapToNormalBitmap(aSourceBitmap, *iBmp); 		
  1001 
  1001 
  1002 /** Helper method used by BitBlt() and DrawBitmap()
  1002 /** Helper method used by BitBlt() and DrawBitmap()
  1003 
  1003 
  1004 @param aGc The graphics context to draw the extended bitmap to.
  1004 @param aGc The graphics context to draw the extended bitmap to.
  1005 @param aDestRect The rectangle that the source bitmap will be drawn to.
  1005 @param aDestRect The rectangle that the source bitmap will be drawn to.
  1006 @param aSourceBitmap The extended bitmap of type 0x10285A78 to be drawn.
  1006 @param aSourceBitmap The extended bitmap of type 0x39b9273e to be drawn.
  1007 
  1007 
  1008 @pre aSourceBitmap must be an extended bitmap of type 0x10285A78.
  1008 @pre aSourceBitmap must be an extended bitmap of type 0x39b9273e.
  1009 @post Sets an error that can be retrieved using GetError() is an error occurs. 
  1009 @post Sets an error that can be retrieved using GetError() is an error occurs. 
  1010  */
  1010  */
  1011 void CNvgRenderStage::DrawExtendedBitmap(CFbsBitGc& aGc, const TRect& aDestRect, const CFbsBitmap& aSourceBitmap)
  1011 void CNvgRenderStage::DrawExtendedBitmap(CFbsBitGc& aGc, const TRect& aDestRect, const CFbsBitmap& aSourceBitmap)
  1012 	{
  1012 	{
  1013   CopyExtendedBitmapToNormalBitmap(aSourceBitmap, *iBmp); 		
  1013   CopyExtendedBitmapToNormalBitmap(aSourceBitmap, *iBmp); 		
  1019 bitmap passed is resized before the extended bitmap is drawn into it.
  1019 bitmap passed is resized before the extended bitmap is drawn into it.
  1020 
  1020 
  1021 @param aExtendedBitmapSrc The extended bitmap to draw in to the normal bitmap aBitmapDest
  1021 @param aExtendedBitmapSrc The extended bitmap to draw in to the normal bitmap aBitmapDest
  1022 @param aBitmapDest The normal bitmap that the extended bitmap is to be drawn into
  1022 @param aBitmapDest The normal bitmap that the extended bitmap is to be drawn into
  1023 
  1023 
  1024 @pre aExtendedBitmapSrc must be an extended bitmap of extended bitmap type 0x10285A78
  1024 @pre aExtendedBitmapSrc must be an extended bitmap of extended bitmap type 0x39b9273e
  1025 @post aBitmapDest has been reset and resized and now contains a representation of the aExtendedBitmapSrc
  1025 @post aBitmapDest has been reset and resized and now contains a representation of the aExtendedBitmapSrc
  1026  */
  1026  */
  1027 void CNvgRenderStage::CopyExtendedBitmapToNormalBitmap(const CFbsBitmap& aExtendedBitmapSrc, CFbsBitmap& aBitmapDst)
  1027 void CNvgRenderStage::CopyExtendedBitmapToNormalBitmap(const CFbsBitmap& aExtendedBitmapSrc, CFbsBitmap& aBitmapDst)
  1028 	{
  1028 	{
  1029 	TSize size = aExtendedBitmapSrc.SizeInPixels();
  1029 	TSize size = aExtendedBitmapSrc.SizeInPixels();