Exemplo n.º 1
0
bool CoordinatedLayerTreeHost::createUpdateAtlas(uint32_t atlasID, PassRefPtr<CoordinatedSurface> coordinatedSurface)
{
    WebCoordinatedSurface* webCoordinatedSurface = static_cast<WebCoordinatedSurface*>(coordinatedSurface.get());
    WebCoordinatedSurface::Handle handle;
    if (!webCoordinatedSurface->createHandle(handle))
        return false;
    m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::CreateUpdateAtlas(atlasID, handle));
    return true;
}
Exemplo n.º 2
0
bool CoordinatedLayerTreeHost::updateImageBacking(CoordinatedImageBackingID imageID, PassRefPtr<CoordinatedSurface> coordinatedSurface)
{
    m_shouldSyncFrame = true;
    WebCoordinatedSurface* webCoordinatedSurface = static_cast<WebCoordinatedSurface*>(coordinatedSurface.get());
    WebCoordinatedSurface::Handle handle;
    if (!webCoordinatedSurface->createHandle(handle))
        return false;

    m_state.imagesToUpdate.append(std::make_pair(imageID, coordinatedSurface));
    return true;
}
static void encodeCoordinatedSurface(ArgumentEncoder& encoder, const RefPtr<CoordinatedSurface>& surface)
{
    bool isValidSurface = false;
    if (!surface) {
        encoder << isValidSurface;
        return;
    }

    WebCoordinatedSurface* webCoordinatedSurface = static_cast<WebCoordinatedSurface*>(surface.get());
    WebCoordinatedSurface::Handle handle;
    if (webCoordinatedSurface->createHandle(handle))
        isValidSurface = true;

    encoder << isValidSurface;

    if (isValidSurface)
        encoder << handle;
}