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

Unified Diff: third_party/WebKit/Source/platform/graphics/GraphicsContext.h

Issue 2386033002: Scale focus outline thickness with zoom level. (Closed)
Patch Set: merge conflicts Created 4 years, 2 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
Index: third_party/WebKit/Source/platform/graphics/GraphicsContext.h
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsContext.h b/third_party/WebKit/Source/platform/graphics/GraphicsContext.h
index 6615dd27fcf46c8adfdd43ad04a78b966432586f..24566fbd1ce3a313dee0d346ef072fa775a293e8 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsContext.h
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsContext.h
@@ -307,10 +307,10 @@ class PLATFORM_EXPORT GraphicsContext {
void setDrawLooper(std::unique_ptr<DrawLooperBuilder>);
void drawFocusRing(const Vector<IntRect>&,
- int width,
+ float width,
int offset,
const Color&);
- void drawFocusRing(const Path&, int width, int offset, const Color&);
+ void drawFocusRing(const Path&, float width, int offset, const Color&);
enum Edge {
NoEdge = 0,
@@ -363,15 +363,9 @@ class PLATFORM_EXPORT GraphicsContext {
// Unlike normal outlines (whole width is outside of the offset), focus
// rings are drawn with the center of the path aligned with the offset, so
// only half of the width is outside of the offset.
- return focusRingOffset(offset) + (focusRingWidth(width) + 1) / 2;
+ return focusRingOffset(offset) + (width + 1) / 2;
}
-#if OS(MACOSX)
- static int focusRingWidth(int width) { return width; }
-#else
- static int focusRingWidth(int width) { return 1; }
-#endif
-
#if DCHECK_IS_ON()
void setInDrawingRecorder(bool);
#endif
@@ -404,8 +398,8 @@ class PLATFORM_EXPORT GraphicsContext {
void restoreLayer();
// Helpers for drawing a focus ring (drawFocusRing)
- void drawFocusRingPath(const SkPath&, const Color&, int width);
- void drawFocusRingRect(const SkRect&, const Color&, int width);
+ void drawFocusRingPath(const SkPath&, const Color&, float width);
+ void drawFocusRingRect(const SkRect&, const Color&, float width);
// SkCanvas wrappers.
void clipRRect(const SkRRect&,

Powered by Google App Engine
This is Rietveld 408576698