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

Issue 2667363004: Fix the painting of document markers under zoom and variable DPI (Closed)

Created:
3 years, 10 months ago by Stephen Chennney
Modified:
3 years, 10 months ago
Reviewers:
f(malita)
CC:
chromium-reviews, krit, drott+blinkwatch_chromium.org, blink-reviews-platform-graphics_chromium.org, Stephen Chennney, dshwang, pdr+graphicswatchlist_chromium.org, jbroman, Justin Novosad, Rik, blink-reviews-paint_chromium.org, blink-reviews, kinuko+watch, ajuma+watch_chromium.org, danakj+watch_chromium.org, rwlbuis
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix the painting of document markers under zoom and variable DPI The painting of document markers does not take into account zoom or DPI settings. We do create different sized bitmaps for high DPI, but we then scale that out to draw always at the same size. This patch re-writes the document markers sizing code to scale the marker with zoom (as the text scales) and to otherwise simplify the code. New tests for document marker painting are added. They cover various zoom factors. R=fmalita@chromium.org BUG=686792 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Review-Url: https://codereview.chromium.org/2667363004 Cr-Commit-Position: refs/heads/master@{#448414} Committed: https://chromium.googlesource.com/chromium/src/+/d3c22e5c574de5ee276228227967029608f4fb3c

Patch Set 1 #

Patch Set 2 : Fix comment #

Patch Set 3 : New baselines #

Total comments: 2

Patch Set 4 : Add zoom when deciding on the bitmap to use. #

Patch Set 5 : New baselines #

Total comments: 2

Patch Set 6 : New baselines and nit fix #

