fix crash and touch blocking problem
authorDae Young Ryu <karzia@samsung.com>
Thu, 18 Jul 2013 12:15:58 +0000 (21:15 +0900)
committerDae Young Ryu <karzia@samsung.com>
Thu, 18 Jul 2013 12:15:58 +0000 (21:15 +0900)
Change-Id: Iad77a3feb259b8ca5ec812bd6aa11d73a3f66702
Signed-off-by: Dae Young Ryu <karzia@samsung.com>
src/ui/FUi_XUiEventManager.cpp
src/ui/animations/FUiAnim_GlContext.cpp
src/ui/animations/FUiAnim_GlRenderManager.cpp
src/ui/animations/FUiAnim_GlVisualElementSurfaceImpl.cpp
src/ui/controls/FUiCtrl_Form.cpp
src/ui/controls/FUiCtrl_Indicator.cpp

index 442d402..562f1a3 100644 (file)
 #include "FUiAnim_GlDisplayManager.h"
 #include "FUiAnim_GlNode.h"
 #include "FUiAnim_ControlVisualElement.h"
-#if defined(MULTI_WINDOW)
+
 #include "FUiAnim_RootVisualElement.h"
 #include "FUiAnim_GlLayer.h"
-#endif
+
 
 using namespace std;
 using namespace Tizen::Ui;
