GLPlatformSurface.cpp [plain text]
#include "config.h"
#include "GLPlatformSurface.h"
#if USE(ACCELERATED_COMPOSITING)
#if USE(GLX)
#include "GLXSurface.h"
#endif
#if USE(EGL)
#include "EGLSurface.h"
#endif
#include "NotImplemented.h"
namespace WebCore {
static GLPlatformSurface* m_currentDrawable = 0;
PassOwnPtr<GLPlatformSurface> GLPlatformSurface::createOffScreenSurface(SurfaceAttributes attributes)
{
OwnPtr<GLPlatformSurface> surface;
#if USE(GLX)
surface = adoptPtr(new GLXOffScreenSurface(attributes));
#else
surface = EGLOffScreenSurface::createOffScreenSurface(attributes);
#endif
if (surface && surface->drawable())
return surface.release();
return nullptr;
}
GLPlatformSurface::GLPlatformSurface(SurfaceAttributes)
: m_sharedDisplay(0)
, m_drawable(0)
, m_bufferHandle(0)
{
}
GLPlatformSurface::~GLPlatformSurface()
{
if (m_currentDrawable == this)
m_currentDrawable = 0;
}
PlatformBufferHandle GLPlatformSurface::handle() const
{
return m_bufferHandle;
}
PlatformDrawable GLPlatformSurface::drawable() const
{
return m_drawable;
}
const IntRect& GLPlatformSurface::geometry() const
{
return m_rect;
}
PlatformDisplay GLPlatformSurface::sharedDisplay() const
{
return m_sharedDisplay;
}
PlatformSurfaceConfig GLPlatformSurface::configuration()
{
return 0;
}
void GLPlatformSurface::swapBuffers()
{
notImplemented();
}
bool GLPlatformSurface::isCurrentDrawable() const
{
return m_currentDrawable == this;
}
void GLPlatformSurface::onMakeCurrent()
{
m_currentDrawable = this;
}
void GLPlatformSurface::updateContents(const uint32_t)
{
}
void GLPlatformSurface::setGeometry(const IntRect&)
{
}
void GLPlatformSurface::destroy()
{
if (m_currentDrawable == this)
m_currentDrawable = 0;
}
GLPlatformSurface::SurfaceAttributes GLPlatformSurface::attributes() const
{
return GLPlatformSurface::Default;
}
}
#endif