• Adrienne Walker's avatar
    Create per color space canvas image decode cache · e0c4b6ad
    Adrienne Walker authored
    Currently, cc image decode caches support multiple color spaces in the
    same decode cache.  However, during rasterization there is only one
    color space.  Additionally, each canvas that uses an image decode cache
    in Blink also has only one color space (and there is only one canvas
    active at once).
    
    This patch is in support of that goal, by refactoring the canvas image
    provider to use one image decode cache per color space (split in two
    places because of provider dependency issues for gpu).  Once this is
    done, then color space can be moved from cc::DrawImage to the image
    decode cache.
    
    Although there are now multiple active image decode caches, after
    the use of each one they clean up and unlock all decodes via the
    CanvasResourceProvider::CleanupLockedImages function.  This is posted
    as a task, so it's possible that if there are multiple canvases
    being rastered to with multiple color spaces that there may be a
    higher watermark of memory usage before the cleanup tasks run.
    This patch punts on this possibility for now.
    
    Bug: 902022
    Change-Id: I2a079c4ae9383986dffd6939f7ab31a5a45ed196
    Reviewed-on: https://chromium-review.googlesource.com/c/1315962
    Commit-Queue: enne <enne@chromium.org>
    Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
    Reviewed-by: default avatarKhushal <khushalsagar@chromium.org>
    Reviewed-by: default avatarFernando Serboncini <fserb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#605557}
    e0c4b6ad
webgraphicscontext3d_provider_impl.cc 3.86 KB