Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(430)

Issue 2878573003: Initial skeleton of high-contrast mode. (Closed)

Created:
3 years, 7 months ago by dmazzoni
Modified:
3 years, 6 months ago
CC:
blink-layers+watch_chromium.org, blink-reviews, blink-reviews-frames_chromium.org, blink-reviews-platform-graphics_chromium.org, Rik, chromium-reviews, dshwang, drott+blinkwatch_chromium.org, krit, fmalita+watch_chromium.org, Justin Novosad, kinuko+watch, pdr+graphicswatchlist_chromium.org, rwlbuis, Stephen Chennney
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Initial 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+377 lines, -16 lines) Patch
M third_party/WebKit/LayoutTests/VirtualTestSuites View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/high-contrast-mode/text-on-backgrounds.html View 1 chunk +61 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/high-contrast-mode/text-on-backgrounds-expected.png View Binary file 0 comments Download
A third_party/WebKit/LayoutTests/paint/high-contrast-mode/text-on-backgrounds-expected.txt View 1 chunk +4 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/virtual/high-contrast-mode/paint/high-contrast-mode/README.txt View 1 chunk +3 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/virtual/high-contrast-mode/paint/high-contrast-mode/text-on-backgrounds-expected.png View Binary file 0 comments Download
M third_party/WebKit/Source/core/frame/LocalFrameView.cpp View 1 2 3 4 5 6 7 8 1 chunk +9 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/Settings.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/Settings.json5 View 1 2 3 1 chunk +18 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp View 1 2 3 4 5 6 7 8 1 chunk +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/GraphicsContext.h View 1 2 3 4 5 5 chunks +13 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp View 1 2 3 4 5 6 7 8 18 chunks +85 lines, -15 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/GraphicsContextTest.cpp View 1 2 3 4 5 3 chunks +138 lines, -1 line 0 comments Download
A third_party/WebKit/Source/platform/graphics/HighContrastSettings.h View 1 2 3 4 5 1 chunk +27 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/paint/PaintRecordBuilder.cpp View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 51 (36 generated)
dmazzoni
Ready for review, PTAL when you have a chance. As previously discussed, applying the color ...
3 years, 7 months ago (2017-05-11 18:10:42 UTC) #4
chrishtr
https://codereview.chromium.org/2878573003/diff/1/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp File third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp (right): https://codereview.chromium.org/2878573003/diff/1/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp#newcode145 third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp:145: void GraphicsContext::SetHighContrast(const HighContrastSettings& settings) { PaintRecordBuilder, and a couple ...
3 years, 6 months ago (2017-06-01 04:10:51 UTC) #7
dmazzoni
https://codereview.chromium.org/2878573003/diff/1/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp File third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp (right): https://codereview.chromium.org/2878573003/diff/1/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp#newcode145 third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp:145: void GraphicsContext::SetHighContrast(const HighContrastSettings& settings) { On 2017/06/01 04:10:51, chrishtr ...
3 years, 6 months ago (2017-06-01 21:44:02 UTC) #9
chrishtr
https://codereview.chromium.org/2878573003/diff/1/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp File third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp (right): https://codereview.chromium.org/2878573003/diff/1/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp#newcode145 third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp:145: void GraphicsContext::SetHighContrast(const HighContrastSettings& settings) { On 2017/06/01 at 21:44:01, ...
3 years, 6 months ago (2017-06-02 21:12:30 UTC) #13
dmazzoni
On 2017/06/02 21:12:30, chrishtr wrote: > Do you care about anything except the mainline case ...
3 years, 6 months ago (2017-06-05 15:55:37 UTC) #20
dmazzoni
Ready for a look. Also I'll be in SF today if it'd help to chat ...
3 years, 6 months ago (2017-06-05 15:56:37 UTC) #21
chrishtr
https://codereview.chromium.org/2878573003/diff/80001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp File third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp (right): https://codereview.chromium.org/2878573003/diff/80001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp#newcode3109 third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp:3109: GetLayoutObject().GetFrame()->GetSettings()); Can GetSettings ever return nullptr? If not then ...
3 years, 6 months ago (2017-06-05 16:35:19 UTC) #24
dmazzoni
https://codereview.chromium.org/2878573003/diff/80001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp File third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp (right): https://codereview.chromium.org/2878573003/diff/80001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp#newcode3109 third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp:3109: GetLayoutObject().GetFrame()->GetSettings()); On 2017/06/05 16:35:18, chrishtr wrote: > Can GetSettings ...
3 years, 6 months ago (2017-06-06 05:23:25 UTC) #26
chrishtr
lgtm
3 years, 6 months ago (2017-06-06 15:08:09 UTC) #30
dmazzoni
> > Conceptually is it fine that PaintLayerPainter::Paint() > > essentially changes the state of ...
3 years, 6 months ago (2017-06-07 18:24:53 UTC) #35
chrishtr
On 2017/06/07 at 18:24:53, dmazzoni wrote: > > > Conceptually is it fine that PaintLayerPainter::Paint() ...
3 years, 6 months ago (2017-06-07 23:57:56 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2878573003/130001
3 years, 6 months ago (2017-06-08 21:15:41 UTC) #43
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/474917)
3 years, 6 months ago (2017-06-08 22:49:20 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2878573003/150001
3 years, 6 months ago (2017-06-09 17:14:03 UTC) #48
commit-bot: I haz the power
3 years, 6 months ago (2017-06-09 19:13:27 UTC) #51
Message was sent while issue was closed.
Committed patchset #9 (id:150001) as
https://chromium.googlesource.com/chromium/src/+/36fd0123a492075ae8d6c12675ec...

Powered by Google App Engine
This is Rietveld 408576698