Modify DrawBitmap for performance
authorhoonik.lee <hoonik.lee@samsung.com>
Tue, 16 Apr 2013 02:28:36 +0000 (11:28 +0900)
committerhoonik.lee <hoonik.lee@samsung.com>
Tue, 16 Apr 2013 02:28:36 +0000 (11:28 +0900)
Change-Id: I52f63a67d9d2b13f974a7ed3a70bc5354fb39d70
Signed-off-by: hoonik.lee <hoonik.lee@samsung.com>
src/graphics/FGrp_Canvas.cpp

index 622a10b..c28ee57 100755 (executable)
@@ -1320,7 +1320,7 @@ _Canvas::DrawBitmap(const _Util::Rectangle<double>& rectD, const _Bitmap& bitmap
                const BufferInfo& dstBufferInfo = dstLock.GetBufferInfo();
 
                {
-                       if (!this->__useStableRenderer && srcBufferInfo.bitsPerPixel == 32)
+                       if (!this->__useStableRenderer && srcBufferInfo.bitsPerPixel == 32 && GetCompositeMode() != COMPOSITE_MODE_SRC_OVER)
                        {
                                _Util::Pixmap srcImage(srcBufferInfo.width, srcBufferInfo.height, srcBufferInfo.bitsPerPixel, srcBufferInfo.pPixels, srcBufferInfo.pitch);
                                _ApplySrcBitmapAttrib(srcImage, bitmap, bitmap.__isOpaqueAllOver);
@@ -1345,7 +1345,7 @@ _Canvas::DrawBitmap(const _Util::Rectangle<double>& rectD, const _Bitmap& bitmap
 
                        }
 
-                       if (!pass)
+                       if (!pass && alphaConstant >= 255)
                        {
                                _Util::Pixmap srcImage(srcBufferInfo.width, srcBufferInfo.height, srcBufferInfo.bitsPerPixel, srcBufferInfo.pPixels, srcBufferInfo.pitch);
                                _ApplySrcBitmapAttrib(srcImage, bitmap, bitmap.__isOpaqueAllOver);
@@ -1511,7 +1511,7 @@ _Canvas::DrawBitmap(const _Util::Point<double>& pointD, const _Bitmap& bitmap)
                                }
                        }
                        {
-                               bool isPixmanSupported = (!this->__useStableRenderer);
+                               bool isPixmanSupported = (!this->__useStableRenderer && GetCompositeMode() != COMPOSITE_MODE_SRC_OVER);
 
                                if (isPixmanSupported)
                                {
@@ -1613,7 +1613,7 @@ _Canvas::DrawBitmap(const _Util::Rectangle<double>& destRectD, const _Bitmap& sr
                const BufferInfo& dstBufferInfo = dstLock.GetBufferInfo();
 
                {
-                       if (!this->__useStableRenderer && srcBufferInfo.bitsPerPixel == 32)
+                       if (!this->__useStableRenderer && srcBufferInfo.bitsPerPixel == 32 && GetCompositeMode() != COMPOSITE_MODE_SRC_OVER)
                        {
                                _Util::Rectangle<int> srcBounds =
                                {
@@ -1646,7 +1646,7 @@ _Canvas::DrawBitmap(const _Util::Rectangle<double>& destRectD, const _Bitmap& sr
                                }
                        }
 
-                       if (!pass)
+                       if (!pass && alphaConstant >= 255)
                        {
                                unsigned char* pPixels = (unsigned char*) srcBufferInfo.pPixels + srcRect.y * srcBufferInfo.pitch + srcRect.x * (srcBufferInfo.bitsPerPixel / 8);
 
@@ -1789,7 +1789,7 @@ _Canvas::DrawBitmapForNinePatchedBitmap(const Rectangle& destRect, const _Bitmap
                const BufferInfo& dstBufferInfo = dstLock.GetBufferInfo();
 
                {
-                       if (srcBufferInfo.bitsPerPixel == 32)
+                       if (srcBufferInfo.bitsPerPixel == 32 && GetCompositeMode() != COMPOSITE_MODE_SRC_OVER)
                        {
                                _Util::Rectangle<int> outRect = { 0, 0, -1, -1 };
                                _Util::Rectangle<int> dstRect = { destRect.x, destRect.y, destRect.width, destRect.height };
@@ -1874,7 +1874,7 @@ _Canvas::DrawBitmapForNinePatchedBitmap(const Rectangle& destRect, const _Bitmap
 #endif
                        }
 
-                       if (!pass)
+                       if (!pass && alphaConstant >= 255)
                        {
                                unsigned char* pPixels = (unsigned char*) srcBufferInfo.pPixels + srcRect.y * srcBufferInfo.pitch + srcRect.x * (srcBufferInfo.bitsPerPixel / 8);