Clamp background tiles when possible
We're currently always drawing tiled backgrounds in repeat/repeat mode,
even if we need tiling in one dimension only.
This has the unexpected side effect of opposite edge bleed, in the
dimension which doesn't require tiling, when rasterized for hidpi
devices (DSF causing Skia to sample across the tile boundary).
Detect cases where tile repetition is not needed, and strength-reduce the
shader tile mode accordingly.
Also make Image::drawPattern() protected, as it is only used in subclasses.
BUG=
673261
R=reed@google.com,fs@opera.com,schenney@chromium.org
Committed:
https://crrev.com/a7e84a029b10a5a8c0b0faf4bda87e54187840fb
Cr-Commit-Position: refs/heads/master@{#439529}