• kylechar's avatar
    Switch SoftwareRenderer to use tryAllocPixels() · 0876d796
    kylechar authored
    SkBitmap allocations were using allocPixels() which will crash on OOM.
    In order to indicate the crash is due to OOM use tryAllocPixels() and
    then call base::TerminateBecauseOutOfMemory() on failure. This will
    improve crash reports.
    
    If SkBitmap allocation fails for a CopyOutputRequest we can handle the
    OOM gracefully, since the caller has to be able to handle failed
    requests regardless.
    
    Bug: 995411
    Change-Id: Ifad190badca49c948e5ae612dd33df39ef5923f7
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1993667Reviewed-by: default avatarweiliangc <weiliangc@chromium.org>
    Commit-Queue: kylechar <kylechar@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#730243}
    0876d796
software_renderer.cc 37.3 KB