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

Unified Diff: ui/views/painter.cc

Issue 2714753002: Improve appearance of focus rings at fractional scales. (Closed)
Patch Set: rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/painter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/painter.cc
diff --git a/ui/views/painter.cc b/ui/views/painter.cc
index ffb4bbb9513612a19c2846e96df8fb089c0507f2..4c4e69f2c7f677c9f813ef067d99d21934ef90f5 100644
--- a/ui/views/painter.cc
+++ b/ui/views/painter.cc
@@ -121,9 +121,7 @@ void DashedFocusPainter::Paint(gfx::Canvas* canvas, const gfx::Size& size) {
class SolidFocusPainter : public Painter {
public:
- SolidFocusPainter(SkColor color,
- SkScalar thickness,
- const gfx::InsetsF& insets);
+ SolidFocusPainter(SkColor color, int thickness, const gfx::InsetsF& insets);
~SolidFocusPainter() override;
// Painter:
@@ -132,14 +130,14 @@ class SolidFocusPainter : public Painter {
private:
const SkColor color_;
- const SkScalar thickness_;
+ const int thickness_;
const gfx::InsetsF insets_;
DISALLOW_COPY_AND_ASSIGN(SolidFocusPainter);
};
SolidFocusPainter::SolidFocusPainter(SkColor color,
- SkScalar thickness,
+ int thickness,
const gfx::InsetsF& insets)
: color_(color), thickness_(thickness), insets_(insets) {}
@@ -355,17 +353,15 @@ std::unique_ptr<Painter> Painter::CreateSolidFocusPainter(
// Subtract that here so it works the same way with the new
// Canvas::DrawSolidFocusRect.
const gfx::Insets corrected_insets = insets - gfx::Insets(0, 0, 1, 1);
- return base::MakeUnique<SolidFocusPainter>(color, SkIntToScalar(1),
- corrected_insets);
+ return base::MakeUnique<SolidFocusPainter>(color, 1, corrected_insets);
}
// static
std::unique_ptr<Painter> Painter::CreateSolidFocusPainter(
SkColor color,
- float thickness,
+ int thickness,
const gfx::InsetsF& insets) {
- return base::MakeUnique<SolidFocusPainter>(color, SkFloatToScalar(thickness),
- insets);
+ return base::MakeUnique<SolidFocusPainter>(color, thickness, insets);
}
// HorizontalPainter ----------------------------------------------------------
« no previous file with comments | « ui/views/painter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698