Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Issue 18341009: Refactor cc scrollbar layers to separate solid-color vs desktop. (Closed)

Created:
7 years, 5 months ago by wjmaclean
Modified:
7 years, 3 months ago
CC:
chromium-reviews, cc-bugs_chromium.org, darin-cc_chromium.org, tfarina
Visibility:
Public.

Description

Refactor cc scrollbar layers architecture. This CL separates the solid-color scrollbar functionality into its own class structure, resulting in the following hierarchy: ScrollbarLayerInterface (pure-virtual) | -------- PaintedScrollbarLayer (for outer-viewport) | --------- SolidColorScrollbarLayer (for inner-viewport) (Android, pinch-zoom) ScrollbarLayerImplBase | ----- PaintedScrollbarLayerImpl (for outer-viewport) | ----- SolidColorScrollbarLayerImpl (for inner-viewport) (Android, pinch-zoom) In this architecture, solid-color scrollbars can live side-by side with regular desktop scrollbars, and no longer require a WebScrollbar in order to be created. The scrolling LayerImpl's only know about ScrollbarLayerImplBase, and the TreeSynchronizer & LTI only deal with *Base layer types. The ScrollbarLayerImplBase layer is not pure virtual, but rather attempts to collect any common functionality, and the result is much simpler classes for SolidColorScrollbarLayerImpl. Work remaining: 1) Once the pinch-viewport layers are in place in CC, we can get rid of vertical adjust (I think), and so LTI::UpdateSolidColorScrollbars() can go away. When this goes away, some of the interface for ScrollbarLayerImplBase can be simplified as well. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=220637

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : Fix some types, includes, and style issues. #

Patch Set 4 : Fix tests, remove scrollbar color/thickness from LayerTreeSettings. #

Total comments: 1

Patch Set 5 : Address James R's comments. #

Total comments: 8

Patch Set 6 : Address tfarina@'s comments. #

Total comments: 16

Patch Set 7 : Removed duplicate code, addressed tfarina@'s comments. #

Patch Set 8 : Rebased patch as it's sat for a while. #

Total comments: 6

Patch Set 9 : Address Enne's comments. #

Total comments: 25

Patch Set 10 : Address review comments; plumb scrollbar color via flag. #

Total comments: 14

Patch Set 11 : Address comments. #

Patch Set 12 : Rebased to account for re-naming to PaintedScrollbarLayer. #

Total comments: 10

Patch Set 13 : Address comments. #

Patch Set 14 : Remove kUseSolidColorScrollbar. #

Patch Set 15 : Rebased for landing. #

Patch Set 16 : Add missing CC_EXPORT. #

Patch Set 17 : Fix Windows compile. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+740 lines, -312 lines) Patch
M cc/cc.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +7 lines, -0 lines 0 comments Download
M cc/layers/layer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -2 lines 0 comments Download
M cc/layers/layer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M cc/layers/layer_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +8 lines, -8 lines 0 comments Download
M cc/layers/layer_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -3 lines 0 comments Download
M cc/layers/painted_scrollbar_layer.h View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +10 lines, -9 lines 0 comments Download
M cc/layers/painted_scrollbar_layer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 8 chunks +13 lines, -26 lines 0 comments Download
M cc/layers/painted_scrollbar_layer_impl.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +10 lines, -29 lines 0 comments Download
M cc/layers/painted_scrollbar_layer_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 8 chunks +23 lines, -164 lines 0 comments Download
A cc/layers/scrollbar_layer_impl_base.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +78 lines, -0 lines 0 comments Download
A cc/layers/scrollbar_layer_impl_base.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +156 lines, -0 lines 0 comments Download
A cc/layers/scrollbar_layer_interface.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +30 lines, -0 lines 0 comments Download
M cc/layers/scrollbar_layer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 chunks +80 lines, -56 lines 0 comments Download
A cc/layers/solid_color_scrollbar_layer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +51 lines, -0 lines 0 comments Download
A cc/layers/solid_color_scrollbar_layer.cc View 1 2 3 4 5 6 7 8 9 1 chunk +62 lines, -0 lines 0 comments Download
A cc/layers/solid_color_scrollbar_layer_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +50 lines, -0 lines 0 comments Download
A cc/layers/solid_color_scrollbar_layer_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +92 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +6 lines, -3 lines 0 comments Download
M cc/trees/tree_synchronizer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +9 lines, -9 lines 0 comments Download
M content/browser/android/content_startup_flags.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M content/public/common/common_param_traits_macros.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/gpu/render_widget_compositor.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -0 lines 0 comments Download
M content/renderer/web_preferences.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M webkit/common/webpreferences.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M webkit/common/webpreferences.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M webkit/renderer/compositor_bindings/web_compositor_support_impl.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M webkit/renderer/compositor_bindings/web_compositor_support_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +13 lines, -0 lines 0 comments Download
M webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +4 lines, -1 line 0 comments Download
M webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +21 lines, -1 line 0 comments Download

