From: Heeyong Song Date: Fri, 28 Mar 2014 08:14:27 +0000 (+0900) Subject: Fix filter issue X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6a924cb67da14bcacc925c7ee6063d2a763c3b7f;p=framework%2Fosp%2Fuifw.git Fix filter issue Change-Id: I26081f17b433c8a5142f218a3b030861de481c2e --- diff --git a/src/ui/animations/FUiAnim_GlCompositor.cpp b/src/ui/animations/FUiAnim_GlCompositor.cpp index b158b39..b014385 100644 --- a/src/ui/animations/FUiAnim_GlCompositor.cpp +++ b/src/ui/animations/FUiAnim_GlCompositor.cpp @@ -190,6 +190,14 @@ _GlCompositor::_GlCompositor(_GlRenderManager* pRenderManager) __pTempNode->__pVertices[18] = 1.0f; __pTempNode->__pVertices[19] = 1.0f; + // index buffer + __pTempNode->__pIndices[0] = 0; + __pTempNode->__pIndices[1] = 1; + __pTempNode->__pIndices[2] = 2; + __pTempNode->__pIndices[3] = 1; + __pTempNode->__pIndices[4] = 2; + __pTempNode->__pIndices[5] = 3; + __pTempNode->__transform.SetAsIdentity(); __pTempNode->__useTransform = false; __pTempNode->__textureRepeated = false; @@ -404,8 +412,6 @@ _GlCompositor::CompositeNode(VisualElement* pRenderObject, Tizen::Base::Collecti _VisualElementFilterImpl* pFilterImpl = _VisualElementFilterImpl::GetInstance(*pNode->__pFilter); bool useTempNode = false; VisualElementSurface* pSurface = null; - TextureInfo* pTextureInfo = null; - if (pFilterImpl->__pRenderSurface) { @@ -416,27 +422,21 @@ _GlCompositor::CompositeNode(VisualElement* pRenderObject, Tizen::Base::Collecti __pRenderManager->GetRenderQueue()->SetRenderTarget(pRenderSurfaceImpl); __pRenderManager->GetRenderQueue()->SetClear(); -// __pGlContext->BindFramebuffer(pRenderTextureInfo); -// __needClear = true; + __pRenderManager->GetRenderQueue()->SetViewport(0, 0, pRenderTextureInfo->width, pRenderTextureInfo->height); pNode->__useFilter = false; - //glViewport(0, 0, pRenderTextureInfo->width, pRenderTextureInfo->height); - __pRenderManager->GetRenderQueue()->SetViewport(0, 0, pRenderTextureInfo->width, pRenderTextureInfo->height); - __pRenderManager->GetRenderQueue()->EnqueueRenderObject(pNode, false, 0, true); __pRenderManager->GetRenderQueue()->FlushRenderQueue(); - __pRenderManager->GetRenderQueue()->SetRenderTarget(null); -// __pGlContext->BindFramebuffer(null); // TODO: restore previous framebuffer + __pRenderManager->GetRenderQueue()->SetRenderTarget(null); // TODO: restore previous framebuffer pNode->__useFilter = true; // for next rendering useTempNode = true; pSurface = pFilterImpl->__pRenderSurface; - pTextureInfo = pRenderTextureInfo; } if (pFilterImpl->__pInternalSurface) @@ -448,14 +448,9 @@ _GlCompositor::CompositeNode(VisualElement* pRenderObject, Tizen::Base::Collecti __pRenderManager->GetRenderQueue()->SetRenderTarget(pInternalSurfaceImpl); __pRenderManager->GetRenderQueue()->SetClear(); -// __pGlContext->BindFramebuffer(pInternalTextureInfo); -// __needClear = true; - - pFilterImpl->__isFirstPass = true; - __pRenderManager->GetRenderQueue()->SetViewport(0, 0, pInternalTextureInfo->width, pInternalTextureInfo->height); - //glViewport(0, 0, pInternalTextureInfo->width, pInternalTextureInfo->height); + pFilterImpl->__isFirstPass = true; if (useTempNode) { @@ -466,7 +461,6 @@ _GlCompositor::CompositeNode(VisualElement* pRenderObject, Tizen::Base::Collecti __pTempNode->__pFilter = pNode->__pFilter; __pTempNode->__useFilter = pNode->__useFilter; __pTempNode->__pSurface = pSurface; -// __pTempNode->__pTextureInfo = pTextureInfo; __pRenderManager->GetRenderQueue()->EnqueueRenderObject(__pTempNode, false, 0, true); } @@ -477,13 +471,11 @@ _GlCompositor::CompositeNode(VisualElement* pRenderObject, Tizen::Base::Collecti __pRenderManager->GetRenderQueue()->FlushRenderQueue(); - __pRenderManager->GetRenderQueue()->SetRenderTarget(null); - //__pGlContext->BindFramebuffer(null); // TODO: restore previous framebuffer + __pRenderManager->GetRenderQueue()->SetRenderTarget(null); // TODO: restore previous framebuffer // for next rendering useTempNode = true; pSurface = pFilterImpl->__pInternalSurface; - pTextureInfo = pInternalTextureInfo; } pFilterImpl->__isFirstPass = false; @@ -497,7 +489,6 @@ _GlCompositor::CompositeNode(VisualElement* pRenderObject, Tizen::Base::Collecti __pTempNode->__pFilter = pNode->__pFilter; __pTempNode->__useFilter = pNode->__useFilter; __pTempNode->__pSurface = pSurface; -// __pTempNode->__pTextureInfo = pTextureInfo; if (pFilterImpl->__downSampling) { @@ -506,28 +497,20 @@ _GlCompositor::CompositeNode(VisualElement* pRenderObject, Tizen::Base::Collecti __pRenderManager->GetRenderQueue()->SetRenderTarget(pRenderSurfaceImpl); __pRenderManager->GetRenderQueue()->SetClear(); - //__pGlContext->BindFramebuffer(pRenderTextureInfo); - //__needClear = true; - __pRenderManager->GetRenderQueue()->SetViewport(0, 0, pRenderTextureInfo->width, pRenderTextureInfo->height); - //glViewport(0, 0, pRenderTextureInfo->width, pRenderTextureInfo->height); __pRenderManager->GetRenderQueue()->EnqueueRenderObject(__pTempNode, false, 0, true); __pRenderManager->GetRenderQueue()->FlushRenderQueue(); - - __pRenderManager->GetRenderQueue()->SetRenderTarget(null); - //__pGlContext->BindFramebuffer(null); // TODO: restore previous framebuffer + __pRenderManager->GetRenderQueue()->SetRenderTarget(null); // TODO: restore previous framebuffer // for next rendering __pTempNode->__useFilter = false; __pTempNode->__pSurface = pFilterImpl->__pRenderSurface; -// __pTempNode->__pTextureInfo = pRenderTextureInfo; } __pRenderManager->GetRenderQueue()->SetViewport(__viewport.x, __viewport.y, __viewport.width, __viewport.height); - //glViewport(__viewport.x, __viewport.y, __viewport.width, __viewport.height); __pRenderManager->GetRenderQueue()->EnqueueRenderObject(__pTempNode, useStencil, stencilIndex, true); } @@ -590,16 +573,6 @@ _GlCompositor::CompositeView(_GlLayer* pLayer, _RootVisualElement* pRoot, _ViewI __pRenderManager->GetRenderQueue()->SetRenderTarget(null); } -// if (pSurface) -// { -// __pGlContext->BindFramebuffer(pView->GetRenderTargetInfo()); -// __needClear = true; -// } -// else -// { -// __pGlContext->BindFramebuffer(null); -// } - Tizen::Graphics::FloatRectangle* pViewport = pView->GetViewport(); int orientation = pLayer->GetOrientation(); if (pViewport) @@ -629,7 +602,6 @@ _GlCompositor::CompositeView(_GlLayer* pLayer, _RootVisualElement* pRoot, _ViewI __viewport.height = pViewport->height; __pRenderManager->GetRenderQueue()->SetViewport(__viewport.x, __viewport.y, __viewport.width, __viewport.height); -// glViewport(__viewport.x, __viewport.y, __viewport.width, __viewport.height); } if (orientation != 0) @@ -721,14 +693,11 @@ _GlCompositor::CompositeView(_GlLayer* pLayer, _RootVisualElement* pRoot, _ViewI { __viewport = viewport; __pRenderManager->GetRenderQueue()->SetViewport(__viewport.x, __viewport.y, __viewport.width, __viewport.height); - -// glViewport(__viewport.x, __viewport.y, __viewport.width, __viewport.height); } if (pSurface) { __pRenderManager->GetRenderQueue()->SetRenderTarget(null); - //__pGlContext->BindFramebuffer(null); } if (pCamera) @@ -763,12 +732,10 @@ _GlCompositor::CompositeLayer(_GlLayer* pLayer) return; } -// __needClear = true; __pRenderManager->GetRenderQueue()->SetClear(); bool isUpdated = pLayer->UpdateNativeNodes(); - if (isUpdated) { // init matrix