DescriptionInitial skeleton of high-contrast mode.
Adds frame settings for high-contrast mode - one to invert colors, one
to convert to grayscale, and one to adjust contrast. Eventually these
will be controlled by the browser and remembered on a per-site basis,
like zoom.
High-contrast mode is implemented as a color filter in
GraphicsContext. Most primitive drawing operations like rects and
lines can be filtered simply by applying the color filter to the
provided color, so the performance impact is minimal. Follow-up
changes will address trickier cases like images, gradients, layers,
theme drawing, and more, plus heuristics to optionally avoid inverting
some images (such as photos or video).
For testing, introduces a virtual test suite that runs tests with
high contrast mode enabled. This patch just introduces one test, but
follow-up changes will run a subset of existing LayoutTests to ensure
broad coverage. I also intend to add an additional image_diff switch
to enable comparing inverted images with uninverted expectations, to
help quickly identify failing pixel tests without manually inspecting
output.
BUG=685242
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Review-Url: https://codereview.chromium.org/2878573003
Cr-Commit-Position: refs/heads/master@{#478362}
Committed: https://chromium.googlesource.com/chromium/src/+/36fd0123a492075ae8d6c12675ecfd58de596cfd
Patch Set 1 #
Total comments: 10
Patch Set 2 : Rebase #Patch Set 3 : Don't pass settings to GraphicsLayer, address other feedback from chrishtr #
Total comments: 2
Patch Set 4 : Rebase #Patch Set 5 : Move to CompositedLayerMapping::DoPaintTask and add unit test #
Total comments: 10
Patch Set 6 : Split unit tests into separate TESTs #Patch Set 7 : Null-check HighContrastSettings in PaintRecordBuilder #Patch Set 8 : Fix for slimming paint v2 #Patch Set 9 : Rebase #Messages
Total messages: 51 (36 generated)
|