Skip to content
  • Adrienne Walker's avatar
    Add explicit clip to compositing display items · e3d9eee9
    Adrienne Walker authored
    SkCanvas::saveLayer(Alpha) which is indirectly generated by
    CompositingDisplayItem takes an optional bounds as a hint for the size
    of the backing that is used as an indirect offscreen texture for the
    saveLayer.  This acts as an implicit clip, but Skia is free to make
    this as large as possible or drop the clip.  PaintOpBuffer in particular
    has some optimizations that sometimes drop the bounds when trying to
    fold together saveLayer/draw/restore into a single draw with alpha.
    
    This patch makes it so that any CompositingDisplayItem that provides
    a clip has its content explicitly clipped.  This prevents optimizations
    inside of PaintOpBuffer that would remove the save/restore generated
    by the CompositingDisplayItem but prevents any accidental painting
    outside of display item bounds.
    
    Bug: 750252
    Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
    Change-Id: Ic651c35e1ce865f3008dd345952a6fbc97d94740
    Reviewed-on: https://chromium-review.googlesource.com/596503
    
    
    Commit-Queue: enne <enne@chromium.org>
    Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#491915}
    e3d9eee9