Title: [188399] trunk/Source/WebCore
Revision
188399
Author
wenson_hs...@apple.com
Date
2015-08-13 13:30:32 -0700 (Thu, 13 Aug 2015)

Log Message

Selects should scale when rendering while zoomed
https://bugs.webkit.org/show_bug.cgi?id=147868

Reviewed by Daniel Bates.

When rendering zoomed <select> elements, draw to an image buffer instead of drawing directly
into the context. This allows us to scale the image buffer up before rendering.

* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintMenuList): Use ThemeMac::drawCellOrFocusRingWithViewIntoContext
    to render search fields, utilizing an offscreen image buffer only when necessary.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (188398 => 188399)


--- trunk/Source/WebCore/ChangeLog	2015-08-13 20:29:20 UTC (rev 188398)
+++ trunk/Source/WebCore/ChangeLog	2015-08-13 20:30:32 UTC (rev 188399)
@@ -1,3 +1,17 @@
+2015-08-13 Wenson Hsieh  <wenson_hs...@apple.com>
+
+        Selects should scale when rendering while zoomed
+        https://bugs.webkit.org/show_bug.cgi?id=147868
+
+        Reviewed by Daniel Bates.
+
+        When rendering zoomed <select> elements, draw to an image buffer instead of drawing directly
+        into the context. This allows us to scale the image buffer up before rendering.
+
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::paintMenuList): Use ThemeMac::drawCellOrFocusRingWithViewIntoContext
+            to render search fields, utilizing an offscreen image buffer only when necessary.
+
 2015-08-13  Alex Christensen  <achristen...@webkit.org>
 
         [Win] Unreviewed build fix after r188388.

Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (188398 => 188399)


--- trunk/Source/WebCore/rendering/RenderThemeMac.mm	2015-08-13 20:29:20 UTC (rev 188398)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm	2015-08-13 20:30:32 UTC (rev 188399)
@@ -947,11 +947,14 @@
     }
 
     NSView *view = documentViewFor(renderer);
-    [popupButton drawWithFrame:inflatedRect inView:view];
-    if (isFocused(renderer) && renderer.style().outlineStyleIsAuto()) {
-        if (wkDrawCellFocusRingWithFrameAtTime(popupButton, inflatedRect, view, std::numeric_limits<double>::max()))
-            renderer.document().page()->focusController().setFocusedElementNeedsRepaint();
-    }
+    Page* page = renderer.document().page();
+    float pageScaleFactor = page->pageScaleFactor();
+    float deviceScaleFactor = page->deviceScaleFactor();
+    bool shouldDrawFocusRing = isFocused(renderer) && renderer.style().outlineStyleIsAuto();
+    bool shouldUseImageBuffer = zoomLevel != 1.0f || pageScaleFactor != 1.0f;
+    bool shouldDrawCell = true;
+    if (ThemeMac::drawCellOrFocusRingWithViewIntoContext(popupButton, paintInfo.context, inflatedRect, view, shouldDrawCell, shouldDrawFocusRing, shouldUseImageBuffer, deviceScaleFactor))
+        page->focusController().setFocusedElementNeedsRepaint();
 
     [popupButton setControlView:nil];
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to