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

Issue 2639203007: Update SetPaintToLayer to accept LayerType (Closed)

Created:
3 years, 11 months ago by yiyix
Modified:
3 years, 10 months ago
Reviewers:
varkha, sadrul, sky, bruthig
CC:
chromium-reviews, sadrul, yusukes+watch_chromium.org, hidehiko+watch_chromium.org, dcheng, lhchavez+watch_chromium.org, stevenjb+watch_chromium.org, miu+watch_chromium.org, msw+watch_chromium.org, Matt Giuca, kalyank, Peter Beverloo, mlamouri+watch-notifications_chromium.org, hcarmona+bubble_chromium.org, bruthig+ink_drop_chromium.org, rouslan+bubble_chromium.org, awdf+watch_chromium.org, elijahtaylor+arcwatch_chromium.org, groby+bubble_chromium.org, oshima+watch_chromium.org, tfarina, mac-reviews_chromium.org, davemoore+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Update SetPaintToLayer to accept LayerType SetPaintToLayer is used to create layer for a specific view. It used to accept a bool variable and always create a texture layer, which is very expensive because texture layer needs to be re-raster every time. It can now accept |layer_type| as input. Note that subsequent CLs will use this to create Views with ui::LAYER_SOLID_COLOR layers. BUG=680536 Review-Url: https://codereview.chromium.org/2639203007 Cr-Commit-Position: refs/heads/master@{#445940} Committed: https://chromium.googlesource.com/chromium/src/+/0338037a696b84bb66efe37eee1cb16bdb113453

Patch Set 1 : Refactor #

Total comments: 4

Patch Set 2 : address comments #

Total comments: 2

Patch Set 3 : remove unnecessary calls #

Total comments: 2

Patch Set 4 : address comments #

Total comments: 4

Patch Set 5 : address @sky's comment #

Total comments: 1

Patch Set 6 : fix comments #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+206 lines, -197 lines) Patch
M ash/common/frame/header_view.cc View 1 2 3 1 chunk +3 lines, -3 lines 0 comments Download
M ash/common/shelf/overflow_bubble_view.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ash/common/shelf/shelf_button.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ash/common/shelf/shelf_view.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M ash/common/system/chromeos/network/network_state_list_detailed_view.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M ash/common/system/status_area_widget_delegate.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ash/common/system/tray/throbber_view.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ash/common/system/tray/tray_background_view.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ash/common/system/tray/tray_details_view.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ash/common/system/tray/tray_details_view_unittest.cc View 1 2 chunks +4 lines, -4 lines 0 comments Download
M ash/common/system/tray/tray_item_view.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ash/common/system/tray/tray_popup_item_container.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ash/common/system/tray/tray_popup_utils.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ash/common/system/user/tray_user.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ash/common/system/web_notification/web_notification_tray.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ash/common/wallpaper/wallpaper_view.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ash/common/wm/overview/window_selector_item.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ash/common/wm/window_cycle_list.cc View 1 3 chunks +4 lines, -3 lines 0 comments Download
M ash/touch/touch_hud_debug.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ash/touch_hud/touch_hud_renderer.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ash/wm/window_mirror_view.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/display/touch_calibrator/touch_calibrator_view.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/dropdown_bar_host.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/frame/contents_web_view.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/frame/immersive_mode_controller_ash.cc View 1 2 3 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/infobars/infobar_container_view.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/infobars/infobar_view.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/location_bar/bubble_icon_view.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/location_bar/location_bar_view.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/payments/payment_request_views_util.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/payments/view_stack.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/tabs/tab.cc View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M ui/app_list/views/app_list_folder_view.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/app_list/views/app_list_main_view.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/app_list/views/app_list_main_view_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/app_list/views/app_list_view.cc View 1 3 chunks +4 lines, -4 lines 0 comments Download
M ui/app_list/views/apps_grid_view.cc View 1 3 chunks +3 lines, -3 lines 0 comments Download
M ui/app_list/views/folder_background_view.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/app_list/views/pulsing_block_view.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/app_list/views/top_icon_animation_view.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/arc/notification/arc_custom_notification_view.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/message_center/views/message_center_button_bar.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/message_center/views/message_center_view.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/message_center/views/notifier_settings_view.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/views/animation/ink_drop.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M ui/views/animation/ink_drop_host_view.cc View 1 2 3 2 chunks +3 lines, -2 lines 1 comment Download
M ui/views/bubble/tray_bubble_view.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M ui/views/controls/button/label_button.cc View 1 2 3 2 chunks +3 lines, -3 lines 0 comments Download
M ui/views/controls/button/md_text_button.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/views/controls/combobox/combobox.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/views/controls/focus_ring.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/views/controls/scroll_view.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M ui/views/controls/scrollbar/cocoa_scroll_bar.mm View 1 2 chunks +2 lines, -2 lines 0 comments Download
M ui/views/controls/scrollbar/overlay_scroll_bar.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M ui/views/controls/slide_out_view.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/views/view.h View 1 2 3 4 5 3 chunks +8 lines, -7 lines 0 comments Download
M ui/views/view.cc View 1 2 3 4 4 chunks +37 lines, -33 lines 0 comments Download
M ui/views/view_unittest.cc View 1 2 3 40 chunks +64 lines, -64 lines 0 comments Download
M ui/views/view_unittest_aura.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/views/widget/native_widget_aura_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/views/widget/window_reorderer_unittest.cc View 1 4 chunks +5 lines, -5 lines 0 comments Download