@@ -518,25 +518,18 @@ private:
                {
                        _Window* pWindow = null;
 
-#if !defined(MULTI_WINDOW)
-                       pWindow = pControlManager->GetCurrentFrame();
-#else
                        pWindow = pControlManager->GetTopVisibleWindowAt(Point(x, y));
-#endif
+
                        SysTryReturn(NID_UI, pWindow, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
                        Tizen::Graphics::Rectangle winBounds = pWindow->GetBounds();
 
                        ptf.x = static_cast<float>(x - winBounds.x);
                        ptf.y = static_cast<float>(y - winBounds.y);
 
-#if !defined(MULTI_WINDOW)
-                       //pRootControlElement = dynamic_cast <_ControlVisualElement*>(pControlManager->GetRoot().GetVisualElement());
-#else
                        _Window* pTouchedWindow = pControlManager->GetTopVisibleWindowAt(Point(x, y));
                        SysTryReturn(NID_UI, pTouchedWindow, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
 
                        pRootControlElement = dynamic_cast <_ControlVisualElement*>(pTouchedWindow->GetVisualElement());
-#endif
                }
 
                SysTryReturn(NID_UI, pRootControlElement, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
@@ -557,16 +550,6 @@ private:
                _ControlManager* pControlManager = _ControlManager::GetInstance();
                SysTryReturn(NID_UI, pControlManager, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
 
-#if !defined(MULTI_WINDOW)
-//             _EcoreEvasMgr* pEcoreEvasMgr = GetEcoreEvasMgr();
-//             SysTryReturn(NID_UI, pEcoreEvasMgr, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
-
-//             _EcoreEvas* pEcoreEvas = pEcoreEvasMgr->GetEcoreEvas();
-//             SysTryReturn(NID_UI, pEcoreEvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
-
-//             Ecore_Evas* pEE = pEcoreEvas->GetEcoreEvas();
-//             SysTryReturn(NID_UI, pEE, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
-#else
 //             _Window* pTouchedWindow = pControlManager->GetTopWindowAt(_CoordinateSystemUtils::InverseTransform(Point(x, y)), false);
 //             SysTryReturn(NID_UI, pTouchedWindow, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
 
@@ -574,7 +557,6 @@ private:
 //             _EflLayer* pLayer = static_cast<_EflLayer*>(pRootVE->GetNativeLayer());
 
 //             Ecore_Evas* pEE = pLayer->GetEcoreEvas();
-#endif
 
                const int PORTRAIT = 0;
                const int LANDSCAPE = 270;
index 8dcf731..728ba60 100644 (file)
@@ -518,7 +518,8 @@ _GlContext::CreateTexture(Handle textureInfo)
                if (IsSupportedBGRA())
                {
 #if defined(_OSP_EMUL_)
-                       glTexImage2D(GL_TEXTURE_2D, 0, GL_BGRA, pTextureInfo->width, pTextureInfo->height, 0, GL_BGRA, GL_UNSIGNED_BYTE, pTextureInfo->pPixels);
+                       //glTexImage2D(GL_TEXTURE_2D, 0, GL_BGRA, pTextureInfo->width, pTextureInfo->height, 0, GL_BGRA, GL_UNSIGNED_BYTE, pTextureInfo->pPixels);
+                       glTexImage2D(GL_TEXTURE_2D, 0, GL_BGRA_EXT, pTextureInfo->width, pTextureInfo->height, 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, pTextureInfo->pPixels);
 #else
                        glTexImage2D(GL_TEXTURE_2D, 0, GL_BGRA_EXT, pTextureInfo->width, pTextureInfo->height, 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, pTextureInfo->pPixels);
 #endif
@@ -548,7 +549,8 @@ _GlContext::UploadTexture(Handle surfaceInfo)
                if (IsSupportedBGRA())
                {
 #if defined(_OSP_EMUL_)
-                       glTexSubImage2D(GL_TEXTURE_2D, 0, pSurfaceInfo->x, pSurfaceInfo->y, pSurfaceInfo->width, pSurfaceInfo->height, GL_BGRA, GL_UNSIGNED_BYTE, pSurfaceInfo->pPixels);
+                       //glTexSubImage2D(GL_TEXTURE_2D, 0, pSurfaceInfo->x, pSurfaceInfo->y, pSurfaceInfo->width, pSurfaceInfo->height, GL_BGRA, GL_UNSIGNED_BYTE, pSurfaceInfo->pPixels);
+                       glTexSubImage2D(GL_TEXTURE_2D, 0, pSurfaceInfo->x, pSurfaceInfo->y, pSurfaceInfo->width, pSurfaceInfo->height, GL_BGRA_EXT, GL_UNSIGNED_BYTE, pSurfaceInfo->pPixels);
 #else
                        glTexSubImage2D(GL_TEXTURE_2D, 0, pSurfaceInfo->x, pSurfaceInfo->y, pSurfaceInfo->width, pSurfaceInfo->height, GL_BGRA_EXT, GL_UNSIGNED_BYTE, pSurfaceInfo->pPixels);
 #endif
index 808f68d..88eeece 100644 (file)
@@ -60,6 +60,7 @@ using namespace Tizen::Ui::Animations;
 
 #define PRINT printf
 
+
 //#define ELAPSE(_STR) unique_ptr<_ElapsedTime> ptr(new _ElapsedTime(_STR));
 
 #ifdef VE_USE_GL_MULTI_CONTEXT
index 7f31aaf..45b89f5 100644 (file)
@@ -196,7 +196,7 @@ _GlVisualElementSurfaceImpl::~_GlVisualElementSurfaceImpl(void)
 result
 _GlVisualElementSurfaceImpl::SetImage(const String& fileName)
 {
-       SysAssertf(false, "SetImage() : NOT IMPLEMENTED YET!!!");
+//     SysAssertf(false, "SetImage() : NOT IMPLEMENTED YET!!!");
        return E_SYSTEM;
 }
 
index 779f50c..f6cad67 100644 (file)
@@ -1949,8 +1949,15 @@ _Form::IsIndicatorVisible(void) const
 
        if (pFrame && IsAttachedToMainTree())
        {
-               visible = __pIndicator->GetIndicatorShowState();
-               SysTryReturn(NID_UI_CTRL, GetLastResult() == E_SUCCESS, false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+               if(__pIndicator)
+               {
+                       visible = __pIndicator->GetIndicatorShowState();
+                       SysTryReturn(NID_UI_CTRL, GetLastResult() == E_SUCCESS, false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+               }
+               else
+               {
+                       return false;
+               }
        }
        else
        {
@@ -2001,20 +2008,23 @@ _Form::IsIndicatorTranslucent(void) const
                FrameShowMode mode = pFrame->GetShowMode();
                if (mode == FRAME_SHOW_MODE_FULL_SCREEN)
                {
-                       opacity = __pIndicator->GetIndicatorOpacity();
-                       SysTryReturn(NID_UI_CTRL, GetLastResult() == E_SUCCESS, false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
-                       if (opacity == _INDICATOR_OPACITY_TRANSLUCENT)
+                       if(__pIndicator)
                        {
-                               transparent = true;
-                       }
-                       else if (opacity == _INDICATOR_OPACITY_OPAQUE)
-                       {
-                               transparent = false;
-                       }
-                       else
-                       {
-                               transparent = true;
+                               opacity = __pIndicator->GetIndicatorOpacity();
+                               SysTryReturn(NID_UI_CTRL, GetLastResult() == E_SUCCESS, false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+                               if (opacity == _INDICATOR_OPACITY_TRANSLUCENT)
+                               {
+                                       transparent = true;
+                               }
+                               else if (opacity == _INDICATOR_OPACITY_OPAQUE)
+                               {
+                                       transparent = false;
+                               }
+                               else
+                               {
+                                       transparent = true;
+                               }
                        }
                }
        }
@@ -2267,6 +2277,8 @@ _Form::CreateIndicatorN(void)
        SysTryReturn(NID_UI_CTRL, pIndicator, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
 
        return pIndicator;
+#else
+       return null;
 #endif
 }
 
@@ -2931,6 +2943,9 @@ _Form::SetIndicatorShowState(bool state)
        SysTryReturn(NID_UI_CTRL, pEcoreEvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Unable to get evas");
 #endif
 
+       if(!__pIndicator)
+               return r;
+
        _Control* pParent = GetParent();
        if (!pParent)
        {
@@ -2980,6 +2995,9 @@ _Form::SetIndicatorAutoHide(bool portrait, bool landscape)
 {
        result r = E_SUCCESS;
 
+       if(!__pIndicator)
+               return ;
+
        _Control* pParent = GetParent();
        _Frame* pFrame = dynamic_cast<_Frame*>(pParent);
 
@@ -3005,6 +3023,9 @@ _Form::SetIndicatorOpacity(Tizen::Ui::Controls::_IndicatorOpacity opacity)
        _Control* pParent = GetParent();
        _Frame* pFrame = dynamic_cast<_Frame*>(pParent);
 
+       if(!__pIndicator)
+               return r;
+
        if (pFrame && IsAttachedToMainTree())
        {
                FrameShowMode mode = pFrame->GetShowMode();
@@ -3111,8 +3132,11 @@ _Form::AttachedToMainTree(void)
 
        if (FORM_STYLE_INDICATOR & GetFormStyle())
        {
-               __pIndicator->OnAttachedToMainTree();
-               AddIndicatorObject();
+               if(__pIndicator)
+               {
+                       __pIndicator->OnAttachedToMainTree();
+                       AddIndicatorObject();
+               }
 
                if (__transparentIndicator != IsIndicatorTranslucent())
                {
@@ -3320,7 +3344,7 @@ _Form::OnBoundsChanged(void)
 
        if (__pIndicator)
        {
-                       __pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, GetClientBoundsF().width, indicatorheight));
+               __pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, GetClientBoundsF().width, indicatorheight));
        }
        AdjustClientBounds();
 
index f8776c1..ad5880c 100644 (file)
@@ -271,6 +271,7 @@ _Indicator::SetNotificationTrayOpenEnabled(bool enable)
 
        return E_SUCCESS;
 #endif 
+       return E_SUCCESS;
 }
 
 bool
@@ -295,6 +296,8 @@ _Indicator::IsNotificationTrayOpenEnabled(void) const
        {
                return false;
        }
+#else
+       return true;
 #endif
 }
 #ifdef BUILD_BREAK