• Xida Chen's avatar
    Fix a crash PaintWorkletImageProvider::GetPaintRecordResult · 01ceb784
    Xida Chen authored
    The root cause of this crash is:
    At DiscardableImageMap::GatherDiscardableImages, we got early
    exist when the PaintOp::ComputePaintRect. The early out makes
    sense because there is nothing to paint if the paint rect is
    empty.
    Due to the above early out, the |paint_worklet_records_| in the
    PictureLayerImpl is empty. But later on at
    DrawImageRectOp::RasterWithFlags, we do not have the same
    check using PaintOp::ComputePaintRect, so it will try to look
    for the RasterContent in the |paint_worklet_records_|.
    
    The solution is that at DrawImageRectOp::RasterWithFlags, if
    the PaintOp::ComputePaintRect is empty, we should just early
    return because there is nothing to paint, so no paint record
    at all.
    
    Bug: 1095163, 1156955
    Change-Id: Ic46636cfe7c256f58261430e07c9ff3a9efa6c80
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2570548
    Commit-Queue: Xida Chen <xidachen@chromium.org>
    Reviewed-by: default avatarKhushal <khushalsagar@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#835369}
    01ceb784
composite-after-paint 3.66 KB