Commit 7b7d19e6 authored by caryclark@google.com's avatar 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):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96615 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7f264909
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> 2011-10-03 Jon Lee <jonlee@apple.com>
Extend DOM WheelEvent to differentiate between physical and logical scroll directions Extend DOM WheelEvent to differentiate between physical and logical scroll directions
...@@ -538,10 +538,10 @@ static inline void drawInnerPath(SkCanvas* canvas, const SkPath& path, SkPaint& ...@@ -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 #else
return 0.5f; return 0.5f;
#endif #endif
...@@ -557,7 +557,7 @@ void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int width, int ...@@ -557,7 +557,7 @@ void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int width, int
return; return;
SkRegion focusRingRegion; SkRegion focusRingRegion;
const SkScalar focusRingOutset = getFocusRingOutset(width); const SkScalar focusRingOutset = getFocusRingOutset();
for (unsigned i = 0; i < rectCount; i++) { for (unsigned i = 0; i < rectCount; i++) {
SkIRect r = rects[i]; SkIRect r = rects[i];
r.inset(-focusRingOutset, -focusRingOutset); r.inset(-focusRingOutset, -focusRingOutset);
......
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