Commit 971f15dc authored by Jinfeng Ma's avatar Jinfeng Ma Committed by Commit Bot

Paint overlay resizer in the dedicated paint phase. (2/3)

Clean up PaintLayerScrollableArea::UpdateScrollCornerStyle and
ScrollableAreaPainter::PaintResizer with the new added function:
PaintLayerScrollableArea::HasNonOverlayOverflowControls.

This is 2/3 of a series of patches:
  1. https://crrev.com/c/1816486
  2. This patch.
  3. https://crrev.com/c/1831917

Bug: 1006173
Change-Id: Ic6bb659cb7d7e646955e08a4f5035313f71dee01
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1817874Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705418}
parent 5f949702
...@@ -1689,8 +1689,7 @@ void PaintLayerScrollableArea::PositionOverflowControls() { ...@@ -1689,8 +1689,7 @@ void PaintLayerScrollableArea::PositionOverflowControls() {
} }
void PaintLayerScrollableArea::UpdateScrollCornerStyle() { void PaintLayerScrollableArea::UpdateScrollCornerStyle() {
bool can_update = HasScrollbar() && !HasOverlayScrollbars(); if (!HasNonOverlayOverflowControls()) {
if (!can_update) {
if (scroll_corner_) { if (scroll_corner_) {
scroll_corner_->Destroy(); scroll_corner_->Destroy();
scroll_corner_ = nullptr; scroll_corner_ = nullptr;
......
...@@ -64,8 +64,7 @@ void ScrollableAreaPainter::PaintResizer(GraphicsContext& context, ...@@ -64,8 +64,7 @@ void ScrollableAreaPainter::PaintResizer(GraphicsContext& context,
// Draw a frame around the resizer (1px grey line) if there are any scrollbars // Draw a frame around the resizer (1px grey line) if there are any scrollbars
// present. Clipping will exclude the right and bottom edges of this frame. // present. Clipping will exclude the right and bottom edges of this frame.
if (!GetScrollableArea().HasOverlayScrollbars() && if (GetScrollableArea().HasNonOverlayOverflowControls()) {
GetScrollableArea().HasScrollbar()) {
GraphicsContextStateSaver state_saver(context); GraphicsContextStateSaver state_saver(context);
context.Clip(abs_rect); context.Clip(abs_rect);
IntRect larger_corner = abs_rect; IntRect larger_corner = abs_rect;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment