Exemple #1
0
void TiledImageOpenVG::detachTiles()
{
    makeSharedContextCurrent(); // because we create new images

    int numTiles = m_tiles.size();
    VGImage newTile, originalTile;

    for (int i = 0; i < numTiles; ++i) {
        originalTile = m_tiles.at(i);

        if (originalTile == VG_INVALID_HANDLE)
            continue;

        VGImageFormat format = (VGImageFormat) vgGetParameteri(originalTile, VG_IMAGE_FORMAT);
        VGint width = vgGetParameteri(originalTile, VG_IMAGE_WIDTH);
        VGint height = vgGetParameteri(originalTile, VG_IMAGE_HEIGHT);
        ASSERT_VG_NO_ERROR();

        newTile = vgCreateImage(format, width, height, VG_IMAGE_QUALITY_FASTER);
        ASSERT_VG_NO_ERROR();

        vgCopyImage(newTile, 0, 0, originalTile, 0, 0, width, height, VG_FALSE /* dither */);
        ASSERT_VG_NO_ERROR();

        m_tiles.at(i) = newTile;
    }
}
void PlatformPathOpenVG::createPath()
{
    makeSharedContextCurrent();

    m_vgPath = vgCreatePath(
        VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F,
        1.0 /* scale */, 0.0 /* bias */,
        0 /* expected number of segments */,
        0 /* expected number of total coordinates */,
        WEBKIT_VG_PATH_CAPABILITIES);
    ASSERT_VG_NO_ERROR();
}