Commit 421ddf96 authored by Allen Bauer's avatar Allen Bauer Committed by Commit Bot

Material Refresh - Align tab edges on pixel boundaries. Refactor path generation functions.

Bug: 841532
Change-Id: I313a4efc4aaaa04cf75556db5b705284f3cc66ef
Reviewed-on: https://chromium-review.googlesource.com/1067439
Commit-Queue: Allen Bauer <kylixrd@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560691}
parent 6f8ef8b5
This diff is collapsed.
......@@ -15,7 +15,7 @@ class Tab;
namespace gfx {
class Path;
class Point;
class Size;
class Rect;
}
namespace ui {
class ListSelectionModel;
......@@ -121,7 +121,8 @@ class TabController {
// computing |clip|.
virtual bool ShouldPaintTab(
const Tab* tab,
const base::Callback<gfx::Path(const gfx::Size&)>& border_callback,
const base::RepeatingCallback<gfx::Path(const gfx::Rect&)>&
border_callback,
gfx::Path* clip) = 0;
// Returns true if tab loading throbbers can be painted to a composited layer.
......
......@@ -986,7 +986,7 @@ void TabStrip::OnMouseEventInTab(views::View* source,
bool TabStrip::ShouldPaintTab(
const Tab* tab,
const base::Callback<gfx::Path(const gfx::Size&)>& border_callback,
const base::RepeatingCallback<gfx::Path(const gfx::Rect&)>& border_callback,
gfx::Path* clip) {
if (!MaySetClip())
return true;
......@@ -1009,7 +1009,7 @@ bool TabStrip::ShouldPaintTab(
if (current_x > next_x)
return true; // Can happen during dragging.
*clip = border_callback.Run(tab_at(index + 1)->size());
*clip = border_callback.Run(tab_at(index + 1)->bounds());
clip->offset(SkIntToScalar(next_x - current_x), 0);
} else if (index > active_index && index > 0) {
const gfx::Rect& previous_bounds(tab_at(index - 1)->bounds());
......@@ -1021,7 +1021,7 @@ bool TabStrip::ShouldPaintTab(
return true; // Can happen during dragging.
if (previous_bounds.right() - Tab::GetOverlap() != current_x) {
*clip = border_callback.Run(tab_at(index - 1)->size());
*clip = border_callback.Run(tab_at(index - 1)->bounds());
clip->offset(SkIntToScalar(previous_x - current_x), 0);
}
}
......
......@@ -247,7 +247,8 @@ class TabStrip : public views::View,
const ui::MouseEvent& event) override;
bool ShouldPaintTab(
const Tab* tab,
const base::Callback<gfx::Path(const gfx::Size&)>& border_callback,
const base::RepeatingCallback<gfx::Path(const gfx::Rect&)>&
border_callback,
gfx::Path* clip) override;
bool CanPaintThrobberToLayer() const override;
SkColor GetToolbarTopSeparatorColor() const override;
......
......@@ -73,7 +73,8 @@ class FakeTabController : public TabController {
const ui::MouseEvent& event) override {}
bool ShouldPaintTab(
const Tab* tab,
const base::Callback<gfx::Path(const gfx::Size&)>& border_callback,
const base::RepeatingCallback<gfx::Path(const gfx::Rect&)>&
border_callback,
gfx::Path* clip) override {
return true;
}
......
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