ANGLEInstancedArrays.cpp [plain text]
#include "config.h"
#if ENABLE(WEBGL)
#include "ANGLEInstancedArrays.h"
#if PLATFORM(GTK)
#include "Extensions3D.h"
#endif
namespace WebCore {
ANGLEInstancedArrays::ANGLEInstancedArrays(WebGLRenderingContextBase& context)
: WebGLExtension(context)
{
}
ANGLEInstancedArrays::~ANGLEInstancedArrays()
{
}
WebGLExtension::ExtensionName ANGLEInstancedArrays::getName() const
{
return ANGLEInstancedArraysName;
}
bool ANGLEInstancedArrays::supported(WebGLRenderingContextBase& context)
{
#if PLATFORM(COCOA)
UNUSED_PARAM(context);
return true;
#elif PLATFORM(GTK)
return context.graphicsContext3D()->getExtensions().supports("GL_ANGLE_instanced_arrays");
#else
UNUSED_PARAM(context);
return false;
#endif
}
void ANGLEInstancedArrays::drawArraysInstancedANGLE(GC3Denum mode, GC3Dint first, GC3Dsizei count, GC3Dsizei primcount)
{
if (m_context.isContextLost())
return;
m_context.drawArraysInstanced(mode, first, count, primcount);
}
void ANGLEInstancedArrays::drawElementsInstancedANGLE(GC3Denum mode, GC3Dsizei count, GC3Denum type, long long offset, GC3Dsizei primcount)
{
if (m_context.isContextLost())
return;
m_context.drawElementsInstanced(mode, count, type, offset, primcount);
}
void ANGLEInstancedArrays::vertexAttribDivisorANGLE(GC3Duint index, GC3Duint divisor)
{
if (m_context.isContextLost())
return;
m_context.vertexAttribDivisor(index, divisor);
}
}
#endif // ENABLE(WEBGL)