Modify DrawBitmap with degree For AlphaConstant
authorhoonik.lee <hoonik.lee@samsung.com>
Tue, 9 Apr 2013 12:41:45 +0000 (21:41 +0900)
committerhoonik.lee <hoonik.lee@samsung.com>
Tue, 9 Apr 2013 12:41:45 +0000 (21:41 +0900)
Change-Id: Ib5a9bdec1603ea194b0707b5437b612170fa57a3
Signed-off-by: hoonik.lee <hoonik.lee@samsung.com>
src/graphics/FGrp_Canvas.cpp

index 0f50cf4..2bfebd8 100755 (executable)
@@ -2039,7 +2039,7 @@ _Canvas::DrawBitmap(const _Util::Point<double>& pointD, const _Bitmap& bitmap, c
 
        int alphaConstant = this->_GetAlphaAttenuation(bitmap);
 
-       if (alphaConstant >= 255 && !bitmap.__hasMaskingColor)
+       if (!this->__useStableRenderer && bitmap.GetBitsPerPixel() == 32)
        {
                bool pass = false;
 
@@ -2052,7 +2052,6 @@ _Canvas::DrawBitmap(const _Util::Point<double>& pointD, const _Bitmap& bitmap, c
                const BufferInfo& srcBufferInfo = srcLock.GetBufferInfo();
                const BufferInfo& dstBufferInfo = dstLock.GetBufferInfo();
 
-               if (!this->__useStableRenderer)
                {
                        _Util::Pixmap srcImage(srcBufferInfo.width, srcBufferInfo.height, srcBufferInfo.bitsPerPixel, srcBufferInfo.pPixels, srcBufferInfo.pitch);
                        _ApplySrcBitmapAttrib(srcImage, bitmap, bitmap.__isOpaqueAllOver);
@@ -2060,7 +2059,21 @@ _Canvas::DrawBitmap(const _Util::Point<double>& pointD, const _Bitmap& bitmap, c
                        _Util::Pixmap dstImageUnclipped(dstBufferInfo.width, dstBufferInfo.height, dstBufferInfo.bitsPerPixel, dstBufferInfo.pPixels, dstBufferInfo.pitch);
                        _Util::Pixmap dstImage = dstImageUnclipped.GetSubBitmap(clipRect.x, clipRect.y, clipRect.width, clipRect.height);
 
-                       pass = _Pixman::RotatePixmap(dstImage, srcImage, GetDrawingQuality(), GetCompositeMode(), pointD.x - clipRect.x, pointD.y - clipRect.y, degreeD, pivotD.x, pivotD.y);
+                       if  (alphaConstant < 255)
+                       {
+                               std::unique_ptr<_Util::Pixmap> modifiedSrcImage(srcImage.GetAlphaAttenuatedPixmap(alphaConstant));
+
+                               if (modifiedSrcImage != null)
+                               {
+                                       pass = _Pixman::RotatePixmap(dstImage, *modifiedSrcImage.get(), GetDrawingQuality(), GetCompositeMode(), pointD.x - clipRect.x, pointD.y - clipRect.y, degreeD, pivotD.x, pivotD.y);
+                               }
+                       }
+
+                       if (!pass)
+                       {
+                               pass = _Pixman::RotatePixmap(dstImage, srcImage, GetDrawingQuality(), GetCompositeMode(), pointD.x - clipRect.x, pointD.y - clipRect.y, degreeD, pivotD.x, pivotD.y);
+                       }
+
                }
 
                if (pass)