Exemplo n.º 1
0
unsigned Canvas2DLayerBridge::prepareTexture(WebTextureUpdater& updater)
{
#if ENABLE(CANVAS_USES_MAILBOX)
    ASSERT_NOT_REACHED();
    return 0;
#else
    m_context->makeContextCurrent();

    TRACE_EVENT0("cc", "Canvas2DLayerBridge::SkCanvas::flush");
    m_canvas->flush();
    m_context->flush();

    // Notify skia that the state of the backing store texture object will be touched by the compositor
    GrRenderTarget* renderTarget = reinterpret_cast<GrRenderTarget*>(m_canvas->getDevice()->accessRenderTarget());
    if (renderTarget) {
        GrTexture* texture = renderTarget->asTexture();
        texture->invalidateCachedState();
        return texture->getTextureHandle();
    }
    return 0;
#endif  // !ENABLE(CANVAS_USES_MAILBOX)
}