• Xida Chen's avatar
    [OT-PW] Make entries in PaintWorkletImageCache ref counted · 40ba8a25
    Xida Chen authored
    Currently, the PaintWorkletImageCache keeps a hashmap from
    PaintWorkletInput to a PaintRecord. The problem is that the PaintRecord
    could be used by multiple tiles for rasterization, while the main
    thread might be trying to purge the cache.
    
    This CL makes the PaintRecord ref counted. Whenever a tile is using it
    for rasterization, the counter will increment. When the rasterization
    is done, the counter will decrement.
    
    Bug: 907897
    Change-Id: Idaf1a1f191c084b7531c3a17e5163288e8ba1d4b
    Reviewed-on: https://chromium-review.googlesource.com/c/1439761Reviewed-by: default avatarvmpstr <vmpstr@chromium.org>
    Commit-Queue: Xida Chen <xidachen@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#626872}
    40ba8a25
paint_worklet_image_cache_unittest.cc 3.35 KB