rollback GetImageSource for button, label
authorMyung Jin Kim <critical.kim@samsung.com>
Fri, 14 Jun 2013 06:06:44 +0000 (15:06 +0900)
committerMyung Jin Kim <critical.kim@samsung.com>
Fri, 14 Jun 2013 06:06:44 +0000 (15:06 +0900)
Change-Id: I89230c74dea108c9289ca22c18751141fb7124b9

src/ui/controls/FUiCtrl_ButtonPresenter.cpp
src/ui/controls/FUiCtrl_LabelPresenter.cpp
src/ui/inc/FUiCtrl_ButtonPresenter.h
src/ui/inc/FUiCtrl_LabelPresenter.h

index 2068428..8646af6 100644 (file)
@@ -43,6 +43,7 @@ _ButtonPresenter::_ButtonPresenter(void)
        , __pButtonModel(null)
        , __previousEnabledState(false)
        , __touchMoveHandled(false)
+       , __lazyDecode(false)
        , __pFont(null)
        , __pTextObject(null)
        , __pBase(null)
@@ -345,11 +346,15 @@ _ButtonPresenter::DrawBackground(void)
                                __pBase->SetBackgroundColor(_Colorf(
                                                (float)bgColor.GetRed() / 255, (float)bgColor.GetGreen() / 255, (float)bgColor.GetBlue() / 255, (float)bgColor.GetAlpha() / 255));
                                __pBase->SetImageSource(imagePath);
+
+                               __lazyDecode = true;
                        }
                        else
                        {
                                __pBase->SetImageSource(L"");
 
+                               __lazyDecode = false;
+
                                pCanvas = __pButton->GetCanvasN();
                                if (pCanvas == null)
                                {
@@ -1159,7 +1164,7 @@ _ButtonPresenter::OnCanvasRequestedN(const FloatRectangle& bounds)
 {
        Canvas* pCanvas = null;
 
-       if (__pBase->GetImageSource().IsEmpty() == true)
+       if (__lazyDecode == true)
        {
                Bitmap* pBackgroundBitmap = null;
                _ButtonStatus status = __pButton->GetButtonStatus();
index 08264e2..231fa4a 100644 (file)
@@ -47,6 +47,7 @@ _LabelPresenter::_LabelPresenter(void)
        : __pLabel(null)
        , __pLabelModel(null)
        , __previousEnabledState(false)
+       , __lazyDecode(false)
        , __pFont(null)
        , __pTextObject(null)
        , __pBase(null)
@@ -286,11 +287,15 @@ _LabelPresenter::DrawBackground(void)
                                        (float)bgColor.GetRed() / 255, (float)bgColor.GetGreen() / 255, (float)bgColor.GetBlue() / 255, (float)bgColor.GetAlpha() / 255));
 
                        __pBase->SetImageSource(imagePath);
+
+                       __lazyDecode = true;
                }
                else
                {
                        __pBase->SetImageSource(L"");
 
+                       __lazyDecode = false;
+
                        pCanvas = __pLabel->GetCanvasN();
                        if (pCanvas == null)
                        {
@@ -461,7 +466,7 @@ _LabelPresenter::OnCanvasRequestedN(const FloatRectangle& bounds)
 {
        Canvas* pCanvas = null;
 
-       if (__pBase->GetImageSource().IsEmpty() == true)
+       if (__lazyDecode == true)
        {
                Bitmap* pBitmap = null;
 
index 765738e..315994f 100644 (file)
@@ -111,6 +111,7 @@ private:
        bool __needDraw;
        bool __previousEnabledState;
        bool __touchMoveHandled;
+       bool __lazyDecode;
 
        Tizen::Graphics::Font* __pFont;
        Tizen::Graphics::_Text::TextObject* __pTextObject;
index d487bda..f67c256 100644 (file)
@@ -95,6 +95,7 @@ private:
        _LabelModel* __pLabelModel;
 
        bool __previousEnabledState;
+       bool __lazyDecode;
 
        Tizen::Graphics::Font* __pFont;
        Tizen::Graphics::_Text::TextObject* __pTextObject;