• Mario Bianucci's avatar
    Keep mask bounds expanded to edges of div to fully mask dest_rect. · 468c8890
    Mario Bianucci authored
    Mask execution closely follows background execution, which results in the
    size of the mask being reduced to the exact size requested, rather than
    filling out the dest_rect in BackgroundImageGeography::SetNoRepeatX and
    ::SetNoRepeatY. This CL puts the mask in the correct location, then
    when we are creating the shader in image.cc, if the mask doesn't fill
    out the dest_rect, decal tilemode is used to fill the rest with
    transparency, which allows the mask to fill the full area.
    
    Regarding the change to the fast/backgrounds/mask-composite.html test:
    This change results in the original test failing, displaying the same
    thing that it displays when using source-out. Based on my understanding
    of how the 'copy' Porter-Duff keyword works, I believe this is correct
    and that the test previously had an incorrect baseline because of this
    bug. My understanding is that, if mask-composite is 'copy', then regardless
    of the number of masks, only the first one will be displayed. The PD
    definition of copy is that only the source mask is displayed, and since
    this would be applied starting from the last two masks listed, moving up
    to the first two, the end result is that only the first mask is displayed.
    And, since this matches what happens when mask-composite:source-out is
    used (and matches Edge and Firefox using 'subtract'), I just changed it
    to a likely more commonly used keyword.
    
    Bug: 917067
    Change-Id: Ic9174ea67d92abe6b78acf9b7f2640796d30d249
    Reviewed-on: https://chromium-review.googlesource.com/c/1447261
    Commit-Queue: Mario Bianucci <mabian@microsoft.com>
    Reviewed-by: default avatarFlorin Malita <fmalita@chromium.org>
    Reviewed-by: default avatarFredrik Söderquist <fs@opera.com>
    Cr-Commit-Position: refs/heads/master@{#630004}
    468c8890
mask-not-clipped-expected.html 471 Bytes