Web Inspector: Share Highlight Code for Drawing Outlined Quad
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Nov 2011 03:54:12 +0000 (03:54 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Nov 2011 03:54:12 +0000 (03:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=72451

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2011-11-15
Reviewed by Timothy Hatcher.

* inspector/DOMNodeHighlighter.cpp:

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

Source/WebCore/ChangeLog
Source/WebCore/inspector/DOMNodeHighlighter.cpp

index d43f39762e4eafe3c049ac4fa622134699a64e91..c5087a5d9b49cda736882fa44eb0c39cec5386df 100644 (file)
@@ -1,3 +1,12 @@
+2011-11-15  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Share Highlight Code for Drawing Outlined Quad
+        https://bugs.webkit.org/show_bug.cgi?id=72451
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/DOMNodeHighlighter.cpp:
+
 2011-11-15  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r100308.
index 93035bb66beb0527a6e33a2231b511aae11fbb1f..2857c8b1edc6a7c1658c47130875222ae88f914a 100644 (file)
@@ -462,26 +462,8 @@ void drawRectHighlight(GraphicsContext& context, Document* document, HighlightDa
     FloatRect overlayRect = view->visibleContentRect();
     context.translate(-overlayRect.x(), -overlayRect.y());
 
-    static const int outlineThickness = 2;
-
-    Path quadPath = quadToPath(FloatRect(*(highlightData->rect)));
-
-    // Clip out the quad, then draw with a 2px stroke to get a pixel
-    // of outline (because inflating a quad is hard)
-    {
-        context.save();
-        context.clipOut(quadPath);
-
-        context.setStrokeThickness(outlineThickness);
-        context.setStrokeColor(highlightData->contentOutline, ColorSpaceDeviceRGB);
-        context.strokePath(quadPath);
-
-        context.restore();
-    }
-
-    // Now do the fill
-    context.setFillColor(highlightData->content, ColorSpaceDeviceRGB);
-    context.fillPath(quadPath);
+    FloatRect highlightRect(*(highlightData->rect));
+    drawOutlinedQuad(context, highlightRect, highlightData->content, highlightData->contentOutline);
 }
 
 } // anonymous namespace