Changeset 233872 in webkit


Ignore:
Timestamp:
Jul 16, 2018 5:17:45 PM (6 years ago)
Author:
commit-queue@webkit.org
Message:

Source/WebCore:
[iOS] When bringing MobileSafari to the foreground, images, which are pending decoding, won't be drawn into the flush immediate transaction
https://bugs.webkit.org/show_bug.cgi?id=187375

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2018-07-16
Reviewed by Simon Fraser.

An immediate-paint transaction should force all the images which are pending
decoding to be repainted.

To do that, FrameView::paintControlTints() will be re-factored to a new
generic function such that it takes PaintInvalidationReasons. The new function
which is named 'traverseForPaintInvalidation' will traverse the render tree
for a specific PaintInvalidationReasons.

invalidateImagesWithAsyncDecodes() will stop the asynchronous decoding for
the underlying image and repaint all the clients which are waiting for the
decoding to finish.

  • loader/cache/CachedImage.cpp:

(WebCore::CachedImage::didRemoveClient):
(WebCore::CachedImage::isClientWaitingForAsyncDecoding const):
(WebCore::CachedImage::addClientWaitingForAsyncDecoding):
(WebCore::CachedImage::removeAllClientsWaitingForAsyncDecoding):
(WebCore::CachedImage::allClientsRemoved):
(WebCore::CachedImage::clear):
(WebCore::CachedImage::createImage):
(WebCore::CachedImage::imageFrameAvailable):
(WebCore::CachedImage::addPendingImageDrawingClient): Deleted.

  • loader/cache/CachedImage.h:
  • page/FrameView.cpp:

(WebCore::FrameView::paintScrollCorner):
(WebCore::FrameView::updateControlTints):
(WebCore::FrameView::traverseForPaintInvalidation):
(WebCore::FrameView::adjustPageHeightDeprecated):
(WebCore::FrameView::paintControlTints): Deleted.

  • page/FrameView.h:
  • platform/ScrollView.cpp:

(WebCore::ScrollView::paint):

  • platform/Scrollbar.cpp:

(WebCore::Scrollbar::paint):

  • platform/graphics/BitmapImage.h:
  • platform/graphics/GraphicsContext.cpp:

(WebCore::GraphicsContext::GraphicsContext):

  • platform/graphics/GraphicsContext.h:

(WebCore::GraphicsContext::performingPaintInvalidation const):
(WebCore::GraphicsContext::invalidatingControlTints const):
(WebCore::GraphicsContext::invalidatingImagesWithAsyncDecodes const):
(WebCore::GraphicsContext::updatingControlTints const): Deleted.

  • rendering/RenderBoxModelObject.cpp:

(WebCore::RenderBoxModelObject::paintFillLayerExtended):

  • rendering/RenderImage.cpp:

(WebCore::RenderImage::paintReplaced):
(WebCore::RenderImage::paintAreaElementFocusRing):
(WebCore::RenderImage::paintIntoRect):

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::paintScrollCorner):
(WebCore::RenderLayer::paintResizer):
(WebCore::RenderLayer::paintLayer):

  • rendering/RenderScrollbar.cpp:

(WebCore::RenderScrollbar::paint):

  • rendering/RenderTheme.cpp:

(WebCore::RenderTheme::paint):

  • testing/Internals.cpp:

(WebCore::Internals::invalidateControlTints):
(WebCore::Internals::paintControlTints): Deleted.

  • testing/Internals.h:
  • testing/Internals.idl:

Source/WebKit:
[iOS] When bringing MobileSafari to the foreground, images, which are pending decoding, won't be drawn into the immediate-paint transaction
https://bugs.webkit.org/show_bug.cgi?id=187375

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2018-07-16
Reviewed by Simon Fraser.

For immediate-paint transaction, we should force all the images which are
pending decoding to be repainted before building this transaction.

  • WebProcess/Plugins/PDF/PDFPlugin.mm:

(WebKit::PDFPlugin::updateControlTints):

  • WebProcess/Plugins/PluginView.cpp:

(WebKit::PluginView::paint):

  • WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:

(WebKit::RemoteLayerTreeDrawingArea::flushLayers):

LayoutTests:
[iOS] When bringing MobileSafari to the foreground, images, which are pending decoding, won't be drawn into the immediate-paint transaction
https://bugs.webkit.org/show_bug.cgi?id=187375

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2018-07-16
Reviewed by Simon Fraser.

