PlatformPathOpenVG::~PlatformPathOpenVG()
{
    makeCompatibleContextCurrent();

    vgDestroyPath(m_vgPath);
    ASSERT_VG_NO_ERROR();
}
void PlatformPathOpenVG::clear()
{
    makeCompatibleContextCurrent();

    vgClearPath(m_vgPath, WEBKIT_VG_PATH_CAPABILITIES);
    ASSERT_VG_NO_ERROR();

    m_subpathStartPoint.setX(0);
    m_subpathStartPoint.setY(0);
    m_currentPoint = m_subpathStartPoint;
}
Beispiel #3
0
void TiledImageOpenVG::destroyTiles()
{
    makeCompatibleContextCurrent();

    Vector<VGImage>::const_iterator it = m_tiles.begin();
    Vector<VGImage>::const_iterator end = m_tiles.end();

    for (; it != end; ++it) {
        if (*it != VG_INVALID_HANDLE)
            vgDestroyImage(*it);
    }
    ASSERT_VG_NO_ERROR();

    m_tiles.fill(VG_INVALID_HANDLE);
}
void PlatformPathOpenVG::flushPathDataBuffer() const
{
    if (!m_commandBuffer.size())
        return;

    makeCompatibleContextCurrent();

    // If we have a single VG_CLOSE_PATH buffered, the coordinate buffer is
    // empty. The coordinate pointer must not be 0, and we can't rely on
    // zero-size arrays (certain compilers don't create them, Vector might
    // store it differently). Certain OpenVG implementations check the
    // validity for the memory address and change it to zero if it's
    // in invalid one. So in the end, let's use a dummy value's address here.
    static VGfloat zeroSizeCoordinateDummy = 0.0;
    const VGfloat* coords = m_coordinateBuffer.isEmpty()
        ? &zeroSizeCoordinateDummy
        : m_coordinateBuffer.data();

    vgAppendPathData(m_vgPath, m_commandBuffer.size(), m_commandBuffer.data(), coords);
    ASSERT_VG_NO_ERROR();

    m_commandBuffer.clear();
    m_coordinateBuffer.clear();
}