Inset focus ring (Skia on Mac)
authorcaryclark@google.com <caryclark@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Oct 2011 18:12:58 +0000 (18:12 +0000)
committercaryclark@google.com <caryclark@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Oct 2011 18:12:58 +0000 (18:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=69166
http://code.google.com/p/chromium/issues/detail?id=97956

This focus ring was drawn too large and was left tracks
in subsequent invalidations. Make it more closely match
the CG version.

Reviewed by Adam Barth.

No new tests. This platform is not enabled.

* platform/graphics/skia/GraphicsContextSkia.cpp:
(WebCore::getFocusRingOutset):
(WebCore::GraphicsContext::drawFocusRing):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@96615 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp

index 541de1f..2a2400c 100644 (file)
@@ -1,3 +1,21 @@
+2011-10-04  Cary Clark  <caryclark@google.com>
+
+        Inset focus ring (Skia on Mac)
+        https://bugs.webkit.org/show_bug.cgi?id=69166
+        http://code.google.com/p/chromium/issues/detail?id=97956
+
+        This focus ring was drawn too large and was left tracks
+        in subsequent invalidations. Make it more closely match
+        the CG version.
+
+        Reviewed by Adam Barth.
+
+        No new tests. This platform is not enabled.
+
+        * platform/graphics/skia/GraphicsContextSkia.cpp:
+        (WebCore::getFocusRingOutset):
+        (WebCore::GraphicsContext::drawFocusRing):
+
 2011-10-03  Jon Lee  <jonlee@apple.com>
 
         Extend DOM WheelEvent to differentiate between physical and logical scroll directions
index f88c9cd..a74b9f4 100644 (file)
@@ -538,10 +538,10 @@ static inline void drawInnerPath(SkCanvas* canvas, const SkPath& path, SkPaint&
 #endif
 }
 
-static inline SkScalar getFocusRingOutset(int width)
+static inline SkScalar getFocusRingOutset()
 {
 #if PLATFORM(CHROMIUM) && OS(DARWIN)
-    return (width * 0.5f) + 0.25f;
+    return 0.75f;
 #else
     return 0.5f;
 #endif
@@ -557,7 +557,7 @@ void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int width, int
         return;
 
     SkRegion focusRingRegion;
-    const SkScalar focusRingOutset = getFocusRingOutset(width);
+    const SkScalar focusRingOutset = getFocusRingOutset();
     for (unsigned i = 0; i < rectCount; i++) {
         SkIRect r = rects[i];
         r.inset(-focusRingOutset, -focusRingOutset);