Inset focus ring (Skia on Mac)
authorcaryclark@google.com <caryclark@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Sep 2011 21:26:08 +0000 (21:26 +0000)
committercaryclark@google.com <caryclark@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Sep 2011 21:26:08 +0000 (21:26 +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 Stephen White.

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@96426 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

index da39cbe..f771ed6 100644 (file)
@@ -1,3 +1,21 @@
+2011-09-30  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 Stephen White.
+
+        No new tests. This platform is not enabled.
+
+        * platform/graphics/skia/GraphicsContextSkia.cpp:
+        (WebCore::getFocusRingOutset):
+        (WebCore::GraphicsContext::drawFocusRing):
+
 2011-09-30  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r96422.
 2011-09-30  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r96422.
index f88c9cd..a74b9f4 100644 (file)
@@ -538,10 +538,10 @@ static inline void drawInnerPath(SkCanvas* canvas, const SkPath& path, SkPaint&
 #endif
 }
 
 #endif
 }
 
-static inline SkScalar getFocusRingOutset(int width)
+static inline SkScalar getFocusRingOutset()
 {
 #if PLATFORM(CHROMIUM) && OS(DARWIN)
 {
 #if PLATFORM(CHROMIUM) && OS(DARWIN)
-    return (width * 0.5f) + 0.25f;
+    return 0.75f;
 #else
     return 0.5f;
 #endif
 #else
     return 0.5f;
 #endif
@@ -557,7 +557,7 @@ void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int width, int
         return;
 
     SkRegion focusRingRegion;
         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);
     for (unsigned i = 0; i < rectCount; i++) {
         SkIRect r = rects[i];
         r.inset(-focusRingOutset, -focusRingOutset);