Commit 115e9732 authored by Vladislav Kaznacheev's avatar Vladislav Kaznacheev Committed by Commit Bot

Do not draw separator on TrayBackgroundView

Remove the code that was made redundant by the new Shelf design.
The code is theoretically supposed to have no effect due to clipping,
but clipping works differently with GPU rasterization enabled.

Bug: 896439
Test: manual
Change-Id: Ib1429b388d3433cf1683b0405e3b08775eb01e04
Reviewed-on: https://chromium-review.googlesource.com/c/1313734Reviewed-by: default avatarManu Cornet <manucornet@chromium.org>
Reviewed-by: default avatarJenny Zhang <jennyz@chromium.org>
Commit-Queue: Vladislav Kaznacheev <kaznacheev@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605403}
parent a409ae52
......@@ -12,7 +12,6 @@
#include "ash/login/ui/lock_window.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_constants.h"
#include "ash/shelf/shelf_layout_manager.h"
#include "ash/shelf/shelf_widget.h"
......@@ -374,35 +373,6 @@ TrayBackgroundView::CreateInkDropHighlight() const {
return highlight;
}
void TrayBackgroundView::PaintButtonContents(gfx::Canvas* canvas) {
if (shelf()->GetBackgroundType() ==
ShelfBackgroundType::SHELF_BACKGROUND_DEFAULT ||
!separator_visible_) {
return;
}
// In the given |canvas|, for a horizontal shelf draw a separator line to the
// right or left of the TrayBackgroundView when the system is LTR or RTL
// aligned, respectively. For a vertical shelf draw the separator line
// underneath the items instead.
const gfx::Rect local_bounds = GetLocalBounds();
const SkColor color = SkColorSetA(SK_ColorWHITE, 0x4D);
const int shelf_size = ShelfConstants::shelf_size();
const int separator_width = ash::TrayConstants::separator_width();
if (shelf_->IsHorizontalAlignment()) {
const gfx::PointF point(
base::i18n::IsRTL() ? 0 : (local_bounds.width() - separator_width),
(shelf_size - kTrayItemSize) / 2);
const gfx::Vector2dF vector(0, kTrayItemSize);
canvas->Draw1pxLine(point, point + vector, color);
} else {
const gfx::PointF point((shelf_size - kTrayItemSize) / 2,
local_bounds.height() - separator_width);
const gfx::Vector2dF vector(kTrayItemSize, 0);
canvas->Draw1pxLine(point, point + vector, color);
}
}
void TrayBackgroundView::ProcessGestureEventForBubble(ui::GestureEvent* event) {
if (drag_controller())
drag_controller_->ProcessGestureEvent(event, this);
......
......@@ -57,7 +57,6 @@ class ASH_EXPORT TrayBackgroundView : public ActionableView,
std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override;
std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight()
const override;
void PaintButtonContents(gfx::Canvas* canvas) override;
// TrayBubbleView::Delegate:
void ProcessGestureEventForBubble(ui::GestureEvent* event) override;
......
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