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

Issue 2591863003: Use nine-patch resource for drawing Aura overlay scrollbar thumb. (Closed)

Created:
4 years ago by bokan
Modified:
3 years, 9 months ago
CC:
blink-layers+watch_chromium.org, blink-reviews, blink-reviews-api_chromium.org, cc-bugs_chromium.org, chromium-reviews, darin-cc_chromium.org, dglazkov+blink, jam, kenneth.christiansen
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use nine-patch resource for drawing Aura overlay scrollbar thumb. This patch factors out the nine-patch generation from NinePatchLayer into a NinePatchGenerator and uses it to create a nine-patch scrollbar layer that can change size without a repaint. This is used only in the compositor. Scrollbars painted in Blink paint to the full required size. The new scrollbar type is implemented in OverlayScrollbarLayer and Impl. We add methods to NativeTheme to draw 9-patch versions of a theme part, currently implemented for the scrollbar thumb for overlays in NativeThemeAura. The NativeTheme provides two methods: NinePatchCanvasSize() returns the size of the smallest canvas onto which a nine patch part can be drawn. NinePatchAperture() returns the rect in the canvas, whose size is provided by the method above, which will be used as the middle patch in the resource. Resizing the part will stretch only the middle patch in both directions. This is used mainly for the thinning animation in Aura overlay scrollbars. We still need to repaint due to hover and pressed effects. Technically, we could avoid repainting on size changes too but this would require some additional work. BUG=669670 CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel Review-Url: https://codereview.chromium.org/2591863003 Cr-Commit-Position: refs/heads/master@{#454413} Committed: https://chromium.googlesource.com/chromium/src/+/e7a058aa7db4c0fc172200fd16c800ec1b94d8e6

Patch Set 1 #

Patch Set 2 : Fix build #

Patch Set 3 : Build Fix #

Patch Set 4 : Build fix #

Patch Set 5 : Reinstante painted scrollbars #

Patch Set 6 : Finish Plumbing #

Total comments: 1

Patch Set 7 : Rebase #

Patch Set 8 : Rename to painted_overlay_scrollbar_layer + rudimentary tests #

Total comments: 13

Patch Set 9 : Added pixel tests #

Patch Set 10 : Address aelias@'s review #

Total comments: 8

Patch Set 11 : Addressed jbroman@'s comments #

Patch Set 12 : Addressed sadrul@'s feedback #

Total comments: 10

Patch Set 13 : Addressed estade@'s comments #

Total comments: 2

Patch Set 14 : estade@'s feedback #

Patch Set 15 : Rebase #