Patch Set 7 : Rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+328 lines, -25 lines) Patch
A third_party/WebKit/LayoutTests/paint/spellmarkers/document-markers.html View 1 chunk +21 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/spellmarkers/document-markers-zoom-125.html View 1 chunk +24 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/spellmarkers/document-markers-zoom-150.html View 1 chunk +24 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/spellmarkers/document-markers-zoom-175.html View 1 chunk +24 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/spellmarkers/document-markers-zoom-200.html View 1 chunk +24 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/paint/spellmarkers/document-markers-zoom-250.html View 1 chunk +24 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/platform/linux/editing/spelling/grammar-markers-hidpi-expected.png View 1 2 3 4 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/platform/linux/editing/spelling/inline-spelling-markers-hidpi-composited-expected.png View 1 2 3 4 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/platform/linux/editing/spelling/inline-spelling-markers-hidpi-expected.png View 1 2 3 4 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/platform/linux/paint/spellmarkers/document-markers-expected.png View 1 2 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/platform/linux/paint/spellmarkers/document-markers-expected.txt View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/platform/linux/paint/spellmarkers/document-markers-zoom-125-expected.png View 1 2 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/platform/linux/paint/spellmarkers/document-markers-zoom-125-expected.txt View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/platform/linux/paint/spellmarkers/document-markers-zoom-150-expected.png View 1 2 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/platform/linux/paint/spellmarkers/document-markers-zoom-150-expected.txt View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/platform/linux/paint/spellmarkers/document-markers-zoom-175-expected.png View 1 2 3 4 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/platform/linux/paint/spellmarkers/document-markers-zoom-175-expected.txt View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/platform/linux/paint/spellmarkers/document-markers-zoom-200-expected.png View 1 2 3 4 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/platform/linux/paint/spellmarkers/document-markers-zoom-200-expected.txt View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/platform/linux/paint/spellmarkers/document-markers-zoom-250-expected.png View 1 2 3 4 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/platform/linux/paint/spellmarkers/document-markers-zoom-250-expected.txt View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/platform/mac/editing/spelling/inline-spelling-markers-hidpi-composited-expected.png View 1 2 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/platform/mac/editing/spelling/inline-spelling-markers-hidpi-expected.png View 1 2 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/platform/mac/editing/spelling/inline_spelling_markers-expected.png View 1 2 3 4 5 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/platform/mac/paint/spellmarkers/document-markers-expected.png View 1 2 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/platform/mac/paint/spellmarkers/document-markers-expected.txt View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/platform/mac/paint/spellmarkers/document-markers-zoom-125-expected.png View 1 2 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/platform/mac/paint/spellmarkers/document-markers-zoom-125-expected.txt View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/platform/mac/paint/spellmarkers/document-markers-zoom-150-expected.png View 1 2 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/platform/mac/paint/spellmarkers/document-markers-zoom-150-expected.txt View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/platform/mac/paint/spellmarkers/document-markers-zoom-175-expected.png View 1 2 3 4 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/platform/mac/paint/spellmarkers/document-markers-zoom-175-expected.txt View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/platform/mac/paint/spellmarkers/document-markers-zoom-200-expected.png View 1 2 3 4 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/platform/mac/paint/spellmarkers/document-markers-zoom-200-expected.txt View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/platform/mac/paint/spellmarkers/document-markers-zoom-250-expected.png View 1 2 3 4 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/platform/mac/paint/spellmarkers/document-markers-zoom-250-expected.txt View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/platform/win/editing/spelling/grammar-markers-hidpi-expected.png View 1 2 3 4 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/platform/win/editing/spelling/inline-spelling-markers-hidpi-composited-expected.png View 1 2 3 4 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/platform/win/editing/spelling/inline-spelling-markers-hidpi-expected.png View 1 2 3 4 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/platform/win/paint/spellmarkers/document-markers-expected.png View 1 2 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/platform/win/paint/spellmarkers/document-markers-expected.txt View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/platform/win/paint/spellmarkers/document-markers-zoom-125-expected.png View 1 2 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/platform/win/paint/spellmarkers/document-markers-zoom-125-expected.txt View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/platform/win/paint/spellmarkers/document-markers-zoom-150-expected.png View 1 2 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/platform/win/paint/spellmarkers/document-markers-zoom-150-expected.txt View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/platform/win/paint/spellmarkers/document-markers-zoom-175-expected.png View 1 2 3 4 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/platform/win/paint/spellmarkers/document-markers-zoom-175-expected.txt View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/platform/win/paint/spellmarkers/document-markers-zoom-200-expected.png View 1 2 3 4 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/platform/win/paint/spellmarkers/document-markers-zoom-200-expected.txt View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/platform/win/paint/spellmarkers/document-markers-zoom-250-expected.png View 1 2 3 4 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/platform/win/paint/spellmarkers/document-markers-zoom-250-expected.txt View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp View 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/GraphicsContext.h View 1 2 3 5 6 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp View 1 2 3 4 5 6 4 chunks +21 lines, -23 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 32 (22 generated)
Stephen Chennney
Waiting on new test baselines, but otherwise fixes the issue and cleans up some poor ...
3 years, 10 months ago (2017-02-02 16:41:32 UTC) #1
f(malita)
https://codereview.chromium.org/2667363004/diff/40001/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp File third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp (right): https://codereview.chromium.org/2667363004/diff/40001/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp#newcode527 third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp:527: deviceScaleFactor == 2 ? misspellBitmap2x : misspellBitmap1x; Looks like ...
3 years, 10 months ago (2017-02-03 15:53:55 UTC) #13
Stephen Chennney
https://codereview.chromium.org/2667363004/diff/40001/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp File third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp (right): https://codereview.chromium.org/2667363004/diff/40001/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp#newcode527 third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp:527: deviceScaleFactor == 2 ? misspellBitmap2x : misspellBitmap1x; On 2017/02/03 ...
3 years, 10 months ago (2017-02-03 16:27:45 UTC) #14
f(malita)
On 2017/02/03 16:27:45, Stephen Chennney wrote: > I also thought of moving away from the ...
3 years, 10 months ago (2017-02-03 16:37:42 UTC) #15
f(malita)
lgtm https://codereview.chromium.org/2667363004/diff/80001/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp File third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp (right): https://codereview.chromium.org/2667363004/diff/80001/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp#newcode618 third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp:618: float dotCount = floor(width / rowPixels); nit: floorf
3 years, 10 months ago (2017-02-06 14:39:12 UTC) #20
Stephen Chennney
Thanks. Now lets hope the baselines are right. https://codereview.chromium.org/2667363004/diff/80001/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp File third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp (right): https://codereview.chromium.org/2667363004/diff/80001/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp#newcode618 third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp:618: float ...
3 years, 10 months ago (2017-02-06 15:53:09 UTC) #21
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/2667363004/100001
3 years, 10 months ago (2017-02-06 15:53:49 UTC) #24
commit-bot: I haz the power
Failed to apply patch for third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp: While running git apply --index -p1; error: patch failed: ...
3 years, 10 months ago (2017-02-06 17:30:22 UTC) #26
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/2667363004/120001
3 years, 10 months ago (2017-02-06 18:52:30 UTC) #29
commit-bot: I haz the power
3 years, 10 months ago (2017-02-06 22:26:06 UTC) #32
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/d3c22e5c574de5ee276228227967...

Powered by Google App Engine
This is Rietveld 408576698