Changeset 188399 in webkit


Ignore:
Timestamp:
Aug 13, 2015 1:30:32 PM (9 years ago)
Author:
Wenson Hsieh
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.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r188395 r188399  
     12015-08-13 Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Selects should scale when rendering while zoomed
     4        https://bugs.webkit.org/show_bug.cgi?id=147868
     5
     6        Reviewed by Daniel Bates.
     7
     8        When rendering zoomed <select> elements, draw to an image buffer instead of drawing directly
     9        into the context. This allows us to scale the image buffer up before rendering.
     10
     11        * rendering/RenderThemeMac.mm:
     12        (WebCore::RenderThemeMac::paintMenuList): Use ThemeMac::drawCellOrFocusRingWithViewIntoContext
     13            to render search fields, utilizing an offscreen image buffer only when necessary.
     14
    1152015-08-13  Alex Christensen  <achristensen@webkit.org>
    216
  • trunk/Source/WebCore/rendering/RenderThemeMac.mm

    r188183 r188399  
    948948
    949949    NSView *view = documentViewFor(renderer);
    950     [popupButton drawWithFrame:inflatedRect inView:view];
    951     if (isFocused(renderer) && renderer.style().outlineStyleIsAuto()) {
    952         if (wkDrawCellFocusRingWithFrameAtTime(popupButton, inflatedRect, view, std::numeric_limits<double>::max()))
    953             renderer.document().page()->focusController().setFocusedElementNeedsRepaint();
    954     }
     950    Page* page = renderer.document().page();
     951    float pageScaleFactor = page->pageScaleFactor();
     952    float deviceScaleFactor = page->deviceScaleFactor();
     953    bool shouldDrawFocusRing = isFocused(renderer) && renderer.style().outlineStyleIsAuto();
     954    bool shouldUseImageBuffer = zoomLevel != 1.0f || pageScaleFactor != 1.0f;
     955    bool shouldDrawCell = true;
     956    if (ThemeMac::drawCellOrFocusRingWithViewIntoContext(popupButton, paintInfo.context, inflatedRect, view, shouldDrawCell, shouldDrawFocusRing, shouldUseImageBuffer, deviceScaleFactor))
     957        page->focusController().setFocusedElementNeedsRepaint();
    955958
    956959    [popupButton setControlView:nil];
Note: See TracChangeset for help on using the changeset viewer.