bool ImageBuffer::lockSurface() const
{
- static EGLint lockAttrib[] = { EGL_LOCK_USAGE_HINT_KHR, EGL_WRITE_SURFACE_BIT_KHR, EGL_NONE };
- return EGLHelper::lockSurface(m_offScreenSurface->drawable(), lockAttrib);
+ return m_offScreenSurface->lockSurface();
}
bool ImageBuffer::unlockSurface() const
{
- return EGLHelper::unlockSurface(m_offScreenSurface->drawable());
+ return m_offScreenSurface->unlockSurface();
}
PassRefPtr<cairo_surface_t> ImageBuffer::querySurface() const
if (vendorNeedsMakeCurrent())
makeContextCurrent();
- static EGLint lockAttrib[] = { EGL_LOCK_USAGE_HINT_KHR, EGL_WRITE_SURFACE_BIT_KHR, EGL_NONE };
- return EGLHelper::lockSurface(m_offScreenSurface->drawable(), lockAttrib);
+ return m_offScreenSurface->lockSurface();
}
bool SharedPlatformSurfaceTizen::unlockSurface()
{
- return EGLHelper::unlockSurface(m_offScreenSurface->drawable());
+ return m_offScreenSurface->unlockSurface();
}
bool SharedPlatformSurfaceTizen::querySurface(int** value)
#include "config.h"
#include "GLPlatformSurface.h"
-#if USE(ACCELERATED_COMPOSITING)
+#if USE(ACCELERATED_COMPOSITING) || ENABLE(TIZEN_CANVAS_GRAPHICS_SURFACE)
#include "GraphicsContext.h"
m_currentDrawable = this;
}
+GLPlatformSurface* GLPlatformSurface::getCurrent()
+{
+ return m_currentDrawable;
+}
+
void GLPlatformSurface::updateContents(const uint32_t)
{
}
return GLPlatformSurface::Default;
}
+bool GLPlatformSurface::lockSurface()
+{
+ return false;
+}
+
+bool GLPlatformSurface::unlockSurface()
+{
+ return false;
+}
+
}
#endif
#ifndef GLPlatformSurface_h
#define GLPlatformSurface_h
-#if USE(ACCELERATED_COMPOSITING)
+#if USE(ACCELERATED_COMPOSITING) || ENABLE(TIZEN_CANVAS_GRAPHICS_SURFACE)
#include "GLDefs.h"
#include "IntRect.h"
virtual void destroy();
+ virtual bool lockSurface();
+ virtual bool unlockSurface();
+
+ static GLPlatformSurface* getCurrent();
+
protected:
GLPlatformSurface();
#include "config.h"
#include "EGLXSurface.h"
-#if PLATFORM(X11) && USE(EGL)
+#if PLATFORM(X11) && (USE(EGL) || ENABLE(TIZEN_CANVAS_GRAPHICS_SURFACE))
#include "GLPlatformContext.h"
#include "EGLConfigSelector.h"
}
}
+bool EGLPixmapSurface::lockSurface()
+{
+ if (!(m_configSelector->attributes() & GLPlatformSurface::Lockable))
+ return false;
+
+ static EGLint lockAttrib[] = { EGL_LOCK_USAGE_HINT_KHR, EGL_WRITE_SURFACE_BIT_KHR, EGL_NONE };
+ return EGLHelper::lockSurface(m_drawable, lockAttrib);
+}
+
+bool EGLPixmapSurface::unlockSurface()
+{
+ if (!(m_configSelector->attributes() & GLPlatformSurface::Lockable))
+ return false;
+
+ return EGLHelper::unlockSurface(m_drawable);
+}
+
EGLTextureFromPixmap::EGLTextureFromPixmap(const NativePixmap handle, bool hasAlpha, EGLConfig config)
: m_eglImage(0)
, m_surface(EGL_NO_SURFACE)
#ifndef EGLXSurface_h
#define EGLXSurface_h
-#if PLATFORM(X11) && USE(EGL)
+#if PLATFORM(X11) && (USE(EGL) || ENABLE(TIZEN_CANVAS_GRAPHICS_SURFACE))
#include "EGLSurface.h"
#include "X11Helper.h"
EGLPixmapSurface(const IntSize&, GLPlatformSurface::SurfaceAttributes);
virtual ~EGLPixmapSurface();
virtual void destroy() OVERRIDE;
+ virtual bool lockSurface() OVERRIDE;
+ virtual bool unlockSurface() OVERRIDE;
};
class EGLTextureFromPixmap {