add patch
[framework/osp/uifw.git] / src / graphics / FGrp_CanvasImpl.cpp
index c6ecf2e..53477bf 100755 (executable)
@@ -1161,6 +1161,22 @@ _CanvasImpl::DrawBitmap(const FloatPoint& vcPointF, const _BitmapImpl& bitmap)
 
        SysTryReturnResult(NID_GRP, BITMAP_IS_VALID(bitmap), E_INVALID_ARG, "The source bitmap is invalid.");
 
+       // This code is executed using neon.acceleration.
+       {
+               bool isXEqualToInteger = _Util::Abs(vcPointF.x - int(vcPointF.x)) <= 0.01;
+               bool isYEqualToInteger = _Util::Abs(vcPointF.y - int(vcPointF.y)) <= 0.01;
+
+               bool isCompositeModeUnbound = GetCompositeMode() == COMPOSITE_MODE_SRC_IN
+                                                                        || GetCompositeMode() == COMPOSITE_MODE_DST_IN
+                                                                        || GetCompositeMode() == COMPOSITE_MODE_SRC_OUT
+                                                                        || GetCompositeMode() == COMPOSITE_MODE_DST_ATOP;
+
+               if (isXEqualToInteger && isYEqualToInteger && !isCompositeModeUnbound)
+               {
+                       return this->DrawBitmap(Point(int(vcPointF.x), int(vcPointF.y)), bitmap);
+               }
+       }
+
        FloatRectangle rtCanvasF = _GetBoundsRelF(*this);
 
        if (rtCanvasF.IsEmpty())
@@ -2425,6 +2441,14 @@ _CanvasImpl::SetDashPattern(const Tizen::Base::Collection::IListT<int>& pattern,
 {
        SysTryReturn(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance is not constructed yet.");
 
+       int dashValue = 0;
+
+       for (int i = 0; i < pattern.GetCount(); i++)
+       {
+               pattern.GetAt(i, dashValue);
+               SysTryReturn(NID_GRP, dashValue >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] One of the values of the specified pattern is negative(%d).", dashValue);
+       }
+
        result r = E_SUCCESS;
 
        // It is NOT the strong guarantee for an exception
@@ -2481,6 +2505,14 @@ _CanvasImpl::SetDashPattern(const Tizen::Base::Collection::IListT<float>& patter
 {
        SysTryReturn(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance is not constructed yet.");
 
+       float dashValue = 0.0f;
+
+       for (int i = 0; i < pattern.GetCount(); i++)
+       {
+               pattern.GetAt(i, dashValue);
+               SysTryReturn(NID_GRP, dashValue >= 0.0f, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] One of the values of the specified pattern is negative(%f).", dashValue);
+       }
+
        result r = E_SUCCESS;
 
        // It is NOT the strong guarantee for an exception
@@ -2504,13 +2536,13 @@ _CanvasImpl::SetDashPattern(const Tizen::Base::Collection::IListT<float>& patter
        }
 
        {
-               float dashIntValue = 0.0f;
+               float dashFloatValue = 0.0f;
                Tizen::Graphics::_Util::AccumList<double> dashValueList;
 
                for (int i = 0; i < pattern.GetCount(); i++)
                {
-                       pattern.GetAt(i, dashIntValue);
-                       dashValueList.Push(double(dashIntValue));
+                       pattern.GetAt(i, dashFloatValue);
+                       dashValueList.Push(double(dashFloatValue));
                }
 
                r = this->_pNativeCanvas->SetDashPattern(dashValueList, double(offset));