Patch Set 16 : Move CheckGeometryLimitations back to where it used to be (AppendQuads) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1602 lines, -437 lines) Patch
M cc/BUILD.gn View 1 2 3 4 5 6 7 3 chunks +7 lines, -0 lines 0 comments Download
M cc/blink/scrollbar_impl.h View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M cc/blink/scrollbar_impl.cc View 1 2 3 4 5 6 1 chunk +12 lines, -0 lines 0 comments Download
M cc/blink/web_compositor_support_impl.h View 1 chunk +4 lines, -0 lines 0 comments Download
M cc/blink/web_compositor_support_impl.cc View 1 chunk +9 lines, -0 lines 0 comments Download
M cc/blink/web_scrollbar_layer_impl.h View 1 chunk +5 lines, -0 lines 0 comments Download
M cc/blink/web_scrollbar_layer_impl.cc View 1 2 3 4 5 6 7 2 chunks +13 lines, -0 lines 0 comments Download
M cc/input/scrollbar.h View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M cc/layers/nine_patch_layer_impl.h View 1 2 3 4 5 6 7 8 9 3 chunks +3 lines, -71 lines 0 comments Download
M cc/layers/nine_patch_layer_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +15 lines, -319 lines 0 comments Download
A cc/layers/painted_overlay_scrollbar_layer.h View 1 2 3 4 5 6 7 1 chunk +77 lines, -0 lines 0 comments Download
A cc/layers/painted_overlay_scrollbar_layer.cc View 1 2 3 4 5 6 7 8 9 1 chunk +173 lines, -0 lines 0 comments Download
A cc/layers/painted_overlay_scrollbar_layer_impl.h View 1 2 3 4 5 6 7 1 chunk +82 lines, -0 lines 0 comments Download
A cc/layers/painted_overlay_scrollbar_layer_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +167 lines, -0 lines 0 comments Download
A + cc/quads/nine_patch_generator.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +40 lines, -41 lines 0 comments Download
A cc/quads/nine_patch_generator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +396 lines, -0 lines 0 comments Download
A cc/quads/nine_patch_generator_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +237 lines, -0 lines 0 comments Download
A cc/test/data/overlay_scrollbar_scaled_down.png View 1 2 3 4 5 6 7 8 Binary file 0 comments Download
A cc/test/data/overlay_scrollbar_scaled_up.png View 1 2 3 4 5 6 7 8 Binary file 0 comments Download
M cc/test/fake_scrollbar.h View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M cc/test/fake_scrollbar.cc View 1 2 3 4 5 6 7 1 chunk +12 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_host_pixeltest_scrollbars.cc View 1 2 3 4 5 6 7 8 3 chunks +113 lines, -0 lines 0 comments Download
M content/child/webthemeengine_impl_default.h View 1 chunk +3 lines, -0 lines 0 comments Download
M content/child/webthemeengine_impl_default.cc View 1 chunk +15 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +10 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/exported/WebScrollbarThemeGeometryNative.h View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/exported/WebScrollbarThemeGeometryNative.cpp View 1 chunk +14 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/exported/WebScrollbarThemePainter.cpp View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/scroll/ScrollbarTheme.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +18 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.h View 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +34 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/testing/TestingPlatformSupport.h View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp View 1 2 3 4 5 6 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/public/platform/WebCompositorSupport.h View 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/public/platform/WebScrollbarThemeGeometry.h View 2 chunks +3 lines, -0 lines 0 comments Download
M third_party/WebKit/public/platform/WebScrollbarThemePainter.h View 2 chunks +4 lines, -1 line 0 comments Download
M third_party/WebKit/public/platform/WebThemeEngine.h View 2 chunks +5 lines, -2 lines 0 comments Download
M ui/native_theme/native_theme.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +16 lines, -0 lines 0 comments Download
M ui/native_theme/native_theme_aura.h View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M ui/native_theme/native_theme_aura.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +29 lines, -0 lines 0 comments Download
M ui/native_theme/native_theme_base.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M ui/native_theme/native_theme_base.cc View 1 2 3 4 5 6 7 1 chunk +14 lines, -0 lines 0 comments Download
M ui/native_theme/native_theme_win.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M ui/native_theme/native_theme_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +16 lines, -0 lines 0 comments Download
M ui/views/view_unittest.cc View 1 2 3 4 5 6 7 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 78 (47 generated)
bokan
Alexandre, when you get back, please take an initial look. The patch is big but ...
4 years ago (2016-12-21 23:36:10 UTC) #24
aelias_OOO_until_Jul13
Looks OK overall. https://codereview.chromium.org/2591863003/diff/100001/cc/layers/overlay_scrollbar_layer.h File cc/layers/overlay_scrollbar_layer.h (right): https://codereview.chromium.org/2591863003/diff/100001/cc/layers/overlay_scrollbar_layer.h#newcode18 cc/layers/overlay_scrollbar_layer.h:18: class CC_EXPORT OverlayScrollbarLayer : public ScrollbarLayerInterface, ...
3 years, 11 months ago (2017-01-04 03:22:27 UTC) #25
bokan
On 2017/01/04 03:22:27, aelias wrote: > Looks OK overall. > > https://codereview.chromium.org/2591863003/diff/100001/cc/layers/overlay_scrollbar_layer.h > File cc/layers/overlay_scrollbar_layer.h ...
3 years, 9 months ago (2017-02-28 20:15:46 UTC) #26
bokan
Resurrecting this since overlay work has restarted. I've made your suggested change and added some ...
3 years, 9 months ago (2017-02-28 20:18:38 UTC) #27
enne (OOO)
What about cc::LayerTreePixelTest? Or do you need ui/Blink as well to test the output?
3 years, 9 months ago (2017-02-28 20:22:04 UTC) #28
bokan
On 2017/02/28 20:22:04, enne wrote: > What about cc::LayerTreePixelTest? Or do you need ui/Blink as ...
3 years, 9 months ago (2017-02-28 20:30:44 UTC) #29
aelias_OOO_until_Jul13
https://codereview.chromium.org/2591863003/diff/140001/cc/layers/painted_overlay_scrollbar_layer.cc File cc/layers/painted_overlay_scrollbar_layer.cc (right): https://codereview.chromium.org/2591863003/diff/140001/cc/layers/painted_overlay_scrollbar_layer.cc#newcode113 cc/layers/painted_overlay_scrollbar_layer.cc:113: if (!host || host != layer_tree_host()) { Nit: "!host ...
3 years, 9 months ago (2017-02-28 23:23:51 UTC) #34
bokan
Comments addressed + added a pixel test as enne@ suggested. +enne@, could you comment on ...
3 years, 9 months ago (2017-03-01 00:44:23 UTC) #36
enne (OOO)
https://codereview.chromium.org/2591863003/diff/140001/cc/layers/painted_overlay_scrollbar_layer.cc File cc/layers/painted_overlay_scrollbar_layer.cc (right): https://codereview.chromium.org/2591863003/diff/140001/cc/layers/painted_overlay_scrollbar_layer.cc#newcode127 cc/layers/painted_overlay_scrollbar_layer.cc:127: base::AutoReset<bool> ignore_set_needs_commit(&ignore_set_needs_commit_, On 2017/03/01 at 00:44:21, bokan wrote: > ...
3 years, 9 months ago (2017-03-01 00:52:21 UTC) #39
aelias_OOO_until_Jul13
lgtm modulo removing commit optimization, thanks.
3 years, 9 months ago (2017-03-01 00:59:01 UTC) #40
bokan
On 2017/03/01 00:59:01, aelias wrote: > lgtm modulo removing commit optimization, thanks. Just to confirm ...
3 years, 9 months ago (2017-03-01 13:53:23 UTC) #43
bokan
+jbroman@ for WebKit/Source/Platform +nasko@ for content/child +estade@ for native_theme +sadrul@ for ui/views
3 years, 9 months ago (2017-03-01 13:56:22 UTC) #45
jbroman
Source/platform/ lgtm https://codereview.chromium.org/2591863003/diff/180001/third_party/WebKit/Source/platform/scroll/ScrollbarTheme.h File third_party/WebKit/Source/platform/scroll/ScrollbarTheme.h (right): https://codereview.chromium.org/2591863003/diff/180001/third_party/WebKit/Source/platform/scroll/ScrollbarTheme.h#newcode199 third_party/WebKit/Source/platform/scroll/ScrollbarTheme.h:199: // For a nine-patch resource, the aperture ...
3 years, 9 months ago (2017-03-01 15:27:18 UTC) #46
sadrul
https://codereview.chromium.org/2591863003/diff/180001/ui/native_theme/native_theme.h File ui/native_theme/native_theme.h (right): https://codereview.chromium.org/2591863003/diff/180001/ui/native_theme/native_theme.h#newcode272 ui/native_theme/native_theme.h:272: virtual bool SupportsNinePatch(Part part) const = 0; Can you ...
3 years, 9 months ago (2017-03-01 15:38:55 UTC) #47
bokan
-nasko@ since he's marked (Slow) +alexmos@ in his place for content/child. https://codereview.chromium.org/2591863003/diff/180001/third_party/WebKit/Source/platform/scroll/ScrollbarTheme.h File third_party/WebKit/Source/platform/scroll/ScrollbarTheme.h (right): ...
3 years, 9 months ago (2017-03-01 16:22:45 UTC) #49
sadrul
Thanks. lgtm https://codereview.chromium.org/2591863003/diff/220001/ui/native_theme/native_theme_win.cc File ui/native_theme/native_theme_win.cc (right): https://codereview.chromium.org/2591863003/diff/220001/ui/native_theme/native_theme_win.cc#newcode665 ui/native_theme/native_theme_win.cc:665: // paitned by NativeThemeAura on Windows. *painted
3 years, 9 months ago (2017-03-01 16:30:27 UTC) #50
Evan Stade
(perhaps a TODO) Have you tested this at fractional scales, such as 1.25? https://codereview.chromium.org/2591863003/diff/220001/cc/layers/nine_patch_layer_impl.cc File ...
3 years, 9 months ago (2017-03-01 16:45:50 UTC) #51
bokan
https://codereview.chromium.org/2591863003/diff/220001/cc/layers/nine_patch_layer_impl.cc File cc/layers/nine_patch_layer_impl.cc (right): https://codereview.chromium.org/2591863003/diff/220001/cc/layers/nine_patch_layer_impl.cc#newcode69 cc/layers/nine_patch_layer_impl.cc:69: gfx::RectF(gfx::ToFlooredRectDeprecated(patch.output_rect)); On 2017/03/01 16:45:49, Evan Stade wrote: > seems ...
3 years, 9 months ago (2017-03-01 17:02:31 UTC) #52
bokan
On 2017/03/01 16:45:50, Evan Stade wrote: > (perhaps a TODO) Have you tested this at ...
3 years, 9 months ago (2017-03-01 17:04:37 UTC) #53
alexmos
content/child LGTM
3 years, 9 months ago (2017-03-01 17:44:14 UTC) #54
Evan Stade
On 2017/03/01 17:04:37, bokan wrote: > On 2017/03/01 16:45:50, Evan Stade wrote: > > (perhaps ...
3 years, 9 months ago (2017-03-01 22:30:37 UTC) #59
bokan
On 2017/03/01 22:30:37, Evan Stade wrote: > On 2017/03/01 17:04:37, bokan wrote: > > On ...
3 years, 9 months ago (2017-03-01 23:14:53 UTC) #60
Evan Stade
https://codereview.chromium.org/2591863003/diff/240001/ui/native_theme/native_theme_aura.cc File ui/native_theme/native_theme_aura.cc (right): https://codereview.chromium.org/2591863003/diff/240001/ui/native_theme/native_theme_aura.cc#newcode37 ui/native_theme/native_theme_aura.cc:37: const gfx::Size kOverlayScrollbarNinePatchCanvasSize(5, 5); sorry, what I actually meant ...
3 years, 9 months ago (2017-03-02 02:32:01 UTC) #61
Evan Stade
On 2017/03/02 02:32:01, Evan Stade wrote: > https://codereview.chromium.org/2591863003/diff/240001/ui/native_theme/native_theme_aura.cc > File ui/native_theme/native_theme_aura.cc (right): > > https://codereview.chromium.org/2591863003/diff/240001/ui/native_theme/native_theme_aura.cc#newcode37 ...
3 years, 9 months ago (2017-03-02 02:42:08 UTC) #62
bokan
https://codereview.chromium.org/2591863003/diff/240001/ui/native_theme/native_theme_aura.cc File ui/native_theme/native_theme_aura.cc (right): https://codereview.chromium.org/2591863003/diff/240001/ui/native_theme/native_theme_aura.cc#newcode37 ui/native_theme/native_theme_aura.cc:37: const gfx::Size kOverlayScrollbarNinePatchCanvasSize(5, 5); On 2017/03/02 02:32:01, Evan Stade ...
3 years, 9 months ago (2017-03-02 13:55:36 UTC) #63
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/2591863003/210046
3 years, 9 months ago (2017-03-02 13:56:09 UTC) #66
commit-bot: I haz the power
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_swarming_rel/builds/129756)
3 years, 9 months ago (2017-03-02 15:32:34 UTC) #68
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/2591863003/210046
3 years, 9 months ago (2017-03-02 15:38:01 UTC) #70
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/243114)
3 years, 9 months ago (2017-03-02 17:07:16 UTC) #72
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/2591863003/290001
3 years, 9 months ago (2017-03-02 20:54:15 UTC) #75
commit-bot: I haz the power
3 years, 9 months ago (2017-03-02 22:43:44 UTC) #78
Message was sent while issue was closed.
Committed patchset #16 (id:290001) as
https://chromium.googlesource.com/chromium/src/+/e7a058aa7db4c0fc172200fd16c8...

Powered by Google App Engine
This is Rietveld 408576698