Messages

Total messages: 62 (45 generated)
sadrul
You should mention in the CL desc. that subsequent CLs will use this to create ...
3 years, 11 months ago (2017-01-20 19:50:11 UTC) #12
bruthig
https://codereview.chromium.org/2639203007/diff/20001/ui/views/animation/ink_drop.cc File ui/views/animation/ink_drop.cc (right): https://codereview.chromium.org/2639203007/diff/20001/ui/views/animation/ink_drop.cc#newcode14 ui/views/animation/ink_drop.cc:14: SetPaintToLayer(ui::LAYER_TEXTURED); nit: This may not need to be a ...
3 years, 11 months ago (2017-01-20 20:14:18 UTC) #14
sky
https://codereview.chromium.org/2639203007/diff/20001/ui/views/view.h File ui/views/view.h (right): https://codereview.chromium.org/2639203007/diff/20001/ui/views/view.h#newcode342 ui/views/view.h:342: void SetPaintToLayer(ui::LayerType layer_type); WDYT of a default of TEXTURED ...
3 years, 11 months ago (2017-01-20 20:32:07 UTC) #15
sadrul
https://codereview.chromium.org/2639203007/diff/20001/ui/views/animation/ink_drop.cc File ui/views/animation/ink_drop.cc (right): https://codereview.chromium.org/2639203007/diff/20001/ui/views/animation/ink_drop.cc#newcode14 ui/views/animation/ink_drop.cc:14: SetPaintToLayer(ui::LAYER_TEXTURED); On 2017/01/20 20:14:18, bruthig wrote: > nit: This ...
3 years, 11 months ago (2017-01-20 20:32:52 UTC) #16
yiyix
On 2017/01/20 20:32:07, sky wrote: > https://codereview.chromium.org/2639203007/diff/20001/ui/views/view.h > File ui/views/view.h (right): > > https://codereview.chromium.org/2639203007/diff/20001/ui/views/view.h#newcode342 > ...
3 years, 11 months ago (2017-01-20 20:58:28 UTC) #18
yiyix
@sky, sadrul, bruthig, could you please take a look at this change again? Thank you.
3 years, 11 months ago (2017-01-23 15:20:46 UTC) #30
bruthig
https://codereview.chromium.org/2639203007/diff/80001/ui/views/animation/ink_drop_host_view.cc File ui/views/animation/ink_drop_host_view.cc (right): https://codereview.chromium.org/2639203007/diff/80001/ui/views/animation/ink_drop_host_view.cc#newcode152 ui/views/animation/ink_drop_host_view.cc:152: SetPaintToLayer(); nit: It's unnecessary to call SetPaintToLayer() here. I ...
3 years, 11 months ago (2017-01-23 16:25:02 UTC) #31
yiyix
Updated calls. Thanks, @bruthig. @sky, sadrul, could you please take a look? https://codereview.chromium.org/2639203007/diff/80001/ui/views/animation/ink_drop_host_view.cc File ui/views/animation/ink_drop_host_view.cc ...
3 years, 11 months ago (2017-01-23 16:49:49 UTC) #32
sky
https://codereview.chromium.org/2639203007/diff/100001/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/2639203007/diff/100001/ui/views/view.cc#newcode533 ui/views/view.cc:533: if (paint_to_layer_) Shouldn't this also check the type? By ...
3 years, 11 months ago (2017-01-23 17:10:08 UTC) #35
yiyix
@sky, could you please take a look at this version? Thank you.
3 years, 11 months ago (2017-01-23 20:28:41 UTC) #40
sky
https://codereview.chromium.org/2639203007/diff/120001/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/2639203007/diff/120001/ui/views/view.cc#newcode537 ui/views/view.cc:537: if (layer()) { Reduce the conditional to: DestroyLayer(); (it ...
3 years, 11 months ago (2017-01-23 21:21:06 UTC) #41
yiyix
https://codereview.chromium.org/2639203007/diff/120001/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/2639203007/diff/120001/ui/views/view.cc#newcode537 ui/views/view.cc:537: if (layer()) { On 2017/01/23 21:21:05, sky wrote: > ...
3 years, 11 months ago (2017-01-24 03:14:54 UTC) #48
yiyix
On 2017/01/24 03:14:54, yiyix wrote: > https://codereview.chromium.org/2639203007/diff/120001/ui/views/view.cc > File ui/views/view.cc (right): > > https://codereview.chromium.org/2639203007/diff/120001/ui/views/view.cc#newcode537 > ...
3 years, 11 months ago (2017-01-24 03:15:18 UTC) #49
sky
LGTM https://codereview.chromium.org/2639203007/diff/140001/ui/views/view.h File ui/views/view.h (right): https://codereview.chromium.org/2639203007/diff/140001/ui/views/view.h#newcode344 ui/views/view.h:344: // layer, this takes no effect. takes -> ...
3 years, 11 months ago (2017-01-24 17:47:52 UTC) #50
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/2639203007/160001
3 years, 11 months ago (2017-01-25 03:57:01 UTC) #57
commit-bot: I haz the power
Committed patchset #6 (id:160001) as https://chromium.googlesource.com/chromium/src/+/0338037a696b84bb66efe37eee1cb16bdb113453
3 years, 11 months ago (2017-01-25 04:06:31 UTC) #60
varkha
3 years, 10 months ago (2017-01-31 19:47:47 UTC) #62
Message was sent while issue was closed.
https://codereview.chromium.org/2639203007/diff/160001/ui/views/animation/ink...
File ui/views/animation/ink_drop_host_view.cc (right):

https://codereview.chromium.org/2639203007/diff/160001/ui/views/animation/ink...
ui/views/animation/ink_drop_host_view.cc:132: old_paint_to_layer_ = layer() !=
nullptr;
Drive-by after the fact. I think we should add a DCHECK(!layer() ||
layer()->type() == ui::LAYER_TEXTURED) here. Currently if the IDHV already has a
non-texture layer I suspect bad things could happen, e.g. we won't be restoring
the correct layer type in InkDropHostView::RemoveInkDropLayer() (and I don't
know if simply "upgrading" a layer to texture and then "downgrading" it back to
say SOLID_COLOR is a good idea either).

Powered by Google App Engine
This is Rietveld 408576698