#include <X11/Xlib.h>
#include <X11/Xmd.h>
#include <EGL/egl.h>
+#include <EGL/eglext.h>
#if defined(_OSP_EMUL_)
#define FGRAPHICS_INTERNAL_USE_EGLCOPYBUFFER
, swapDone(false)
, isFirstSwap(true)
, pSecondSglInfo(null)
+ , pBitmapPointer(null)
+ , pBitmapLocked(null)
{
}
bool swapDone;
bool isFirstSwap;
_SglInfo* pSecondSglInfo;
+ void* pBitmapPointer;
+ Bitmap* pBitmapLocked;
private:
_SglInfo(const _SglInfo& sglInfo);
return eglQuerySurface(dpy, EGL_NO_SURFACE, attribute, pValue);
}
- EGLBoolean ret = eglQuerySurface(dpy, pSglInfo->surface, attribute, pValue);
+ EGLBoolean ret = EGL_FALSE;
+ if (attribute == EGL_BITMAP_POINTER_KHR)
+ {
+ *pValue = (EGLint)pSglInfo->pBitmapPointer;
+ ret = EGL_TRUE;
+ }
+ else
+ {
+ ret = eglQuerySurface(dpy, pSglInfo->surface, attribute, pValue);
+ }
+
pSglInfoTableManipulatorInstance->UnlockSglInfoTable();
return ret;
typedef void (*__EglMustCastToProperFunctionPointerType)(void);
+EGLBoolean _SglLockSurfaceKHR(EGLDisplay display, EGLSurface surface, const EGLint *attrib_list)
+{
+ _SglInfoTableManipulator* pSglInfoTableManipulatorInstance = _SglInfoTableManipulator::GetInstance();
+
+ _SglIndex sglIndex = (_SglIndex)surface;
+ _SglInfo* pSglInfo = pSglInfoTableManipulatorInstance->LockSglInfoTable(sglIndex);
+
+ if (sglIndex <= INVALID_SGL_INDEX || pSglInfo == null || pSglInfo->pBitmap == null || pSglInfo->pBitmapLocked != null)
+ {
+ pSglInfoTableManipulatorInstance->UnlockSglInfoTable();
+ SysLog(NID_GRP, "_SglLockSurfaceKHR failed!! dpy:%#x sglIndex:%#x", (unsigned int)display
+ , (unsigned int)surface);
+ return EGL_FALSE;
+ }
+
+ _SglInfo* pSglInfoLock = pSglInfo;
+ BufferInfo bufferInfo;
+ if(!pSglInfo->isBackbuffer && pSglInfo->pSecondSglInfo != null)
+ {
+ pSglInfoLock = pSglInfo->pSecondSglInfo;
+ }
+
+ pSglInfoLock->pBitmap->Lock(bufferInfo);
+ pSglInfo->pBitmapPointer = bufferInfo.pPixels;
+ pSglInfo->pBitmapLocked = pSglInfoLock->pBitmap;
+ pSglInfoTableManipulatorInstance->UnlockSglInfoTable();
+
+ return EGL_TRUE;
+}
+
+EGLBoolean _SglUnlockSurfaceKHR(EGLDisplay display, EGLSurface surface)
+{
+ _SglInfoTableManipulator* pSglInfoTableManipulatorInstance = _SglInfoTableManipulator::GetInstance();
+
+ _SglIndex sglIndex = (_SglIndex)surface;
+ _SglInfo* pSglInfo = pSglInfoTableManipulatorInstance->LockSglInfoTable(sglIndex);
+
+ if (sglIndex <= INVALID_SGL_INDEX || pSglInfo == null || pSglInfo->pBitmap == null || pSglInfo->pBitmapLocked == null)
+ {
+ pSglInfoTableManipulatorInstance->UnlockSglInfoTable();
+ SysLog(NID_GRP, "_SglUnlockSurfaceKHR failed!! dpy:%#x sglIndex:%#x", (unsigned int)display
+ , (unsigned int)surface);
+ return EGL_FALSE;
+ }
+
+ pSglInfo->pBitmapLocked->Unlock();
+ pSglInfo->pBitmapPointer = null;
+ pSglInfo->pBitmapLocked = null;
+ pSglInfoTableManipulatorInstance->UnlockSglInfoTable();
+
+ return EGL_TRUE;
+}
+
__EglMustCastToProperFunctionPointerType
_SglGetProcAddress(const char* pProcName)
{
+ String name(pProcName);
+
+ if (name.CompareTo(String("eglLockSurfaceKHR")) == 0)
+ {
+ return (__EglMustCastToProperFunctionPointerType)_SglLockSurfaceKHR;
+ }
+ else if (name.CompareTo(String("eglUnlockSurfaceKHR")) == 0)
+ {
+ return (__EglMustCastToProperFunctionPointerType)_SglUnlockSurfaceKHR;
+ }
+
return eglGetProcAddress(pProcName);
}
result
_DimmingManager::CreateDimmingLayer(_Window* pWindow)
{
+ if (!pWindow)
+ {
+ return E_SUCCESS;
+ }
+
+ _DimmingLayer* pPrevDimmingLayer = pWindow->GetDimmingLayer();
+ if (pPrevDimmingLayer)
+ {
+ return E_SUCCESS;
+ }
+
result r = E_SUCCESS;
_DimmingLayer* pDimmingLayer = new (std::nothrow) _DimmingLayer();
if (rotateEvas == true)
{
ecore_evas_rotation_with_resize_set(pEcoreEvas, orientation);
- }
- evas_object_move(pWinObj, 0, 0);
+ evas_object_move(pWinObj, 0, 0);
- if ((orientation == 0) || (orientation == 180))
- {
- evas_object_resize(pWinObj, rootW, rootH);
- }
- else
- {
- evas_object_resize(pWinObj, rootH, rootW);
- }
+ if ((orientation == 0) || (orientation == 180))
+ {
+ evas_object_resize(pWinObj, rootW, rootH);
+ }
+ else
+ {
+ evas_object_resize(pWinObj, rootH, rootW);
+ }
- SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x, FULL SCREEN] Rotate bounds(rot = %d).", win, orientation);
+ SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x, FULL SCREEN] Rotate bounds(rot = %d).", win, orientation);
+ }
}
else
{
return _DisplayManager::GetInstance()->Flush();
}
-result
-_VisualElementImpl::SetImageSource(const String& filePath)
-{
- result r = E_SUCCESS;
- RebuildHierarchyProps(0, true, true);
-
- SysTryReturnResult(NID_UI_ANIM, HAVE_SURFACE(this), E_SYSTEM, "Realizing back-buffer surface failed.");
-
- if (!filePath.IsEmpty())
- {
- r = GetSharedData().SetImage(filePath);
- SysTryLog(NID_UI_ANIM, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r));
- }
-
- __imageFilePath = filePath;
-
- return r;
-}
-
-
bool
_VisualElementImpl::CreateImplicitAnimationIfNeeded( const String& property,
const Variant& newValue, const Variant& currentPresentationValue, const String** pSubProperties)
return E_SUCCESS;
}
+result
+_VisualElementImpl::SetImageSource(const String& filePath)
+{
+ result r = E_SUCCESS;
+
+ // Delete the old surface
+ if (GetSharedData().pSurface)
+ {
+ delete GetSharedData().pSurface;
+ }
+
+ __needRecreateSurface = true;
+
+ GetSharedData().pSurface = null;
+ GetSharedData().fixedSurfaceSize = false;
+
+ // Fully invalidate because new surface should be allocated and redrawn
+ GetSharedData().invalidatedRegion.SetBounds(0.0f, 0.0f, __bounds.width, __bounds.height);
+
+
+ RebuildHierarchyProps(0, true, true);
+
+ SysTryReturnResult(NID_UI_ANIM, HAVE_SURFACE(this), E_SYSTEM, "Realizing back-buffer surface failed.");
+
+ if (!filePath.IsEmpty())
+ {
+ r = GetSharedData().SetImage(filePath);
+ SysTryLog(NID_UI_ANIM, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r));
+ }
+
+ __imageFilePath = filePath;
+
+ return r;
+}
+
void
_VisualElementImpl::SetSurfaceChanged(void)
{