The Internals API paintControlTints() is now renamed to invalidateControlTints()
to be consistent with the new enum values and with the new name of the
C++ function.

  • fast/css/webkit-mask-crash-fieldset-legend.html:
  • fast/css/webkit-mask-crash-figure.html:
  • fast/css/webkit-mask-crash-table.html:
  • fast/css/webkit-mask-crash-td-2.html:
  • fast/css/webkit-mask-crash-td.html:
Location:
trunk
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r233871 r233872  
     12018-07-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        [iOS] When bringing MobileSafari to the foreground, images, which are pending decoding, won't be drawn into the immediate-paint transaction
     4        https://bugs.webkit.org/show_bug.cgi?id=187375
     5
     6        Reviewed by Simon Fraser.
     7
     8        The Internals API paintControlTints() is now renamed to invalidateControlTints()
     9        to be consistent with the new enum values and with the new name of the
     10        C++ function.
     11
     12        * fast/css/webkit-mask-crash-fieldset-legend.html:
     13        * fast/css/webkit-mask-crash-figure.html:
     14        * fast/css/webkit-mask-crash-table.html:
     15        * fast/css/webkit-mask-crash-td-2.html:
     16        * fast/css/webkit-mask-crash-td.html:
     17
    1182018-07-16  Truitt Savell  <tsavell@apple.com>
    219
  • trunk/LayoutTests/fast/css/webkit-mask-crash-fieldset-legend.html

    r158113 r233872  
    1212    if (window.internals) {
    1313        testRunner.dumpAsText();
    14         internals.paintControlTints();
     14        internals.invalidateControlTints();
    1515    }
    1616</script>
  • trunk/LayoutTests/fast/css/webkit-mask-crash-figure.html

    r158113 r233872  
    1212    if (window.internals) {
    1313        testRunner.dumpAsText();
    14         internals.paintControlTints();
     14        internals.invalidateControlTints();
    1515    }
    1616</script>
  • trunk/LayoutTests/fast/css/webkit-mask-crash-table.html

    r158113 r233872  
    1212    if (window.internals) {
    1313        testRunner.dumpAsText();
    14         internals.paintControlTints();
     14        internals.invalidateControlTints();
    1515    }
    1616</script>
  • trunk/LayoutTests/fast/css/webkit-mask-crash-td-2.html

    r158113 r233872  
    1010    if (window.internals) {
    1111        testRunner.dumpAsText();
    12         internals.paintControlTints();
     12        internals.invalidateControlTints();
    1313    }
    1414</script>
  • trunk/LayoutTests/fast/css/webkit-mask-crash-td.html

    r158113 r233872  
    1414    if (window.internals) {
    1515        testRunner.dumpAsText();
    16         internals.paintControlTints();
     16        internals.invalidateControlTints();
    1717    }
    1818</script>
  • trunk/Source/WebCore/ChangeLog

    r233870 r233872  
     12018-07-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        [iOS] When bringing MobileSafari to the foreground, images, which are pending decoding, won't be drawn into the flush immediate transaction
     4        https://bugs.webkit.org/show_bug.cgi?id=187375
     5
     6        Reviewed by Simon Fraser.
     7
     8        An immediate-paint transaction should force all the images which are pending
     9        decoding to be repainted.
     10
     11        To do that, FrameView::paintControlTints() will be re-factored to a new
     12        generic function such that it takes PaintInvalidationReasons. The new function
     13        which is named 'traverseForPaintInvalidation' will traverse the render tree
     14        for a specific PaintInvalidationReasons.
     15
     16        invalidateImagesWithAsyncDecodes() will stop the asynchronous decoding for
     17        the underlying image and repaint all the clients which are waiting for the
     18        decoding to finish.
     19
     20        * loader/cache/CachedImage.cpp:
     21        (WebCore::CachedImage::didRemoveClient):
     22        (WebCore::CachedImage::isClientWaitingForAsyncDecoding const):
     23        (WebCore::CachedImage::addClientWaitingForAsyncDecoding):
     24        (WebCore::CachedImage::removeAllClientsWaitingForAsyncDecoding):
     25        (WebCore::CachedImage::allClientsRemoved):
     26        (WebCore::CachedImage::clear):
     27        (WebCore::CachedImage::createImage):
     28        (WebCore::CachedImage::imageFrameAvailable):
     29        (WebCore::CachedImage::addPendingImageDrawingClient): Deleted.
     30        * loader/cache/CachedImage.h:
     31        * page/FrameView.cpp:
     32        (WebCore::FrameView::paintScrollCorner):
     33        (WebCore::FrameView::updateControlTints):
     34        (WebCore::FrameView::traverseForPaintInvalidation):
     35        (WebCore::FrameView::adjustPageHeightDeprecated):
     36        (WebCore::FrameView::paintControlTints): Deleted.
     37        * page/FrameView.h:
     38        * platform/ScrollView.cpp:
     39        (WebCore::ScrollView::paint):
     40        * platform/Scrollbar.cpp:
     41        (WebCore::Scrollbar::paint):
     42        * platform/graphics/BitmapImage.h:
     43        * platform/graphics/GraphicsContext.cpp:
     44        (WebCore::GraphicsContext::GraphicsContext):
     45        * platform/graphics/GraphicsContext.h:
     46        (WebCore::GraphicsContext::performingPaintInvalidation const):
     47        (WebCore::GraphicsContext::invalidatingControlTints const):
     48        (WebCore::GraphicsContext::invalidatingImagesWithAsyncDecodes const):
     49        (WebCore::GraphicsContext::updatingControlTints const): Deleted.
     50        * rendering/RenderBoxModelObject.cpp:
     51        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
     52        * rendering/RenderImage.cpp:
     53        (WebCore::RenderImage::paintReplaced):
     54        (WebCore::RenderImage::paintAreaElementFocusRing):
     55        (WebCore::RenderImage::paintIntoRect):
     56        * rendering/RenderLayer.cpp:
     57        (WebCore::RenderLayer::paintScrollCorner):
     58        (WebCore::RenderLayer::paintResizer):
     59        (WebCore::RenderLayer::paintLayer):
     60        * rendering/RenderScrollbar.cpp:
     61        (WebCore::RenderScrollbar::paint):
     62        * rendering/RenderTheme.cpp:
     63        (WebCore::RenderTheme::paint):
     64        * testing/Internals.cpp:
     65        (WebCore::Internals::invalidateControlTints):
     66        (WebCore::Internals::paintControlTints): Deleted.
     67        * testing/Internals.h:
     68        * testing/Internals.idl:
     69
    1702018-07-16  Ryan Haddad  <ryanhaddad@apple.com>
    271
  • trunk/Source/WebCore/loader/cache/CachedImage.cpp

    r233668 r233872  
    131131
    132132    m_pendingContainerContextRequests.remove(&static_cast<CachedImageClient&>(client));
    133     m_pendingImageDrawingClients.remove(&static_cast<CachedImageClient&>(client));
     133    m_clienstWaitingForAsyncDecoding.remove(&static_cast<CachedImageClient&>(client));
    134134
    135135    if (m_svgImageCache)
     
    141141}
    142142
    143 void CachedImage::addPendingImageDrawingClient(CachedImageClient& client)
     143bool CachedImage::isClientWaitingForAsyncDecoding(CachedImageClient& client) const
     144{
     145    return m_clienstWaitingForAsyncDecoding.contains(&client);
     146}
     147
     148void CachedImage::addClientWaitingForAsyncDecoding(CachedImageClient& client)
    144149{
    145150    ASSERT(client.resourceClientType() == CachedImageClient::expectedType());
    146     if (m_pendingImageDrawingClients.contains(&client))
     151    if (m_clienstWaitingForAsyncDecoding.contains(&client))
    147152        return;
    148153    if (!m_clients.contains(&client)) {
     
    150155        // renderer uses the style of the <body> element, see RenderView::rendererForRootBackground().
    151156        // In this case, the client we are asked to add is the root box renderer. Since we can't add
    152         // a client to m_pendingImageDrawingClients unless it is one of the m_clients, we are going
     157        // a client to m_clienstWaitingForAsyncDecoding unless it is one of the m_clients, we are going
    153158        // to cancel the repaint optimization we do in CachedImage::imageFrameAvailable() by adding
    154         // all the m_clients to m_pendingImageDrawingClients.
     159        // all the m_clients to m_clienstWaitingForAsyncDecoding.
    155160        CachedResourceClientWalker<CachedImageClient> walker(m_clients);
    156161        while (auto* client = walker.next())
    157             m_pendingImageDrawingClients.add(client);
     162            m_clienstWaitingForAsyncDecoding.add(client);
    158163    } else
    159         m_pendingImageDrawingClients.add(&client);
     164        m_clienstWaitingForAsyncDecoding.add(&client);
     165}
     166   
     167void CachedImage::removeAllClientsWaitingForAsyncDecoding()
     168{
     169    if (m_clienstWaitingForAsyncDecoding.isEmpty() || !hasImage() || !is<BitmapImage>(image()))
     170        return;
     171    downcast<BitmapImage>(image())->stopAsyncDecodingQueue();
     172    for (auto* client : m_clienstWaitingForAsyncDecoding)
     173        client->imageChanged(this);
     174    m_clienstWaitingForAsyncDecoding.clear();
    160175}
    161176
     
    182197{
    183198    m_pendingContainerContextRequests.clear();
    184     m_pendingImageDrawingClients.clear();
     199    m_clienstWaitingForAsyncDecoding.clear();
    185200    if (m_image && !errorOccurred())
    186201        m_image->resetAnimation();
     
    324339    clearImage();
    325340    m_pendingContainerContextRequests.clear();
    326     m_pendingImageDrawingClients.clear();
     341    m_clienstWaitingForAsyncDecoding.clear();
    327342    setEncodedSize(0);
    328343}
     
    348363        }
    349364        m_pendingContainerContextRequests.clear();
    350         m_pendingImageDrawingClients.clear();
     365        m_clienstWaitingForAsyncDecoding.clear();
    351366    }
    352367}
     
    613628    while (CachedImageClient* client = clientWalker.next()) {
    614629        // All the clients of animated images have to be notified. The new frame has to be drawn in all of them.
    615         if (animatingState == ImageAnimatingState::No && !m_pendingImageDrawingClients.contains(client))
     630        if (animatingState == ImageAnimatingState::No && !m_clienstWaitingForAsyncDecoding.contains(client))
    616631            continue;
    617632        if (client->imageFrameAvailable(*this, animatingState, changeRect) == VisibleInViewportState::Yes)
     
    623638
    624639    if (decodingStatus != DecodingStatus::Partial)
    625         m_pendingImageDrawingClients.clear();
     640        m_clienstWaitingForAsyncDecoding.clear();
    626641}
    627642
  • trunk/Source/WebCore/loader/cache/CachedImage.h

    r233839 r233872  
    8686    bool isOriginClean(SecurityOrigin*);
    8787
    88     void addPendingImageDrawingClient(CachedImageClient&);
     88    bool isClientWaitingForAsyncDecoding(CachedImageClient&) const;
     89    void addClientWaitingForAsyncDecoding(CachedImageClient&);
     90    void removeAllClientsWaitingForAsyncDecoding();
    8991
    9092    void setForceUpdateImageDataEnabledForTesting(bool enabled) { m_forceUpdateImageDataEnabledForTesting =  enabled; }
     
    171173    ContainerContextRequests m_pendingContainerContextRequests;
    172174
    173     HashSet<CachedImageClient*> m_pendingImageDrawingClients;
     175    HashSet<CachedImageClient*> m_clienstWaitingForAsyncDecoding;
    174176
    175177    RefPtr<CachedImageObserver> m_imageObserver;
  • trunk/Source/WebCore/page/FrameView.cpp

    r233794 r233872  
    38703870void FrameView::paintScrollCorner(GraphicsContext& context, const IntRect& cornerRect)
    38713871{
    3872     if (context.updatingControlTints()) {
     3872    if (context.invalidatingControlTints()) {
    38733873        updateScrollCorner();
    38743874        return;
     
    40074007    RenderView* renderView = this->renderView();
    40084008    if ((renderView && renderView->theme().supportsControlTints()) || hasCustomScrollbars())
    4009         paintControlTints();
     4009        invalidateControlTints();
    40104010
    40114011    if (page)
     
    40134013}
    40144014
    4015 void FrameView::paintControlTints()
     4015void FrameView::traverseForPaintInvalidation(GraphicsContext::PaintInvalidationReasons paintInvalidationReasons)
    40164016{
    40174017    if (needsLayout())
    40184018        layoutContext().layout();
    40194019
    4020     GraphicsContext context(GraphicsContext::NonPaintingReasons::UpdatingControlTints);
     4020    GraphicsContext context(paintInvalidationReasons);
    40214021    if (platformWidget()) {
    40224022        // FIXME: consult paintsEntireContents().
     
    44874487    }
    44884488    // Use a context with painting disabled.
    4489     GraphicsContext context(GraphicsContext::NonPaintingReasons::NoReasons);
     4489    GraphicsContext context(GraphicsContext::PaintInvalidationReasons::None);
    44904490    renderView->setTruncatedAt(static_cast<int>(floorf(oldBottom)));
    44914491    IntRect dirtyRect(0, static_cast<int>(floorf(oldTop)), renderView->layoutOverflowRect().maxX(), static_cast<int>(ceilf(oldBottom - oldTop)));
  • trunk/Source/WebCore/page/FrameView.h

    r233623 r233872  
    2929#include "ContainerNode.h"
    3030#include "FrameViewLayoutContext.h"
     31#include "GraphicsContext.h"
    3132#include "LayoutMilestones.h"
    3233#include "LayoutRect.h"
     
    640641    WEBCORE_EXPORT FrameFlattening effectiveFrameFlattening() const;
    641642
     643    WEBCORE_EXPORT void traverseForPaintInvalidation(GraphicsContext::PaintInvalidationReasons);
     644    void invalidateControlTints() { traverseForPaintInvalidation(GraphicsContext::PaintInvalidationReasons::InvalidatingControlTints); }
     645    void invalidateImagesWithAsyncDecodes() { traverseForPaintInvalidation(GraphicsContext::PaintInvalidationReasons::InvalidatingImagesWithAsyncDecodes); }
     646
    642647protected:
    643648    bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect) final;
     
    682687
    683688    void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow);
    684 
    685     WEBCORE_EXPORT void paintControlTints();
    686689
    687690    void forceLayoutParentViewIfNeeded();
  • trunk/Source/WebCore/platform/ScrollView.cpp

    r233376 r233872  
    11681168    }
    11691169
    1170     if (context.paintingDisabled() && !context.updatingControlTints())
     1170    if (context.paintingDisabled() && !context.performingPaintInvalidation())
    11711171        return;
    11721172
  • trunk/Source/WebCore/platform/Scrollbar.cpp

    r222422 r233872  
    159159void Scrollbar::paint(GraphicsContext& context, const IntRect& damageRect, Widget::SecurityOriginPaintPolicy)
    160160{
    161     if (context.updatingControlTints() && theme().supportsControlTints()) {
     161    if (context.invalidatingControlTints() && theme().supportsControlTints()) {
    162162        invalidate();
    163163        return;
  • trunk/Source/WebCore/platform/graphics/BitmapImage.h

    r232802 r233872  
    110110    void setLargeImageAsyncDecodingEnabledForTesting(bool enabled) { m_largeImageAsyncDecodingEnabledForTesting = enabled; }
    111111    bool isLargeImageAsyncDecodingEnabledForTesting() const { return m_largeImageAsyncDecodingEnabledForTesting; }
     112    void stopAsyncDecodingQueue() { m_source->stopAsyncDecodingQueue(); }
    112113
    113114    WEBCORE_EXPORT unsigned decodeCountForTesting() const;
  • trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp

    r233075 r233872  
    327327}
    328328
    329 GraphicsContext::GraphicsContext(NonPaintingReasons nonPaintingReasons)
    330     : m_nonPaintingReasons(nonPaintingReasons)
     329GraphicsContext::GraphicsContext(PaintInvalidationReasons paintInvalidationReasons)
     330    : m_paintInvalidationReasons(paintInvalidationReasons)
    331331{
    332332}
  • trunk/Source/WebCore/platform/graphics/GraphicsContext.h

    r233814 r233872  
    268268    WEBCORE_EXPORT ~GraphicsContext();
    269269   
    270     enum class NonPaintingReasons {
    271         NoReasons,
    272         UpdatingControlTints
     270    enum class PaintInvalidationReasons : uint8_t {
     271        None,
     272        InvalidatingControlTints,
     273        InvalidatingImagesWithAsyncDecodes
    273274    };
    274     GraphicsContext(NonPaintingReasons);
     275    GraphicsContext(PaintInvalidationReasons);
    275276
    276277    WEBCORE_EXPORT bool hasPlatformContext() const;
     
    278279
    279280    bool paintingDisabled() const { return !m_data && !m_impl; }
    280     bool updatingControlTints() const { return m_nonPaintingReasons == NonPaintingReasons::UpdatingControlTints; }
     281    bool performingPaintInvalidation() const { return m_paintInvalidationReasons != PaintInvalidationReasons::None; }
     282    bool invalidatingControlTints() const { return m_paintInvalidationReasons == PaintInvalidationReasons::InvalidatingControlTints; }
     283    bool invalidatingImagesWithAsyncDecodes() const { return m_paintInvalidationReasons == PaintInvalidationReasons::InvalidatingImagesWithAsyncDecodes; }
    281284
    282285    void setStrokeThickness(float);
     
    639642    Vector<GraphicsContextState, 1> m_stack;
    640643
    641     const NonPaintingReasons m_nonPaintingReasons { NonPaintingReasons::NoReasons };
     644    const PaintInvalidationReasons m_paintInvalidationReasons { PaintInvalidationReasons::None };
    642645    unsigned m_transparencyCount { 0 };
    643646};
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r233869 r233872  
    758758    bool shouldPaintBackgroundImage = bgImage && bgImage->canRender(this, style().effectiveZoom());
    759759   
     760    if (context.invalidatingImagesWithAsyncDecodes()) {
     761        if (shouldPaintBackgroundImage && bgImage->cachedImage()->isClientWaitingForAsyncDecoding(*this))
     762            bgImage->cachedImage()->removeAllClientsWaitingForAsyncDecoding();
     763        return;
     764    }
     765   
    760766    bool forceBackgroundToWhite = false;
    761767    if (document().printing()) {
     
    979985            if (drawResult == ImageDrawResult::DidRequestDecoding) {
    980986                ASSERT(bgImage->isCachedImage());
    981                 bgImage->cachedImage()->addPendingImageDrawingClient(*this);
     987                bgImage->cachedImage()->addClientWaitingForAsyncDecoding(*this);
    982988            }
    983989        }
  • trunk/Source/WebCore/rendering/RenderImage.cpp

    r233315 r233872  
    401401void RenderImage::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
    402402{
     403    GraphicsContext& context = paintInfo.context();
     404    if (context.invalidatingImagesWithAsyncDecodes()) {
     405        if (cachedImage() && cachedImage()->isClientWaitingForAsyncDecoding(*this))
     406            cachedImage()->removeAllClientsWaitingForAsyncDecoding();
     407        return;
     408    }
     409
    403410    auto contentSize = this->contentSize();
    404 
    405     GraphicsContext& context = paintInfo.context();
    406411    float deviceScaleFactor = document().deviceScaleFactor();
    407412    LayoutUnit missingImageBorderWidth(1 / deviceScaleFactor);
     
    533538        return;
    534539   
    535     if (paintInfo.context().paintingDisabled() && !paintInfo.context().updatingControlTints())
     540    if (paintInfo.context().paintingDisabled() && !paintInfo.context().performingPaintInvalidation())
    536541        return;
    537542
     
    615620    auto drawResult = paintInfo.context().drawImage(*img, rect, ImagePaintingOptions(compositeOperator, BlendModeNormal, decodingMode, orientationDescription, interpolation));
    616621    if (drawResult == ImageDrawResult::DidRequestDecoding)
    617         imageResource().cachedImage()->addPendingImageDrawingClient(*this);
     622        imageResource().cachedImage()->addClientWaitingForAsyncDecoding(*this);
    618623
    619624#if USE(SYSTEM_PREVIEW)
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r233851 r233872  
    37013701        return;
    37023702
    3703     if (context.updatingControlTints()) {
     3703    if (context.invalidatingControlTints()) {
    37043704        updateScrollCornerStyle();
    37053705        return;
     
    37613761        return;
    37623762
    3763     if (context.updatingControlTints()) {
     3763    if (context.invalidatingControlTints()) {
    37643764        updateResizerStyle();
    37653765        return;
     
    39663966{
    39673967    if (isComposited()) {
    3968         // The updatingControlTints() painting pass goes through compositing layers,
     3968        // The performingPaintInvalidation() painting pass goes through compositing layers,
    39693969        // but we need to ensure that we don't cache clip rects computed with the wrong root in this case.
    3970         if (context.updatingControlTints() || (paintingInfo.paintBehavior & PaintBehaviorFlattenCompositingLayers))
     3970        if (context.performingPaintInvalidation() || (paintingInfo.paintBehavior & PaintBehaviorFlattenCompositingLayers))
    39713971            paintFlags |= PaintLayerTemporaryClipRects;
    39723972        else if (!backing()->paintsIntoWindow()
  • trunk/Source/WebCore/rendering/RenderScrollbar.cpp

    r232178 r233872  
    103103void RenderScrollbar::paint(GraphicsContext& context, const IntRect& damageRect, Widget::SecurityOriginPaintPolicy)
    104104{
    105     if (context.updatingControlTints()) {
     105    if (context.invalidatingControlTints()) {
    106106        updateScrollbarParts();
    107107        return;
  • trunk/Source/WebCore/rendering/RenderTheme.cpp

    r233814 r233872  
    276276    // If we are updating control tints, just schedule a repaint if the theme supports tinting
    277277    // for that control.
    278     if (paintInfo.context().updatingControlTints()) {
     278    if (paintInfo.context().invalidatingControlTints()) {
    279279        if (controlSupportsTints(box))
    280280            box.repaint();
  • trunk/Source/WebCore/testing/Internals.cpp

    r233671 r233872  
    18111811}
    18121812
    1813 ExceptionOr<void> Internals::paintControlTints()
     1813ExceptionOr<void> Internals::invalidateControlTints()
    18141814{
    18151815    Document* document = contextDocument();
     
    18171817        return Exception { InvalidAccessError };
    18181818
    1819     document->view()->paintControlTints();
     1819    document->view()->invalidateControlTints();
    18201820    return { };
    18211821}
  • trunk/Source/WebCore/testing/Internals.h

    r233671 r233872  
    254254    ExceptionOr<String> autofillFieldName(Element&);
    255255
    256     ExceptionOr<void> paintControlTints();
     256    ExceptionOr<void> invalidateControlTints();
    257257
    258258    RefPtr<Range> rangeFromLocationAndLength(Element& scope, int rangeLocation, int rangeLength);
  • trunk/Source/WebCore/testing/Internals.idl

    r233671 r233872  
    238238    [MayThrowException] DOMString autofillFieldName(Element formControlElement);
    239239
    240     [MayThrowException] void paintControlTints();
     240    [MayThrowException] void invalidateControlTints();
    241241
    242242    [MayThrowException] void scrollElementToRect(Element element, long x, long y, long w, long h);
  • trunk/Source/WebKit/ChangeLog

    r233869 r233872  
     12018-07-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        [iOS] When bringing MobileSafari to the foreground, images, which are pending decoding, won't be drawn into the immediate-paint transaction
     4        https://bugs.webkit.org/show_bug.cgi?id=187375
     5
     6        Reviewed by Simon Fraser.
     7
     8        For immediate-paint transaction, we should force all the images which are
     9        pending decoding to be repainted before building this transaction.
     10
     11        * WebProcess/Plugins/PDF/PDFPlugin.mm:
     12        (WebKit::PDFPlugin::updateControlTints):
     13        * WebProcess/Plugins/PluginView.cpp:
     14        (WebKit::PluginView::paint):
     15        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
     16        (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
     17
    1182018-07-11  Dean Jackson  <dino@apple.com>
    219
  • trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm

    r233769 r233872  
    12031203void PDFPlugin::updateControlTints(GraphicsContext& graphicsContext)
    12041204{
    1205     ASSERT(graphicsContext.updatingControlTints());
     1205    ASSERT(graphicsContext.invalidatingControlTints());
    12061206
    12071207    if (m_horizontalScrollbar)
  • trunk/Source/WebKit/WebProcess/Plugins/PluginView.cpp

    r232198 r233872  
    789789
    790790    if (context.paintingDisabled()) {
    791         if (context.updatingControlTints())
     791        if (context.invalidatingControlTints())
    792792            m_plugin->updateControlTints(context);
    793793        return;
  • trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm

    r233781 r233872  
    352352    } forPhase:kCATransactionPhasePostCommit];
    353353
     354    if (m_nextFlushIsForImmediatePaint)
     355        m_webPage.mainFrameView()->invalidateImagesWithAsyncDecodes();
     356
    354357    m_webPage.mainFrameView()->flushCompositingStateIncludingSubframes();
    355358
Note: See TracChangeset for help on using the changeset viewer.