GLPlatformSurface.cpp [plain text]
#include "config.h"
#if ENABLE(GRAPHICS_CONTEXT_3D)
#include "GLPlatformSurface.h"
#if USE(GLX)
#include "GLXSurface.h"
#endif
#if USE(EGL)
#include "EGLSurface.h"
#endif
#include "NotImplemented.h"
namespace WebCore {
std::unique_ptr<GLPlatformSurface> GLPlatformSurface::createOffScreenSurface(SurfaceAttributes attributes)
{
std::unique_ptr<GLPlatformSurface> surface;
#if USE(GLX)
surface = std::make_unique<GLXOffScreenSurface>(attributes);
#elif USE(EGL) && USE(GRAPHICS_SURFACE)
surface = EGLOffScreenSurface::createOffScreenSurface(attributes);
#else
notImplemented();
#endif
if (surface && surface->drawable())
return surface;
return nullptr;
}
GLPlatformSurface::GLPlatformSurface(SurfaceAttributes)
: m_drawable(0)
, m_bufferHandle(0)
{
}
GLPlatformSurface::~GLPlatformSurface()
{
}
PlatformBufferHandle GLPlatformSurface::handle() const
{
return m_bufferHandle;
}
PlatformDrawable GLPlatformSurface::drawable() const
{
return m_drawable;
}
const IntRect& GLPlatformSurface::geometry() const
{
return m_rect;
}
PlatformSurfaceConfig GLPlatformSurface::configuration()
{
return 0;
}
void GLPlatformSurface::swapBuffers()
{
notImplemented();
}
void GLPlatformSurface::onMakeCurrent()
{
}
void GLPlatformSurface::updateContents(const uint32_t)
{
}
void GLPlatformSurface::setGeometry(const IntRect&)
{
}
void GLPlatformSurface::destroy()
{
}
GLPlatformSurface::SurfaceAttributes GLPlatformSurface::attributes() const
{
return GLPlatformSurface::Default;
}
}
#endif