From 574b61ee5ab256053cbcf98579e5bbae2732bc93 Mon Sep 17 00:00:00 2001 From: "hoonik.lee" Date: Tue, 9 Apr 2013 21:41:45 +0900 Subject: [PATCH] Modify DrawBitmap with degree For AlphaConstant Change-Id: Ib5a9bdec1603ea194b0707b5437b612170fa57a3 Signed-off-by: hoonik.lee --- src/graphics/FGrp_Canvas.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/graphics/FGrp_Canvas.cpp b/src/graphics/FGrp_Canvas.cpp index 0f50cf4..2bfebd8 100755 --- a/src/graphics/FGrp_Canvas.cpp +++ b/src/graphics/FGrp_Canvas.cpp @@ -2039,7 +2039,7 @@ _Canvas::DrawBitmap(const _Util::Point& 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& 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& 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) -- 2.7.4