⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 264298 in webkit


Ignore:
Timestamp:
Jul 13, 2020, 5:17:04 AM (6 years ago)
Author:
Carlos Garcia Campos
Message:

[WPE][GTK4] Form controls are not painted when using threaded rendering
​https://bugs.webkit.org/show_bug.cgi?id=214178

Reviewed by Žan Doberšek.

Which is the default for GTK4 since r263888. The problem is that RenderTheme::paint() returns early if the given
GraphicsContext doesn't have a platform context, assuming all RenderTheme implementations paint directly to the
platform context. This patch adds a pure virtual canPaint() to RenderTheme to be used as the early return.

  • rendering/RenderTheme.cpp:

(WebCore::RenderTheme::paint):

  • rendering/RenderTheme.h:
  • rendering/RenderThemeAdwaita.h:
  • rendering/RenderThemeCocoa.h:
  • rendering/RenderThemeCocoa.mm:

(WebCore::RenderThemeCocoa::canPaint const):

  • rendering/RenderThemePlayStation.h:
  • rendering/RenderThemeWin.h:
Location:
trunk/Source/WebCore
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r264296 r264298  
     12020-07-13  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [WPE][GTK4] Form controls are not painted when using threaded rendering
     4        https://bugs.webkit.org/show_bug.cgi?id=214178
     5
     6        Reviewed by Žan Doberšek.
     7
     8        Which is the default for GTK4 since r263888. The problem is that RenderTheme::paint() returns early if the given
     9        GraphicsContext doesn't have a platform context, assuming all RenderTheme implementations paint directly to the
     10        platform context. This patch adds a pure virtual canPaint() to RenderTheme to be used as the early return.
     11
     12        * rendering/RenderTheme.cpp:
     13        (WebCore::RenderTheme::paint):
     14        * rendering/RenderTheme.h:
     15        * rendering/RenderThemeAdwaita.h:
     16        * rendering/RenderThemeCocoa.h:
     17        * rendering/RenderThemeCocoa.mm:
     18        (WebCore::RenderThemeCocoa::canPaint const):
     19        * rendering/RenderThemePlayStation.h:
     20        * rendering/RenderThemeWin.h:
     21
    1222020-07-13  Xabier Rodriguez Calvar  <calvaris@igalia.com>
    223
  • trunk/Source/WebCore/rendering/RenderTheme.cpp

    r264050 r264298  
    296296        return false;
    297297
    298     if (UNLIKELY(!paintInfo.context().hasPlatformContext()))
     298    if (UNLIKELY(!canPaint(paintInfo)))
    299299        return false;
    300300
  • trunk/Source/WebCore/rendering/RenderTheme.h

    r264027 r264298  
    277277
    278278protected:
     279    virtual bool canPaint(const PaintInfo&) const = 0;
    279280    virtual FontCascadeDescription& cachedSystemFontDescription(CSSValueID systemFontID) const;
    280281    virtual void updateCachedSystemFontDescription(CSSValueID systemFontID, FontCascadeDescription&) const = 0;
  • trunk/Source/WebCore/rendering/RenderThemeAdwaita.h

    r258698 r264298  
    3535
    3636private:
     37    bool canPaint(const PaintInfo&) const final { return true; }
     38
    3739    String extraDefaultStyleSheet() final;
    3840#if ENABLE(VIDEO)
  • trunk/Source/WebCore/rendering/RenderThemeCocoa.h

    r263255 r264298  
    4040
    4141private:
     42    bool canPaint(const PaintInfo&) const final;
    4243    bool shouldHaveCapsLockIndicator(const HTMLInputElement&) const final;
    4344
  • trunk/Source/WebCore/rendering/RenderThemeCocoa.mm

    r264006 r264298  
    5353{
    5454    return static_cast<RenderThemeCocoa&>(RenderTheme::singleton());
     55}
     56
     57bool RenderThemeCocoa::canPaint(const PaintInfo& paintInfo) const
     58{
     59    return paintInfo.context().hasPlatformContext();
    5560}
    5661
  • trunk/Source/WebCore/rendering/RenderThemePlayStation.h

    r238913 r264298  
    3535
    3636private:
     37    bool canPaint(const PaintInfo&) const final { return true; }
     38
    3739    void updateCachedSystemFontDescription(CSSValueID systemFontID, FontCascadeDescription&) const final;
    3840};
  • trunk/Source/WebCore/rendering/RenderThemeWin.h

    r252308 r264298  
    142142    virtual ~RenderThemeWin();
    143143
     144    bool canPaint(const PaintInfo&) const final { return true; }
     145
    144146    // System fonts.
    145147    void updateCachedSystemFontDescription(CSSValueID, FontCascadeDescription&) const override;
Note: See TracChangeset for help on using the changeset viewer.