m_pixmapContext = pixmapContext;
}
+bool SharedPlatformSurfaceTizen::supportsLockSurfaceExtension()
+{
+ static bool extSupportQueried = false;
+ static bool supportLockSurfaceExt = false;
+
+ if (extSupportQueried)
+ return supportLockSurfaceExt;
+
+ extSupportQueried = true;
+ Display* nativeDisplay = 0;
+ EGLDisplay display = eglGetCurrentDisplay();
+
+ if (display == EGL_NO_DISPLAY) {
+ nativeDisplay = XOpenDisplay(0);
+ display = eglGetDisplay(reinterpret_cast<EGLNativeDisplayType>(nativeDisplay));
+ eglInitialize(display, 0, 0);
+ }
+
+ if (display != EGL_NO_DISPLAY) {
+ String rawExtensions = reinterpret_cast<const char*>(eglQueryString(display, EGL_EXTENSIONS));
+ Vector<String> extNames;
+ rawExtensions.lower().split(" ", extNames);
+
+ if (extNames.contains("egl_khr_lock_surface"))
+ supportLockSurfaceExt = true;
+
+ extNames.clear();
+ }
+
+ return supportLockSurfaceExt;
+}
+
SharedPlatformSurfaceTizen::~SharedPlatformSurfaceTizen()
{
if (m_surface != EGL_NO_SURFACE) {
#include "WebLayerTreeRendererTizen.h"
#endif
+#include <EGL/egl.h>
+#include <X11/Xlib.h>
+
namespace WebKit {
using namespace WebCore;
+// FIXME: This function needs a better place
+static bool supportsLockSurfaceExtension()
+{
+ static bool extSupportQueried = false;
+ static bool supportLockSurfaceExt = false;
+
+ if (extSupportQueried)
+ return supportLockSurfaceExt;
+
+ extSupportQueried = true;
+ Display* nativeDisplay = 0;
+ EGLDisplay display = eglGetCurrentDisplay();
+
+ if (display == EGL_NO_DISPLAY) {
+ nativeDisplay = XOpenDisplay(0);
+ display = eglGetDisplay(reinterpret_cast<EGLNativeDisplayType>(nativeDisplay));
+ eglInitialize(display, 0, 0);
+ }
+
+ if (display != EGL_NO_DISPLAY) {
+ String rawExtensions = reinterpret_cast<const char*>(eglQueryString(display, EGL_EXTENSIONS));
+ Vector<String> extNames;
+ rawExtensions.lower().split(" ", extNames);
+
+ if (extNames.contains("egl_khr_lock_surface"))
+ supportLockSurfaceExt = true;
+
+ extNames.clear();
+ }
+
+ return supportLockSurfaceExt;
+}
+
LayerTreeCoordinatorProxy::LayerTreeCoordinatorProxy(DrawingAreaProxy* drawingAreaProxy)
: m_drawingAreaProxy(drawingAreaProxy)
#if !ENABLE(TIZEN_WEBKIT2_TILED_AC)
: m_drawingAreaProxy(drawingAreaProxy)
{
#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
- WebLayerTreeRenderer* renderer = isGLMode ? new WebLayerTreeRendererTizen(this, drawingAreaProxy) : new WebLayerTreeRenderer(this, drawingAreaProxy, isGLMode);
+ WebLayerTreeRenderer* renderer = (isGLMode && supportsLockSurfaceExtension()) ? new WebLayerTreeRendererTizen(this, drawingAreaProxy) : new WebLayerTreeRenderer(this, drawingAreaProxy, isGLMode);
m_renderer = adoptRef(renderer);
#else
m_renderer = adoptRef(new WebLayerTreeRenderer(this, drawingAreaProxy, isGLMode));
#if ENABLE(TIZEN_RUNTIME_BACKEND_SELECTION)
#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
- dispatchUpdate(bind(&WebLayerTreeRenderer::updateTileWithUpdateInfo, m_renderer.get(), layerID, tileID, WebLayerTreeRenderer::TileUpdate(updateInfo.updateRect, targetRect, surface, updateInfo.surfaceOffset, updateInfo.platformSurfaceID, updateInfo.platformSurfaceSize)));
-#else
- dispatchUpdate(bind(&WebLayerTreeRenderer::updateTileWithUpdateInfo, m_renderer.get(), layerID, tileID, WebLayerTreeRenderer::TileUpdate(updateInfo.updateRect, targetRect, surface, updateInfo.surfaceOffset)));
+ if (m_renderer->isUsingPlatformSurface())
+ dispatchUpdate(bind(&WebLayerTreeRenderer::updateTileWithUpdateInfo, m_renderer.get(), layerID, tileID, WebLayerTreeRenderer::TileUpdate(updateInfo.updateRect, targetRect, surface, updateInfo.surfaceOffset, updateInfo.platformSurfaceID, updateInfo.platformSurfaceSize)));
+ else
#endif
+ dispatchUpdate(bind(&WebLayerTreeRenderer::updateTileWithUpdateInfo, m_renderer.get(), layerID, tileID, WebLayerTreeRenderer::TileUpdate(updateInfo.updateRect, targetRect, surface, updateInfo.surfaceOffset)));
#else
#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
- dispatchUpdate(bind(&WebLayerTreeRenderer::updatePlatformSurfaceTile, m_renderer.get(), layerID, tileID, updateInfo.updateRect, updateInfo.platformSurfaceID, updateInfo.platformSurfaceSize));
-#else
- dispatchUpdate(bind(&WebLayerTreeRenderer::updateTile, m_renderer.get(), layerID, tileID, WebLayerTreeRenderer::TileUpdate(updateInfo.updateRect, targetRect, surface, updateInfo.surfaceOffset)));
+ if (m_renderer->isUsingPlatformSurface())
+ dispatchUpdate(bind(&WebLayerTreeRenderer::updatePlatformSurfaceTile, m_renderer.get(), layerID, tileID, updateInfo.updateRect, updateInfo.platformSurfaceID, updateInfo.platformSurfaceSize));
+ else
#endif
+ dispatchUpdate(bind(&WebLayerTreeRenderer::updateTile, m_renderer.get(), layerID, tileID, WebLayerTreeRenderer::TileUpdate(updateInfo.updateRect, targetRect, surface, updateInfo.surfaceOffset)));
#endif
}
int platformSurfaceID;
WebCore::IntSize platformSurfaceSize;
TileUpdate(const WebCore::IntRect& source, const WebCore::IntRect& target, PassRefPtr<ShareableSurface> newSurface, const WebCore::IntPoint& newOffset, int pmID, WebCore::IntSize pmSize)
-#else
- TileUpdate(const WebCore::IntRect& source, const WebCore::IntRect& target, PassRefPtr<ShareableSurface> newSurface, const WebCore::IntPoint& newOffset)
-#endif
: sourceRect(source)
, targetRect(target)
, surface(newSurface)
, offset(newOffset)
-#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
, platformSurfaceID(pmID)
, platformSurfaceSize(pmSize)
+ {
+ }
+
#endif
+ TileUpdate(const WebCore::IntRect& source, const WebCore::IntRect& target, PassRefPtr<ShareableSurface> newSurface, const WebCore::IntPoint& newOffset)
+ : sourceRect(source)
+ , targetRect(target)
+ , surface(newSurface)
+ , offset(newOffset)
{
}
};
+
WebLayerTreeRenderer(LayerTreeCoordinatorProxy*);
virtual ~WebLayerTreeRenderer();
void updateTile(WebLayerID, int, const TileUpdate&);
#if ENABLE(TIZEN_RUNTIME_BACKEND_SELECTION)
virtual void updateTileWithUpdateInfo(WebLayerID, int, const TileUpdate&);
- virtual bool isUsingPlatformSurface() { return false; }
#endif
TIZEN_VIRTUAL void flushLayerChanges();
#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
virtual void freePlatformSurface() { }
virtual bool hasPlatformSurfaceToFree() { return false; }
-
+ virtual bool isUsingPlatformSurface() { return false; }
virtual void updatePlatformSurfaceTile(WebLayerID, int tileID, const WebCore::IntRect& sourceRect, int platformSurfaceID, const WebCore::IntSize& pixplatformSurfaceSizemapSize) { }
#endif
#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)