Changeset 219620 in webkit


Ignore:
Timestamp:
Jul 18, 2017 12:31:28 PM (7 years ago)
Author:
Matt Lewis
Message:

Unreviewed, rolling out r219610.

This caused an api failure on all platforms for the test
SnapshotImageLargeAsyncDecoding

Reverted changeset:

"Async image decoding for large images should be disabled
after the first time a tile is painted"
https://bugs.webkit.org/show_bug.cgi?id=174451
http://trac.webkit.org/changeset/219610

Location:
trunk
Files:
9 deleted
47 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r219619 r219620  
     12017-07-18  Matt Lewis  <jlewis3@apple.com>
     2
     3        Unreviewed, rolling out r219610.
     4
     5        This caused an api failure on all platforms for the test
     6        SnapshotImageLargeAsyncDecoding
     7
     8        Reverted changeset:
     9
     10        "Async image decoding for large images should be disabled
     11        after the first time a tile is painted"
     12        https://bugs.webkit.org/show_bug.cgi?id=174451
     13        http://trac.webkit.org/changeset/219610
     14
    1152017-07-18  Devin Rousso  <drousso@apple.com>
    216
  • trunk/LayoutTests/fast/images/async-image-background-image-repeated.html

    r219610 r219620  
    5151                var elements = document.getElementsByClassName("image-background");
    5252 
    53                  // Force async image decoding for this image.
    54                 if (window.internals)
    55                     internals.setLargeImageAsyncDecodingEnabledForTesting(image, true);
    56 
    5753                // Change the background of the elements.
    5854                if (window.internals && window.testRunner) {
  • trunk/LayoutTests/fast/images/async-image-background-image.html

    r219610 r219620  
    3434            image.onload = function() {
    3535                var element = document.getElementsByClassName("image-background")[0];
    36 
    37                 // Force async image decoding for this image.
    38                 if (window.internals)
    39                     internals.setLargeImageAsyncDecodingEnabledForTesting(image, true);
    4036 
    4137                // Change the background of the element.
  • trunk/LayoutTests/fast/images/async-image-multiple-clients-repaint.html

    r219610 r219620  
    6666            var image = new Image();
    6767            image.onload = function() {
    68                 // Force async image decoding for this image.
    69                 if (window.internals)
    70                     internals.setLargeImageAsyncDecodingEnabledForTesting(image, true);
    71 
    7268                if (window.internals && window.testRunner) {
    7369                    setElementImageBackground(document.querySelector(".small-box"), image).then(() => {
  • trunk/LayoutTests/platform/ios-wk1/TestExpectations

    r219610 r219620  
    11081108http/tests/cache/disk-cache
    11091109
    1110 # Async image decoding is WK2 only
    1111 fast/images/async-image-background-change.html
    1112 fast/images/async-image-src-change.html
    1113 http/tests/multipart/multipart-async-image.html
    1114 
    11151110# Flaky as of 06/08/2015
    11161111animations/animation-direction-reverse-hardware-opacity.html [ Failure Pass ]
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r219610 r219620  
    156156http/tests/inspector/network/resource-response-source-disk-cache.html
    157157http/tests/inspector/network/resource-sizes-disk-cache.html
    158 
    159 # Async image decoding is WK2 only
    160 fast/images/async-image-background-change.html
    161 fast/images/async-image-src-change.html
    162 http/tests/multipart/multipart-async-image.html
    163158
    164159[ Yosemite+ ] fast/ruby/ruby-expansion-cjk-2.html [ ImageOnlyFailure ]
  • trunk/Source/WebCore/ChangeLog

    r219619 r219620  
     12017-07-18  Matt Lewis  <jlewis3@apple.com>
     2
     3        Unreviewed, rolling out r219610.
     4
     5        This caused an api failure on all platforms for the test
     6        SnapshotImageLargeAsyncDecoding
     7
     8        Reverted changeset:
     9
     10        "Async image decoding for large images should be disabled
     11        after the first time a tile is painted"
     12        https://bugs.webkit.org/show_bug.cgi?id=174451
     13        http://trac.webkit.org/changeset/219610
     14
    1152017-07-18  Devin Rousso  <drousso@apple.com>
    216
  • trunk/Source/WebCore/page/PageOverlayController.cpp

    r219610 r219620  
    361361}
    362362
    363 void PageOverlayController::paintContents(const WebCore::GraphicsLayer* graphicsLayer, WebCore::GraphicsContext& graphicsContext, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& clipRect, GraphicsLayerPaintBehavior)
     363void PageOverlayController::paintContents(const WebCore::GraphicsLayer* graphicsLayer, WebCore::GraphicsContext& graphicsContext, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& clipRect, GraphicsLayerPaintFlags)
    364364{
    365365    for (auto& overlayAndGraphicsLayer : m_overlayGraphicsLayers) {
  • trunk/Source/WebCore/page/PageOverlayController.h

    r219610 r219620  
    8989    // GraphicsLayerClient
    9090    void notifyFlushRequired(const GraphicsLayer*) override;
    91     void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& clipRect, GraphicsLayerPaintBehavior) override;
     91    void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& clipRect, GraphicsLayerPaintFlags) override;
    9292    float deviceScaleFactor() const override;
    9393    bool shouldSkipLayerInDump(const GraphicsLayer*, LayerTreeAsTextBehavior) const override;
  • trunk/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp

    r219610 r219620  
    8686
    8787private:
    88     void paintContents(const GraphicsLayer*, GraphicsContext& context, GraphicsLayerPaintingPhase, const FloatRect& clip, GraphicsLayerPaintBehavior) override
     88    void paintContents(const GraphicsLayer*, GraphicsContext& context, GraphicsLayerPaintingPhase, const FloatRect& clip, GraphicsLayerPaintFlags) override
    8989    {
    9090        GraphicsContextStateSaver stateSaver(context);
  • trunk/Source/WebCore/page/mac/ServicesOverlayController.h

    r219610 r219620  
    8383        // GraphicsLayerClient
    8484        void notifyFlushRequired(const GraphicsLayer*) override;
    85         void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& inClip, GraphicsLayerPaintBehavior) override;
     85        void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& inClip, GraphicsLayerPaintFlags) override;
    8686        float deviceScaleFactor() const override;
    8787
  • trunk/Source/WebCore/page/mac/ServicesOverlayController.mm

    r219610 r219620  
    130130}
    131131
    132 void ServicesOverlayController::Highlight::paintContents(const GraphicsLayer*, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const FloatRect&, GraphicsLayerPaintBehavior)
     132void ServicesOverlayController::Highlight::paintContents(const GraphicsLayer*, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const FloatRect&, GraphicsLayerPaintFlags)
    133133{
    134134    if (!DataDetectorsLibrary())
  • trunk/Source/WebCore/platform/graphics/BitmapImage.h

    r219610 r219620  
    108108    bool shouldUseAsyncDecodingForAnimatedImages() const;
    109109    void setClearDecoderAfterAsyncFrameRequestForTesting(bool value) { m_clearDecoderAfterAsyncFrameRequestForTesting = value; }
    110     void setLargeImageAsyncDecodingEnabledForTesting(bool enabled) { m_largeImageAsyncDecodingEnabledForTesting = enabled; }
    111     bool isLargeImageAsyncDecodingEnabledForTesting() const { return m_largeImageAsyncDecodingEnabledForTesting; }
    112110
    113111    WEBCORE_EXPORT unsigned decodeCountForTesting() const;
     
    226224
    227225    bool m_clearDecoderAfterAsyncFrameRequestForTesting { false };
    228     bool m_largeImageAsyncDecodingEnabledForTesting { false };
    229226
    230227#if !LOG_DISABLED
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp

    r219610 r219620  
    419419}
    420420
    421 void GraphicsLayer::paintGraphicsLayerContents(GraphicsContext& context, const FloatRect& clip, GraphicsLayerPaintBehavior layerPaintBehavior)
     421void GraphicsLayer::paintGraphicsLayerContents(GraphicsContext& context, const FloatRect& clip, GraphicsLayerPaintFlags flags)
    422422{
    423423    FloatSize offset = offsetFromRenderer();
     
    427427    clipRect.move(offset);
    428428
    429     m_client.paintContents(this, context, m_paintingPhase, clipRect, layerPaintBehavior);
     429    m_client.paintContents(this, context, m_paintingPhase, clipRect, flags);
    430430}
    431431
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.h

    r219610 r219620  
    467467
    468468    // Callback from the underlying graphics system to draw layer contents.
    469     void paintGraphicsLayerContents(GraphicsContext&, const FloatRect& clip, GraphicsLayerPaintBehavior = GraphicsLayerPaintAllowAsyncImageDecoding);
     469    void paintGraphicsLayerContents(GraphicsContext&, const FloatRect& clip, GraphicsLayerPaintFlags = GraphicsLayerPaintFlags::AllowAsyncImageDecoding);
    470470
    471471    // For hosting this GraphicsLayer in a native layer hierarchy.
  • trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h

    r219610 r219620  
    7676typedef unsigned LayerTreeAsTextBehavior;
    7777
    78 enum GraphicsLayerPaintFlags {
    79     GraphicsLayerPaintNormal                    = 0,
    80     GraphicsLayerPaintAllowAsyncImageDecoding   = 1 << 0,
    81 };
    82 typedef unsigned GraphicsLayerPaintBehavior;
     78enum class GraphicsLayerPaintFlags { None, AllowAsyncImageDecoding };
    8379   
    8480class GraphicsLayerClient {
     
    9995    virtual void notifyFlushBeforeDisplayRefresh(const GraphicsLayer*) { }
    10096
    101     virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& /* inClip */, GraphicsLayerPaintBehavior) { }
     97    virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& /* inClip */, GraphicsLayerPaintFlags) { }
    10298    virtual void didCommitChangesForLayer(const GraphicsLayer*) const { }
    10399
  • trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp

    r219610 r219620  
    221221    virtual void platformCALayerAnimationStarted(CFTimeInterval beginTime) { }
    222222    virtual GraphicsLayer::CompositingCoordinatesOrientation platformCALayerContentsOrientation() const { return GraphicsLayer::CompositingCoordinatesBottomUp; }
    223     virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect&, GraphicsLayerPaintBehavior) { }
     223    virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect&, GraphicsLayerPaintFlags) { }
    224224    virtual bool platformCALayerShowDebugBorders() const { return false; }
    225225    virtual bool platformCALayerShowRepaintCounter(PlatformCALayer*) const { return false; }
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r219610 r219620  
    15801580}
    15811581
    1582 void GraphicsLayerCA::platformCALayerPaintContents(PlatformCALayer*, GraphicsContext& context, const FloatRect& clip, GraphicsLayerPaintBehavior layerPaintBehavior)
     1582void GraphicsLayerCA::platformCALayerPaintContents(PlatformCALayer*, GraphicsContext& context, const FloatRect& clip, GraphicsLayerPaintFlags flags)
    15831583{
    15841584    m_hasEverPainted = true;
     
    15961596
    15971597    TraceScope tracingScope(PaintLayerStart, PaintLayerEnd);
    1598     paintGraphicsLayerContents(context, clip, layerPaintBehavior);
     1598    paintGraphicsLayerContents(context, clip, flags);
    15991599}
    16001600
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h

    r219610 r219620  
    189189    WEBCORE_EXPORT void platformCALayerAnimationEnded(const String& animationKey) override;
    190190    CompositingCoordinatesOrientation platformCALayerContentsOrientation() const override { return contentsOrientation(); }
    191     WEBCORE_EXPORT void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect& clip, GraphicsLayerPaintBehavior) override;
     191    WEBCORE_EXPORT void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect& clip, GraphicsLayerPaintFlags) override;
    192192    bool platformCALayerShowDebugBorders() const override { return isShowingDebugBorder(); }
    193193    WEBCORE_EXPORT bool platformCALayerShowRepaintCounter(PlatformCALayer*) const override;
    194     int platformCALayerRepaintCount(PlatformCALayer*) const override { return repaintCount(); }
    195194    int platformCALayerIncrementRepaintCount(PlatformCALayer*) override { return incrementRepaintCount(); }
    196195
  • trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h

    r219610 r219620  
    277277    // Functions allows us to share implementation across WebTiledLayer and WebLayer
    278278    static RepaintRectList collectRectsToPaint(CGContextRef, PlatformCALayer*);
    279     static void drawLayerContents(CGContextRef, PlatformCALayer*, RepaintRectList& dirtyRects, GraphicsLayerPaintBehavior);
     279    static void drawLayerContents(CGContextRef, PlatformCALayer*, RepaintRectList& dirtyRects, GraphicsLayerPaintFlags);
    280280    static void drawRepaintIndicator(CGContextRef, PlatformCALayer*, int repaintCount, CGColorRef customBackgroundColor);
    281281    static CGRect frameForLayer(const PlatformLayer*);
  • trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h

    r219610 r219620  
    4444    virtual void platformCALayerAnimationEnded(const String& /*animationKey*/) { }
    4545    virtual GraphicsLayer::CompositingCoordinatesOrientation platformCALayerContentsOrientation() const { return GraphicsLayer::CompositingCoordinatesTopDown; }
    46     virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect& inClip, GraphicsLayerPaintBehavior) = 0;
     46    virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect& inClip, GraphicsLayerPaintFlags) = 0;
    4747    virtual bool platformCALayerShowDebugBorders() const { return false; }
    4848    virtual bool platformCALayerShowRepaintCounter(PlatformCALayer*) const { return false; }
    49     virtual int platformCALayerRepaintCount(PlatformCALayer*) const { return 0; }
    5049    virtual int platformCALayerIncrementRepaintCount(PlatformCALayer*) { return 0; }
    5150   
  • trunk/Source/WebCore/platform/graphics/ca/TileCoverageMap.cpp

    r219610 r219620  
    153153}
    154154
    155 void TileCoverageMap::platformCALayerPaintContents(PlatformCALayer* platformCALayer, GraphicsContext& context, const FloatRect&, GraphicsLayerPaintBehavior)
     155void TileCoverageMap::platformCALayerPaintContents(PlatformCALayer* platformCALayer, GraphicsContext& context, const FloatRect&, GraphicsLayerPaintFlags)
    156156{
    157157    ASSERT_UNUSED(platformCALayer, platformCALayer == m_layer.ptr());
  • trunk/Source/WebCore/platform/graphics/ca/TileCoverageMap.h

    r219610 r219620  
    6262    bool platformCALayerContentsOpaque() const override { return true; }
    6363    bool platformCALayerDrawsContent() const override { return true; }
    64     void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect&, GraphicsLayerPaintBehavior) override;
     64    void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect&, GraphicsLayerPaintFlags) override;
    6565    float platformCALayerDeviceScaleFactor() const override;
    6666
  • trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp

    r219610 r219620  
    713713}
    714714
    715 void TileGrid::platformCALayerPaintContents(PlatformCALayer* platformCALayer, GraphicsContext& context, const FloatRect&, GraphicsLayerPaintBehavior layerPaintBehavior)
     715void TileGrid::platformCALayerPaintContents(PlatformCALayer* platformCALayer, GraphicsContext& context, const FloatRect&, GraphicsLayerPaintFlags flags)
    716716{
    717717#if PLATFORM(IOS)
     
    720720#endif
    721721
    722     if (platformCALayerRepaintCount(platformCALayer))
    723         layerPaintBehavior &= ~GraphicsLayerPaintAllowAsyncImageDecoding;
    724 
    725722    {
    726723        GraphicsContextStateSaver stateSaver(context);
     
    731728
    732729        PlatformCALayer::RepaintRectList dirtyRects = PlatformCALayer::collectRectsToPaint(context.platformContext(), platformCALayer);
    733         PlatformCALayer::drawLayerContents(context.platformContext(), &m_controller.rootLayer(), dirtyRects, layerPaintBehavior);
     730        PlatformCALayer::drawLayerContents(context.platformContext(), &m_controller.rootLayer(), dirtyRects, flags);
    734731    }
    735732
     
    772769}
    773770
    774 int TileGrid::platformCALayerRepaintCount(PlatformCALayer* platformCALayer) const
    775 {
    776     const auto it = m_tileRepaintCounts.find(platformCALayer);
    777     return it != m_tileRepaintCounts.end() ? it->value : 0;
    778 }
    779 
    780771int TileGrid::platformCALayerIncrementRepaintCount(PlatformCALayer* platformCALayer)
    781772{
  • trunk/Source/WebCore/platform/graphics/ca/TileGrid.h

    r219610 r219620  
    144144
    145145    // PlatformCALayerClient
    146     void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect&, GraphicsLayerPaintBehavior) override;
     146    void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect&, GraphicsLayerPaintFlags) override;
    147147    bool platformCALayerShowDebugBorders() const override;
    148148    bool platformCALayerShowRepaintCounter(PlatformCALayer*) const override;
    149     int platformCALayerRepaintCount(PlatformCALayer*) const override;
    150149    int platformCALayerIncrementRepaintCount(PlatformCALayer*) override;
    151150    bool platformCALayerContentsOpaque() const override;
  • trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm

    r219610 r219620  
    11201120}
    11211121
    1122 void PlatformCALayer::drawLayerContents(CGContextRef context, WebCore::PlatformCALayer* platformCALayer, RepaintRectList& dirtyRects, GraphicsLayerPaintBehavior layerPaintBehavior)
     1122void PlatformCALayer::drawLayerContents(CGContextRef context, WebCore::PlatformCALayer* platformCALayer, RepaintRectList& dirtyRects, GraphicsLayerPaintFlags flags)
    11231123{
    11241124    WebCore::PlatformCALayerClient* layerContents = platformCALayer->owner();
    11251125    if (!layerContents)
    11261126        return;
    1127 
    1128     if (layerContents->platformCALayerRepaintCount(platformCALayer))
    1129         layerPaintBehavior &= ~GraphicsLayerPaintAllowAsyncImageDecoding;
    1130 
     1127   
    11311128#if PLATFORM(IOS)
    11321129    WKSetCurrentGraphicsContext(context);
     
    11701167            graphicsContext.clip(rect);
    11711168           
    1172             layerContents->platformCALayerPaintContents(platformCALayer, graphicsContext, rect, layerPaintBehavior);
     1169            layerContents->platformCALayerPaintContents(platformCALayer, graphicsContext, rect, flags);
    11731170        }
    11741171       
  • trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp

    r219610 r219620  
    110110}
    111111
    112 void PlatformCALayer::drawLayerContents(CGContextRef context, WebCore::PlatformCALayer* platformCALayer, RepaintRectList&, GraphicsLayerPaintBehavior)
     112void PlatformCALayer::drawLayerContents(CGContextRef context, WebCore::PlatformCALayer* platformCALayer, RepaintRectList&, GraphicsLayerPaintFlags)
    113113{
    114114    intern(platformCALayer)->displayCallback(platformCALayer->platformLayer(), context);
  • trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp

    r219610 r219620  
    105105    CGRect clipBounds = CGContextGetClipBoundingBox(context);
    106106    IntRect clip(enclosingIntRect(clipBounds));
    107     client->platformCALayerPaintContents(owner(), graphicsContext, clip, GraphicsLayerPaintNormal);
     107    client->platformCALayerPaintContents(owner(), graphicsContext, clip, GraphicsLayerPaintFlags::None);
    108108
    109109    if (client->platformCALayerShowRepaintCounter(owner())
  • trunk/Source/WebCore/platform/graphics/ca/win/WebTiledBackingLayerWin.cpp

    r219610 r219620  
    9696    CGRect clipBounds = CGContextGetClipBoundingBox(context);
    9797    IntRect clip(enclosingIntRect(clipBounds));
    98     client->platformCALayerPaintContents(owner(), graphicsContext, clip, GraphicsLayerPaintNormal);
     98    client->platformCALayerPaintContents(owner(), graphicsContext, clip, GraphicsLayerPaintFlags::None);
    9999
    100100    if (client->platformCALayerShowRepaintCounter(owner())) {
  • trunk/Source/WebCore/platform/graphics/mac/WebLayer.mm

    r219610 r219620  
    5858    if (layer) {
    5959        PlatformCALayer::RepaintRectList rectsToPaint = PlatformCALayer::collectRectsToPaint(context, layer);
    60         PlatformCALayer::drawLayerContents(context, layer, rectsToPaint, self.isRenderingInContext ? GraphicsLayerPaintNormal : GraphicsLayerPaintAllowAsyncImageDecoding);
     60        PlatformCALayer::drawLayerContents(context, layer, rectsToPaint, self.isRenderingInContext ? GraphicsLayerPaintFlags::None : GraphicsLayerPaintFlags::AllowAsyncImageDecoding);
    6161    }
    6262}
     
    138138
    139139        FloatRect clipBounds = CGContextGetClipBoundingBox(context);
    140         layer->owner()->platformCALayerPaintContents(layer, graphicsContext, clipBounds, self.isRenderingInContext ? GraphicsLayerPaintNormal : GraphicsLayerPaintAllowAsyncImageDecoding);
     140        layer->owner()->platformCALayerPaintContents(layer, graphicsContext, clipBounds, self.isRenderingInContext ? GraphicsLayerPaintFlags::None : GraphicsLayerPaintFlags::AllowAsyncImageDecoding);
    141141    }
    142142}
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r219610 r219620  
    325325        return DecodingMode::Synchronous;
    326326#endif
    327     if (bitmapImage.isLargeImageAsyncDecodingEnabledForTesting())
    328         return DecodingMode::Asynchronous;
    329327    if (document().isImageDocument())
    330328        return DecodingMode::Synchronous;
     
    334332        return DecodingMode::Synchronous;
    335333    if (paintInfo.paintBehavior & PaintBehaviorAllowAsyncImageDecoding)
    336         return DecodingMode::Asynchronous;
    337     // FIXME: isVisibleInViewport() is not cheap. We need a way to make this condition faster.
    338     if (!isVisibleInViewport())
    339334        return DecodingMode::Asynchronous;
    340335    return DecodingMode::Synchronous;
  • trunk/Source/WebCore/rendering/RenderElement.h

    r219610 r219620  
    288288   
    289289    bool noLongerAffectsParentBlock() const { return s_noLongerAffectsParentBlock; }
    290     bool isVisibleInViewport() const;
    291290
    292291private:
     
    318317    void invalidateCachedFirstLineStyle();
    319318
     319    bool isVisibleInViewport() const;
    320320    bool canDestroyDecodedData() final { return !isVisibleInViewport(); }
    321321    VisibleInViewportState imageFrameAvailable(CachedImage&, ImageAnimatingState, const IntRect* changeRect) final;
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r219610 r219620  
    25702570
    25712571// Up-call from compositing layer drawing callback.
    2572 void RenderLayerBacking::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& context, GraphicsLayerPaintingPhase paintingPhase, const FloatRect& clip, GraphicsLayerPaintBehavior layerPaintBehavior)
     2572void RenderLayerBacking::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& context, GraphicsLayerPaintingPhase paintingPhase, const FloatRect& clip, GraphicsLayerPaintFlags flags)
    25732573{
    25742574#ifndef NDEBUG
     
    25802580    adjustedClipRect.move(m_subpixelOffsetFromRenderer);
    25812581    IntRect dirtyRect = enclosingIntRect(adjustedClipRect);
    2582 
    2583     if (graphicsLayer->repaintCount())
    2584         layerPaintBehavior &= ~GraphicsLayerPaintAllowAsyncImageDecoding;
    25852582
    25862583    if (graphicsLayer == m_graphicsLayer.get()
     
    25972594        // We have to use the same root as for hit testing, because both methods can compute and cache clipRects.
    25982595        PaintBehavior behavior = PaintBehaviorNormal;
    2599         if (layerPaintBehavior == GraphicsLayerPaintAllowAsyncImageDecoding)
     2596        if (flags == GraphicsLayerPaintFlags::AllowAsyncImageDecoding)
    26002597            behavior |= PaintBehaviorAllowAsyncImageDecoding;
    26012598
  • trunk/Source/WebCore/rendering/RenderLayerBacking.h

    r219610 r219620  
    198198    void notifyFlushBeforeDisplayRefresh(const GraphicsLayer*) override;
    199199
    200     void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& clip, GraphicsLayerPaintBehavior) override;
     200    void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& clip, GraphicsLayerPaintFlags) override;
    201201
    202202    float deviceScaleFactor() const override;
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r219610 r219620  
    28962896}
    28972897
    2898 void RenderLayerCompositor::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& context, GraphicsLayerPaintingPhase, const FloatRect& clip, GraphicsLayerPaintBehavior)
     2898void RenderLayerCompositor::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& context, GraphicsLayerPaintingPhase, const FloatRect& clip, GraphicsLayerPaintFlags)
    28992899{
    29002900    IntRect pixelSnappedRectForIntegralPositionedItems = snappedIntRect(LayoutRect(clip));
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.h

    r219610 r219620  
    333333    // GraphicsLayerClient implementation
    334334    void notifyFlushRequired(const GraphicsLayer*) override;
    335     void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect&, GraphicsLayerPaintBehavior) override;
     335    void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect&, GraphicsLayerPaintFlags) override;
    336336    void customPositionForVisibleRectComputation(const GraphicsLayer*, FloatPoint&) const override;
    337337    bool isTrackingRepaints() const override;
  • trunk/Source/WebCore/testing/Internals.cpp

    r219610 r219620  
    739739}
    740740
    741 static Image* imageFromImageElement(HTMLImageElement& element)
     741unsigned Internals::imageFrameIndex(HTMLImageElement& element)
    742742{
    743743    auto* cachedImage = element.cachedImage();
    744     return cachedImage ? cachedImage->image() : nullptr;
    745 }
    746 
    747 static BitmapImage* bitmapImageFromImageElement(HTMLImageElement& element)
    748 {
    749     auto* image = imageFromImageElement(element);
    750     return image && is<BitmapImage>(image) ? &downcast<BitmapImage>(*image) : nullptr;
    751 }
    752 
    753 unsigned Internals::imageFrameIndex(HTMLImageElement& element)
    754 {
    755     auto* bitmapImage = bitmapImageFromImageElement(element);
    756     return bitmapImage ? bitmapImage->currentFrame() : 0;
     744    if (!cachedImage)
     745        return 0;
     746
     747    auto* image = cachedImage->image();
     748    return is<BitmapImage>(image) ? downcast<BitmapImage>(*image).currentFrame() : 0;
    757749}
    758750
    759751void Internals::setImageFrameDecodingDuration(HTMLImageElement& element, float duration)
    760752{
    761     if (auto* bitmapImage = bitmapImageFromImageElement(element))
    762         bitmapImage->setFrameDecodingDurationForTesting(Seconds { duration });
     753    auto* cachedImage = element.cachedImage();
     754    if (!cachedImage)
     755        return;
     756
     757    auto* image = cachedImage->image();
     758    if (!is<BitmapImage>(image))
     759        return;
     760
     761    downcast<BitmapImage>(*image).setFrameDecodingDurationForTesting(Seconds { duration });
    763762}
    764763
    765764void Internals::resetImageAnimation(HTMLImageElement& element)
    766765{
    767     if (auto* image = imageFromImageElement(element))
    768         image->resetAnimation();
     766    auto* cachedImage = element.cachedImage();
     767    if (!cachedImage)
     768        return;
     769
     770    auto* image = cachedImage->image();
     771    if (!is<BitmapImage>(image))
     772        return;
     773
     774    image->resetAnimation();
    769775}
    770776
    771777bool Internals::isImageAnimating(HTMLImageElement& element)
    772778{
    773     auto* image = imageFromImageElement(element);
    774     return image && (image->isAnimating() || image->animationPending());
    775 }
    776 
    777 void Internals::setClearDecoderAfterAsyncFrameRequestForTesting(HTMLImageElement& element, bool enabled)
    778 {
    779     if (auto* bitmapImage = bitmapImageFromImageElement(element))
    780         bitmapImage->setClearDecoderAfterAsyncFrameRequestForTesting(enabled);
     779    auto* cachedImage = element.cachedImage();
     780    if (!cachedImage)
     781        return false;
     782
     783    auto* image = cachedImage->image();
     784    if (!image)
     785        return false;
     786
     787    return image->isAnimating() || image->animationPending();
     788}
     789
     790void Internals::setClearDecoderAfterAsyncFrameRequestForTesting(HTMLImageElement& element, bool value)
     791{
     792    auto* cachedImage = element.cachedImage();
     793    if (!cachedImage)
     794        return;
     795
     796    auto* image = cachedImage->image();
     797    if (!is<BitmapImage>(image))
     798        return;
     799
     800    downcast<BitmapImage>(*image).setClearDecoderAfterAsyncFrameRequestForTesting(value);
    781801}
    782802
    783803unsigned Internals::imageDecodeCount(HTMLImageElement& element)
    784804{
    785     auto* bitmapImage = bitmapImageFromImageElement(element);
    786     return bitmapImage ? bitmapImage->decodeCountForTesting() : 0;
    787 }
    788 
    789 void Internals::setLargeImageAsyncDecodingEnabledForTesting(HTMLImageElement& element, bool enabled)
    790 {
    791     if (auto* bitmapImage = bitmapImageFromImageElement(element))
    792         bitmapImage->setLargeImageAsyncDecodingEnabledForTesting(enabled);
     805    auto* cachedImage = element.cachedImage();
     806    if (!cachedImage)
     807        return 0;
     808
     809    auto* image = cachedImage->image();
     810    if (!is<BitmapImage>(image))
     811        return 0;
     812
     813    return downcast<BitmapImage>(*image).decodeCountForTesting();
    793814}
    794815
  • trunk/Source/WebCore/testing/Internals.h

    r219610 r219620  
    123123    void resetImageAnimation(HTMLImageElement&);
    124124    bool isImageAnimating(HTMLImageElement&);
    125     void setClearDecoderAfterAsyncFrameRequestForTesting(HTMLImageElement&, bool enabled);
     125    void setClearDecoderAfterAsyncFrameRequestForTesting(HTMLImageElement&, bool);
    126126    unsigned imageDecodeCount(HTMLImageElement&);
    127     void setLargeImageAsyncDecodingEnabledForTesting(HTMLImageElement&, bool enabled);
    128127
    129128    void setGridMaxTracksLimit(unsigned);
  • trunk/Source/WebCore/testing/Internals.idl

    r219610 r219620  
    250250    void resetImageAnimation(HTMLImageElement element);
    251251    boolean isImageAnimating(HTMLImageElement element);
    252     void setClearDecoderAfterAsyncFrameRequestForTesting(HTMLImageElement element, boolean enabled);
     252    void setClearDecoderAfterAsyncFrameRequestForTesting(HTMLImageElement element, boolean value);
    253253    unsigned long imageDecodeCount(HTMLImageElement element);
    254     void setLargeImageAsyncDecodingEnabledForTesting(HTMLImageElement element, boolean enabled);
    255254
    256255    void setGridMaxTracksLimit(unsigned long maxTracksLimit);
  • trunk/Source/WebKit/ChangeLog

    r219618 r219620  
     12017-07-18  Matt Lewis  <jlewis3@apple.com>
     2
     3        Unreviewed, rolling out r219610.
     4
     5        This caused an api failure on all platforms for the test
     6        SnapshotImageLargeAsyncDecoding
     7
     8        Reverted changeset:
     9
     10        "Async image decoding for large images should be disabled
     11        after the first time a tile is painted"
     12        https://bugs.webkit.org/show_bug.cgi?id=174451
     13        http://trac.webkit.org/changeset/219610
     14
    1152017-07-18  Andy Estes  <aestes@apple.com>
    216
  • trunk/Source/WebKit/Shared/mac/RemoteLayerBackingStore.mm

    r219610 r219620  
    337337    context.scale(m_scale);
    338338   
    339     auto flags = m_layer->context() && m_layer->context()->nextFlushIsForImmediatePaint() ? WebCore::GraphicsLayerPaintNormal : WebCore::GraphicsLayerPaintAllowAsyncImageDecoding;
     339    auto flags = m_layer->context() && m_layer->context()->nextFlushIsForImmediatePaint() ? WebCore::GraphicsLayerPaintFlags::None : WebCore::GraphicsLayerPaintFlags::AllowAsyncImageDecoding;
    340340   
    341341    // FIXME: This should be moved to PlatformCALayerRemote for better layering.
  • trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp

    r219610 r219620  
    267267}
    268268
    269 void CompositingCoordinator::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const FloatRect& clipRect, GraphicsLayerPaintBehavior)
     269void CompositingCoordinator::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const FloatRect& clipRect, GraphicsLayerPaintFlags)
    270270{
    271271    m_client.paintLayerContents(graphicsLayer, graphicsContext, enclosingIntRect(clipRect));
  • trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h

    r219610 r219620  
    102102    void notifyAnimationStarted(const WebCore::GraphicsLayer*, const String&, double time) override;
    103103    void notifyFlushRequired(const WebCore::GraphicsLayer*) override;
    104     void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& clipRect, WebCore::GraphicsLayerPaintBehavior) override;
     104    void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& clipRect, WebCore::GraphicsLayerPaintFlags) override;
    105105    float deviceScaleFactor() const override;
    106106    float pageScaleFactor() const override;
  • trunk/Source/WebKitLegacy/win/ChangeLog

    r219610 r219620  
     12017-07-18  Matt Lewis  <jlewis3@apple.com>
     2
     3        Unreviewed, rolling out r219610.
     4
     5        This caused an api failure on all platforms for the test
     6        SnapshotImageLargeAsyncDecoding
     7
     8        Reverted changeset:
     9
     10        "Async image decoding for large images should be disabled
     11        after the first time a tile is painted"
     12        https://bugs.webkit.org/show_bug.cgi?id=174451
     13        http://trac.webkit.org/changeset/219610
     14
    1152017-07-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
    216
  • trunk/Source/WebKitLegacy/win/FullscreenVideoController.cpp

    r219610 r219620  
    188188    virtual void platformCALayerAnimationStarted(CFTimeInterval beginTime) { }
    189189    virtual GraphicsLayer::CompositingCoordinatesOrientation platformCALayerContentsOrientation() const { return GraphicsLayer::CompositingCoordinatesBottomUp; }
    190     virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect&, GraphicsLayerPaintBehavior) { }
     190    virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect&, GraphicsLayerPaintFlags) { }
    191191    virtual bool platformCALayerShowDebugBorders() const { return false; }
    192192    virtual bool platformCALayerShowRepaintCounter(PlatformCALayer*) const { return false; }
  • trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp

    r219610 r219620  
    404404}
    405405
    406 void AcceleratedCompositingContext::paintContents(const GraphicsLayer*, GraphicsContext& context, GraphicsLayerPaintingPhase, const FloatRect& rectToPaint, GraphicsLayerPaintBehavior)
     406void AcceleratedCompositingContext::paintContents(const GraphicsLayer*, GraphicsContext& context, GraphicsLayerPaintingPhase, const FloatRect& rectToPaint, GraphicsLayerPaintFlags)
    407407{
    408408    context.save();
  • trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.h

    r219610 r219620  
    5353
    5454    // GraphicsLayerClient
    55     void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& rectToPaint, WebCore::GraphicsLayerPaintBehavior) override;
     55    void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& rectToPaint, WebCore::GraphicsLayerPaintFlags) override;
    5656    float deviceScaleFactor() const override;
    5757
Note: See TracChangeset for help on using the changeset viewer.