Messages

Total messages: 49 (0 generated)
wjmaclean
I think this is ready for a look ... I've fixed the tests, and removed ...
7 years, 5 months ago (2013-07-04 00:35:57 UTC) #1
jamesr
I don't think this is quite the right way to share code here. Solid color ...
7 years, 5 months ago (2013-07-04 00:49:18 UTC) #2
wjmaclean
> I don't think this is quite the right way to share code here. Solid ...
7 years, 5 months ago (2013-07-04 17:14:53 UTC) #3
tfarina
Is this a bug (filed on crbug.com) you are working on that needs BUG= line ...
7 years, 5 months ago (2013-07-04 17:32:13 UTC) #4
tfarina
https://codereview.chromium.org/18341009/diff/14002/webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc File webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc (right): https://codereview.chromium.org/18341009/diff/14002/webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc#newcode20 webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc:20: cc::ScrollbarOrientation convertOrientation( CamelCase https://codereview.chromium.org/18341009/diff/14002/webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc#newcode22 webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc:22: if (orientation == WebKit::WebScrollbar::Horizontal) ...
7 years, 5 months ago (2013-07-04 17:34:45 UTC) #5
wjmaclean
Thanks! https://codereview.chromium.org/18341009/diff/14002/webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc File webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc (right): https://codereview.chromium.org/18341009/diff/14002/webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc#newcode20 webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc:20: cc::ScrollbarOrientation convertOrientation( On 2013/07/04 17:34:45, tfarina wrote: > ...
7 years, 5 months ago (2013-07-04 17:50:11 UTC) #6
tfarina
https://codereview.chromium.org/18341009/diff/12002/cc/layers/scrollbar_layer_impl_base.h File cc/layers/scrollbar_layer_impl_base.h (right): https://codereview.chromium.org/18341009/diff/12002/cc/layers/scrollbar_layer_impl_base.h#newcode1 cc/layers/scrollbar_layer_impl_base.h:1: // Copyright 2012 The Chromium Authors. All rights reserved. ...
7 years, 5 months ago (2013-07-04 22:30:25 UTC) #7
wjmaclean
https://codereview.chromium.org/18341009/diff/12002/cc/layers/scrollbar_layer_impl_base.h File cc/layers/scrollbar_layer_impl_base.h (right): https://codereview.chromium.org/18341009/diff/12002/cc/layers/scrollbar_layer_impl_base.h#newcode1 cc/layers/scrollbar_layer_impl_base.h:1: // Copyright 2012 The Chromium Authors. All rights reserved. ...
7 years, 5 months ago (2013-07-05 17:06:25 UTC) #8
enne (OOO)
https://codereview.chromium.org/18341009/diff/25001/cc/layers/scrollbar_layer.cc File cc/layers/scrollbar_layer.cc (right): https://codereview.chromium.org/18341009/diff/25001/cc/layers/scrollbar_layer.cc#newcode122 cc/layers/scrollbar_layer.cc:122: // wjm: remove this? No. Mac can have overlay ...
7 years, 4 months ago (2013-08-12 23:15:01 UTC) #9
wjmaclean
PTAL aelias@, can you confirm I'm correctly preserving Android's expectations for solid color scrollbars. https://codereview.chromium.org/18341009/diff/25001/cc/layers/scrollbar_layer.cc ...
7 years, 4 months ago (2013-08-14 18:19:44 UTC) #10
wjmaclean
https://codereview.chromium.org/18341009/diff/32001/content/renderer/gpu/render_widget_compositor.cc File content/renderer/gpu/render_widget_compositor.cc (right): https://codereview.chromium.org/18341009/diff/32001/content/renderer/gpu/render_widget_compositor.cc#newcode277 content/renderer/gpu/render_widget_compositor.cc:277: #elif !defined(OS_MACOSX) This should be a separate #if instead ...
7 years, 4 months ago (2013-08-14 20:48:26 UTC) #11
enne (OOO)
I like this direction better. Can you update the description to match what you're doing ...
7 years, 4 months ago (2013-08-14 21:01:09 UTC) #12
aelias_OOO_until_Jul13
The approach looks fine in general. You'll need to rebase on another big scrollbar change ...
7 years, 4 months ago (2013-08-14 21:26:07 UTC) #13
danakj
https://codereview.chromium.org/18341009/diff/32001/cc/layers/scrollbar_layer_impl.cc File cc/layers/scrollbar_layer_impl.cc (right): https://codereview.chromium.org/18341009/diff/32001/cc/layers/scrollbar_layer_impl.cc#newcode70 cc/layers/scrollbar_layer_impl.cc:70: if (draw_mode == DRAW_MODE_RESOURCELESS_SOFTWARE) On 2013/08/14 21:26:08, aelias wrote: ...
7 years, 4 months ago (2013-08-14 21:31:30 UTC) #14
jamesr
Can you update the patch description to reflect the new class hierarchy? It's hard to ...
7 years, 4 months ago (2013-08-14 22:29:06 UTC) #15
wjmaclean
PTAL. I've updated the description as requested. This CL has been through two major re-bases ...
7 years, 4 months ago (2013-08-15 20:09:39 UTC) #16
aelias_OOO_until_Jul13
https://codereview.chromium.org/18341009/diff/32001/cc/layers/scrollbar_layer.h File cc/layers/scrollbar_layer.h (right): https://codereview.chromium.org/18341009/diff/32001/cc/layers/scrollbar_layer.h#newcode20 cc/layers/scrollbar_layer.h:20: class CC_EXPORT ScrollbarLayer : public ScrollbarLayerInterface, On 2013/08/15 20:09:40, ...
7 years, 4 months ago (2013-08-15 21:22:31 UTC) #17
aelias_OOO_until_Jul13
[+joth for android_webview/ OWNERS rubberstamp]
7 years, 4 months ago (2013-08-15 21:23:40 UTC) #18
enne (OOO)
https://codereview.chromium.org/18341009/diff/46001/content/renderer/gpu/render_widget_compositor.cc File content/renderer/gpu/render_widget_compositor.cc (right): https://codereview.chromium.org/18341009/diff/46001/content/renderer/gpu/render_widget_compositor.cc#newcode77 content/renderer/gpu/render_widget_compositor.cc:77: bool StringToSkColor(const std::string& str, SkColor& color) { Why does ...
7 years, 4 months ago (2013-08-15 21:29:26 UTC) #19
joth
lgtm % enne's comment on using command line. https://codereview.chromium.org/18341009/diff/46001/android_webview/lib/main/aw_main_delegate.cc File android_webview/lib/main/aw_main_delegate.cc (right): https://codereview.chromium.org/18341009/diff/46001/android_webview/lib/main/aw_main_delegate.cc#newcode61 android_webview/lib/main/aw_main_delegate.cc:61: cl->AppendSwitch(hide_scrollbar_switch.c_str()); ...
7 years, 4 months ago (2013-08-15 21:40:07 UTC) #20
jamesr
NAK on the switches changes. I'm not sure what you are trying to accomplish with ...
7 years, 4 months ago (2013-08-15 22:34:23 UTC) #21
tony
To provide some context, I'm experimenting with adding overlay scrollbars for use on ChromeOS. The ...
7 years, 4 months ago (2013-08-15 22:52:45 UTC) #22
wjmaclean
PTAL jamesr@ - As I hope this CL is converging, can you take a more ...
7 years, 4 months ago (2013-08-16 13:34:15 UTC) #23
wjmaclean
Sorry for the delay ... the rebasing to account for the re-naming was a little ...
7 years, 3 months ago (2013-08-28 01:03:13 UTC) #24
enne (OOO)
https://codereview.chromium.org/18341009/diff/63001/android_webview/lib/main/aw_main_delegate.cc File android_webview/lib/main/aw_main_delegate.cc (left): https://codereview.chromium.org/18341009/diff/63001/android_webview/lib/main/aw_main_delegate.cc#oldcode59 android_webview/lib/main/aw_main_delegate.cc:59: cl->AppendSwitch(switches::kHideScrollbars); I don't understand what changing kHideScrollbars to kSolidColorScrollbarColor ...
7 years, 3 months ago (2013-08-28 18:22:08 UTC) #25
wjmaclean
All comments addressed, PTAL. https://codereview.chromium.org/18341009/diff/63001/android_webview/lib/main/aw_main_delegate.cc File android_webview/lib/main/aw_main_delegate.cc (left): https://codereview.chromium.org/18341009/diff/63001/android_webview/lib/main/aw_main_delegate.cc#oldcode59 android_webview/lib/main/aw_main_delegate.cc:59: cl->AppendSwitch(switches::kHideScrollbars); On 2013/08/28 18:22:08, enne ...
7 years, 3 months ago (2013-08-28 20:51:46 UTC) #26
enne (OOO)
lgtm In the future, could you upload your rebases separately from your changes? For large ...
7 years, 3 months ago (2013-08-28 21:09:08 UTC) #27
wjmaclean
On 2013/08/28 21:09:08, enne wrote: > lgtm > > In the future, could you upload ...
7 years, 3 months ago (2013-08-28 21:11:27 UTC) #28
wjmaclean
[email protected]: Please review changes in content/{browser|public} please?
7 years, 3 months ago (2013-08-28 21:33:13 UTC) #29
jam
what's the purpose of kUseSolidColorScrollbars? it's always being set in the browser, so why not ...
7 years, 3 months ago (2013-08-29 05:10:13 UTC) #30
wjmaclean
>what's the purpose of kUseSolidColorScrollbars? it's always >being set in the browser, so why not ...
7 years, 3 months ago (2013-08-29 13:58:18 UTC) #31
jam
On 2013/08/29 13:58:18, wjmaclean wrote: > >what's the purpose of kUseSolidColorScrollbars? it's always > >being ...
7 years, 3 months ago (2013-08-29 16:22:07 UTC) #32
wjmaclean
On 2013/08/29 16:22:07, jam wrote: > On 2013/08/29 13:58:18, wjmaclean wrote: > > >what's the ...
7 years, 3 months ago (2013-08-29 16:26:07 UTC) #33
wjmaclean
On 2013/08/29 16:22:07, jam wrote: > On 2013/08/29 13:58:18, wjmaclean wrote: > > >what's the ...
7 years, 3 months ago (2013-08-29 16:50:15 UTC) #34
sky
content/browser LGTM
7 years, 3 months ago (2013-08-29 16:51:16 UTC) #35
jamesr
content/renderer/ and webkit/ lgtm
7 years, 3 months ago (2013-08-29 18:40:42 UTC) #36
Chris Evans
On 2013/08/29 18:40:42, jamesr wrote: > content/renderer/ and webkit/ lgtm LGTM
7 years, 3 months ago (2013-08-29 18:45:04 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/18341009/88001
7 years, 3 months ago (2013-08-29 18:48:13 UTC) #38
wjmaclean
joi@ Could you look at https://codereview.chromium.org/18341009/ for common_param_traits_macro.h please?
7 years, 3 months ago (2013-08-29 18:58:51 UTC) #39
jam
On 2013/08/29 18:58:51, wjmaclean wrote: > joi@ Could you look at https://codereview.chromium.org/18341009/ for > > ...
7 years, 3 months ago (2013-08-29 23:29:28 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/18341009/88001
7 years, 3 months ago (2013-08-30 01:07:25 UTC) #41
commit-bot: I haz the power
Failed to apply patch for cc/layers/painted_scrollbar_layer.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 3 months ago (2013-08-30 01:07:31 UTC) #42
Jói
Removing myself from reviewers list as jam@ has already given you the l-g-t-m you need.
7 years, 3 months ago (2013-08-30 08:07:13 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/18341009/107001
7 years, 3 months ago (2013-08-30 13:57:56 UTC) #44
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 3 months ago (2013-08-30 14:21:07 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/18341009/74001
7 years, 3 months ago (2013-08-30 14:54:58 UTC) #46
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 3 months ago (2013-08-30 15:52:05 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/18341009/143001
7 years, 3 months ago (2013-08-30 16:07:06 UTC) #48
commit-bot: I haz the power
7 years, 3 months ago (2013-08-30 20:25:35 UTC) #49
Message was sent while issue was closed.
Change committed as 220637

Powered by Google App Engine
This is Rietveld 408576698