Changeset 219620 in webkit
- Timestamp:
- Jul 18, 2017 12:31:28 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 9 deleted
- 47 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r219619 r219620 1 2017-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 1 15 2017-07-18 Devin Rousso <drousso@apple.com> 2 16 -
trunk/LayoutTests/fast/images/async-image-background-image-repeated.html
r219610 r219620 51 51 var elements = document.getElementsByClassName("image-background"); 52 52 53 // Force async image decoding for this image.54 if (window.internals)55 internals.setLargeImageAsyncDecodingEnabledForTesting(image, true);56 57 53 // Change the background of the elements. 58 54 if (window.internals && window.testRunner) { -
trunk/LayoutTests/fast/images/async-image-background-image.html
r219610 r219620 34 34 image.onload = function() { 35 35 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);40 36 41 37 // Change the background of the element. -
trunk/LayoutTests/fast/images/async-image-multiple-clients-repaint.html
r219610 r219620 66 66 var image = new Image(); 67 67 image.onload = function() { 68 // Force async image decoding for this image.69 if (window.internals)70 internals.setLargeImageAsyncDecodingEnabledForTesting(image, true);71 72 68 if (window.internals && window.testRunner) { 73 69 setElementImageBackground(document.querySelector(".small-box"), image).then(() => { -
trunk/LayoutTests/platform/ios-wk1/TestExpectations
r219610 r219620 1108 1108 http/tests/cache/disk-cache 1109 1109 1110 # Async image decoding is WK2 only1111 fast/images/async-image-background-change.html1112 fast/images/async-image-src-change.html1113 http/tests/multipart/multipart-async-image.html1114 1115 1110 # Flaky as of 06/08/2015 1116 1111 animations/animation-direction-reverse-hardware-opacity.html [ Failure Pass ] -
trunk/LayoutTests/platform/mac-wk1/TestExpectations
r219610 r219620 156 156 http/tests/inspector/network/resource-response-source-disk-cache.html 157 157 http/tests/inspector/network/resource-sizes-disk-cache.html 158 159 # Async image decoding is WK2 only160 fast/images/async-image-background-change.html161 fast/images/async-image-src-change.html162 http/tests/multipart/multipart-async-image.html163 158 164 159 [ Yosemite+ ] fast/ruby/ruby-expansion-cjk-2.html [ ImageOnlyFailure ] -
trunk/Source/WebCore/ChangeLog
r219619 r219620 1 2017-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 1 15 2017-07-18 Devin Rousso <drousso@apple.com> 2 16 -
trunk/Source/WebCore/page/PageOverlayController.cpp
r219610 r219620 361 361 } 362 362 363 void PageOverlayController::paintContents(const WebCore::GraphicsLayer* graphicsLayer, WebCore::GraphicsContext& graphicsContext, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& clipRect, GraphicsLayerPaint Behavior)363 void PageOverlayController::paintContents(const WebCore::GraphicsLayer* graphicsLayer, WebCore::GraphicsContext& graphicsContext, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& clipRect, GraphicsLayerPaintFlags) 364 364 { 365 365 for (auto& overlayAndGraphicsLayer : m_overlayGraphicsLayers) { -
trunk/Source/WebCore/page/PageOverlayController.h
r219610 r219620 89 89 // GraphicsLayerClient 90 90 void notifyFlushRequired(const GraphicsLayer*) override; 91 void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& clipRect, GraphicsLayerPaint Behavior) override;91 void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& clipRect, GraphicsLayerPaintFlags) override; 92 92 float deviceScaleFactor() const override; 93 93 bool shouldSkipLayerInDump(const GraphicsLayer*, LayerTreeAsTextBehavior) const override; -
trunk/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp
r219610 r219620 86 86 87 87 private: 88 void paintContents(const GraphicsLayer*, GraphicsContext& context, GraphicsLayerPaintingPhase, const FloatRect& clip, GraphicsLayerPaint Behavior) override88 void paintContents(const GraphicsLayer*, GraphicsContext& context, GraphicsLayerPaintingPhase, const FloatRect& clip, GraphicsLayerPaintFlags) override 89 89 { 90 90 GraphicsContextStateSaver stateSaver(context); -
trunk/Source/WebCore/page/mac/ServicesOverlayController.h
r219610 r219620 83 83 // GraphicsLayerClient 84 84 void notifyFlushRequired(const GraphicsLayer*) override; 85 void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& inClip, GraphicsLayerPaint Behavior) override;85 void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& inClip, GraphicsLayerPaintFlags) override; 86 86 float deviceScaleFactor() const override; 87 87 -
trunk/Source/WebCore/page/mac/ServicesOverlayController.mm
r219610 r219620 130 130 } 131 131 132 void ServicesOverlayController::Highlight::paintContents(const GraphicsLayer*, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const FloatRect&, GraphicsLayerPaint Behavior)132 void ServicesOverlayController::Highlight::paintContents(const GraphicsLayer*, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const FloatRect&, GraphicsLayerPaintFlags) 133 133 { 134 134 if (!DataDetectorsLibrary()) -
trunk/Source/WebCore/platform/graphics/BitmapImage.h
r219610 r219620 108 108 bool shouldUseAsyncDecodingForAnimatedImages() const; 109 109 void setClearDecoderAfterAsyncFrameRequestForTesting(bool value) { m_clearDecoderAfterAsyncFrameRequestForTesting = value; } 110 void setLargeImageAsyncDecodingEnabledForTesting(bool enabled) { m_largeImageAsyncDecodingEnabledForTesting = enabled; }111 bool isLargeImageAsyncDecodingEnabledForTesting() const { return m_largeImageAsyncDecodingEnabledForTesting; }112 110 113 111 WEBCORE_EXPORT unsigned decodeCountForTesting() const; … … 226 224 227 225 bool m_clearDecoderAfterAsyncFrameRequestForTesting { false }; 228 bool m_largeImageAsyncDecodingEnabledForTesting { false };229 226 230 227 #if !LOG_DISABLED -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp
r219610 r219620 419 419 } 420 420 421 void GraphicsLayer::paintGraphicsLayerContents(GraphicsContext& context, const FloatRect& clip, GraphicsLayerPaint Behavior layerPaintBehavior)421 void GraphicsLayer::paintGraphicsLayerContents(GraphicsContext& context, const FloatRect& clip, GraphicsLayerPaintFlags flags) 422 422 { 423 423 FloatSize offset = offsetFromRenderer(); … … 427 427 clipRect.move(offset); 428 428 429 m_client.paintContents(this, context, m_paintingPhase, clipRect, layerPaintBehavior);429 m_client.paintContents(this, context, m_paintingPhase, clipRect, flags); 430 430 } 431 431 -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.h
r219610 r219620 467 467 468 468 // Callback from the underlying graphics system to draw layer contents. 469 void paintGraphicsLayerContents(GraphicsContext&, const FloatRect& clip, GraphicsLayerPaint Behavior = GraphicsLayerPaintAllowAsyncImageDecoding);469 void paintGraphicsLayerContents(GraphicsContext&, const FloatRect& clip, GraphicsLayerPaintFlags = GraphicsLayerPaintFlags::AllowAsyncImageDecoding); 470 470 471 471 // For hosting this GraphicsLayer in a native layer hierarchy. -
trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h
r219610 r219620 76 76 typedef unsigned LayerTreeAsTextBehavior; 77 77 78 enum GraphicsLayerPaintFlags { 79 GraphicsLayerPaintNormal = 0, 80 GraphicsLayerPaintAllowAsyncImageDecoding = 1 << 0, 81 }; 82 typedef unsigned GraphicsLayerPaintBehavior; 78 enum class GraphicsLayerPaintFlags { None, AllowAsyncImageDecoding }; 83 79 84 80 class GraphicsLayerClient { … … 99 95 virtual void notifyFlushBeforeDisplayRefresh(const GraphicsLayer*) { } 100 96 101 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& /* inClip */, GraphicsLayerPaint Behavior) { }97 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& /* inClip */, GraphicsLayerPaintFlags) { } 102 98 virtual void didCommitChangesForLayer(const GraphicsLayer*) const { } 103 99 -
trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp
r219610 r219620 221 221 virtual void platformCALayerAnimationStarted(CFTimeInterval beginTime) { } 222 222 virtual GraphicsLayer::CompositingCoordinatesOrientation platformCALayerContentsOrientation() const { return GraphicsLayer::CompositingCoordinatesBottomUp; } 223 virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect&, GraphicsLayerPaint Behavior) { }223 virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect&, GraphicsLayerPaintFlags) { } 224 224 virtual bool platformCALayerShowDebugBorders() const { return false; } 225 225 virtual bool platformCALayerShowRepaintCounter(PlatformCALayer*) const { return false; } -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r219610 r219620 1580 1580 } 1581 1581 1582 void GraphicsLayerCA::platformCALayerPaintContents(PlatformCALayer*, GraphicsContext& context, const FloatRect& clip, GraphicsLayerPaint Behavior layerPaintBehavior)1582 void GraphicsLayerCA::platformCALayerPaintContents(PlatformCALayer*, GraphicsContext& context, const FloatRect& clip, GraphicsLayerPaintFlags flags) 1583 1583 { 1584 1584 m_hasEverPainted = true; … … 1596 1596 1597 1597 TraceScope tracingScope(PaintLayerStart, PaintLayerEnd); 1598 paintGraphicsLayerContents(context, clip, layerPaintBehavior);1598 paintGraphicsLayerContents(context, clip, flags); 1599 1599 } 1600 1600 -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
r219610 r219620 189 189 WEBCORE_EXPORT void platformCALayerAnimationEnded(const String& animationKey) override; 190 190 CompositingCoordinatesOrientation platformCALayerContentsOrientation() const override { return contentsOrientation(); } 191 WEBCORE_EXPORT void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect& clip, GraphicsLayerPaint Behavior) override;191 WEBCORE_EXPORT void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect& clip, GraphicsLayerPaintFlags) override; 192 192 bool platformCALayerShowDebugBorders() const override { return isShowingDebugBorder(); } 193 193 WEBCORE_EXPORT bool platformCALayerShowRepaintCounter(PlatformCALayer*) const override; 194 int platformCALayerRepaintCount(PlatformCALayer*) const override { return repaintCount(); }195 194 int platformCALayerIncrementRepaintCount(PlatformCALayer*) override { return incrementRepaintCount(); } 196 195 -
trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h
r219610 r219620 277 277 // Functions allows us to share implementation across WebTiledLayer and WebLayer 278 278 static RepaintRectList collectRectsToPaint(CGContextRef, PlatformCALayer*); 279 static void drawLayerContents(CGContextRef, PlatformCALayer*, RepaintRectList& dirtyRects, GraphicsLayerPaint Behavior);279 static void drawLayerContents(CGContextRef, PlatformCALayer*, RepaintRectList& dirtyRects, GraphicsLayerPaintFlags); 280 280 static void drawRepaintIndicator(CGContextRef, PlatformCALayer*, int repaintCount, CGColorRef customBackgroundColor); 281 281 static CGRect frameForLayer(const PlatformLayer*); -
trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h
r219610 r219620 44 44 virtual void platformCALayerAnimationEnded(const String& /*animationKey*/) { } 45 45 virtual GraphicsLayer::CompositingCoordinatesOrientation platformCALayerContentsOrientation() const { return GraphicsLayer::CompositingCoordinatesTopDown; } 46 virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect& inClip, GraphicsLayerPaint Behavior) = 0;46 virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect& inClip, GraphicsLayerPaintFlags) = 0; 47 47 virtual bool platformCALayerShowDebugBorders() const { return false; } 48 48 virtual bool platformCALayerShowRepaintCounter(PlatformCALayer*) const { return false; } 49 virtual int platformCALayerRepaintCount(PlatformCALayer*) const { return 0; }50 49 virtual int platformCALayerIncrementRepaintCount(PlatformCALayer*) { return 0; } 51 50 -
trunk/Source/WebCore/platform/graphics/ca/TileCoverageMap.cpp
r219610 r219620 153 153 } 154 154 155 void TileCoverageMap::platformCALayerPaintContents(PlatformCALayer* platformCALayer, GraphicsContext& context, const FloatRect&, GraphicsLayerPaint Behavior)155 void TileCoverageMap::platformCALayerPaintContents(PlatformCALayer* platformCALayer, GraphicsContext& context, const FloatRect&, GraphicsLayerPaintFlags) 156 156 { 157 157 ASSERT_UNUSED(platformCALayer, platformCALayer == m_layer.ptr()); -
trunk/Source/WebCore/platform/graphics/ca/TileCoverageMap.h
r219610 r219620 62 62 bool platformCALayerContentsOpaque() const override { return true; } 63 63 bool platformCALayerDrawsContent() const override { return true; } 64 void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect&, GraphicsLayerPaint Behavior) override;64 void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect&, GraphicsLayerPaintFlags) override; 65 65 float platformCALayerDeviceScaleFactor() const override; 66 66 -
trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp
r219610 r219620 713 713 } 714 714 715 void TileGrid::platformCALayerPaintContents(PlatformCALayer* platformCALayer, GraphicsContext& context, const FloatRect&, GraphicsLayerPaint Behavior layerPaintBehavior)715 void TileGrid::platformCALayerPaintContents(PlatformCALayer* platformCALayer, GraphicsContext& context, const FloatRect&, GraphicsLayerPaintFlags flags) 716 716 { 717 717 #if PLATFORM(IOS) … … 720 720 #endif 721 721 722 if (platformCALayerRepaintCount(platformCALayer))723 layerPaintBehavior &= ~GraphicsLayerPaintAllowAsyncImageDecoding;724 725 722 { 726 723 GraphicsContextStateSaver stateSaver(context); … … 731 728 732 729 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); 734 731 } 735 732 … … 772 769 } 773 770 774 int TileGrid::platformCALayerRepaintCount(PlatformCALayer* platformCALayer) const775 {776 const auto it = m_tileRepaintCounts.find(platformCALayer);777 return it != m_tileRepaintCounts.end() ? it->value : 0;778 }779 780 771 int TileGrid::platformCALayerIncrementRepaintCount(PlatformCALayer* platformCALayer) 781 772 { -
trunk/Source/WebCore/platform/graphics/ca/TileGrid.h
r219610 r219620 144 144 145 145 // PlatformCALayerClient 146 void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect&, GraphicsLayerPaint Behavior) override;146 void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect&, GraphicsLayerPaintFlags) override; 147 147 bool platformCALayerShowDebugBorders() const override; 148 148 bool platformCALayerShowRepaintCounter(PlatformCALayer*) const override; 149 int platformCALayerRepaintCount(PlatformCALayer*) const override;150 149 int platformCALayerIncrementRepaintCount(PlatformCALayer*) override; 151 150 bool platformCALayerContentsOpaque() const override; -
trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm
r219610 r219620 1120 1120 } 1121 1121 1122 void PlatformCALayer::drawLayerContents(CGContextRef context, WebCore::PlatformCALayer* platformCALayer, RepaintRectList& dirtyRects, GraphicsLayerPaint Behavior layerPaintBehavior)1122 void PlatformCALayer::drawLayerContents(CGContextRef context, WebCore::PlatformCALayer* platformCALayer, RepaintRectList& dirtyRects, GraphicsLayerPaintFlags flags) 1123 1123 { 1124 1124 WebCore::PlatformCALayerClient* layerContents = platformCALayer->owner(); 1125 1125 if (!layerContents) 1126 1126 return; 1127 1128 if (layerContents->platformCALayerRepaintCount(platformCALayer)) 1129 layerPaintBehavior &= ~GraphicsLayerPaintAllowAsyncImageDecoding; 1130 1127 1131 1128 #if PLATFORM(IOS) 1132 1129 WKSetCurrentGraphicsContext(context); … … 1170 1167 graphicsContext.clip(rect); 1171 1168 1172 layerContents->platformCALayerPaintContents(platformCALayer, graphicsContext, rect, layerPaintBehavior);1169 layerContents->platformCALayerPaintContents(platformCALayer, graphicsContext, rect, flags); 1173 1170 } 1174 1171 -
trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp
r219610 r219620 110 110 } 111 111 112 void PlatformCALayer::drawLayerContents(CGContextRef context, WebCore::PlatformCALayer* platformCALayer, RepaintRectList&, GraphicsLayerPaint Behavior)112 void PlatformCALayer::drawLayerContents(CGContextRef context, WebCore::PlatformCALayer* platformCALayer, RepaintRectList&, GraphicsLayerPaintFlags) 113 113 { 114 114 intern(platformCALayer)->displayCallback(platformCALayer->platformLayer(), context); -
trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp
r219610 r219620 105 105 CGRect clipBounds = CGContextGetClipBoundingBox(context); 106 106 IntRect clip(enclosingIntRect(clipBounds)); 107 client->platformCALayerPaintContents(owner(), graphicsContext, clip, GraphicsLayerPaint Normal);107 client->platformCALayerPaintContents(owner(), graphicsContext, clip, GraphicsLayerPaintFlags::None); 108 108 109 109 if (client->platformCALayerShowRepaintCounter(owner()) -
trunk/Source/WebCore/platform/graphics/ca/win/WebTiledBackingLayerWin.cpp
r219610 r219620 96 96 CGRect clipBounds = CGContextGetClipBoundingBox(context); 97 97 IntRect clip(enclosingIntRect(clipBounds)); 98 client->platformCALayerPaintContents(owner(), graphicsContext, clip, GraphicsLayerPaint Normal);98 client->platformCALayerPaintContents(owner(), graphicsContext, clip, GraphicsLayerPaintFlags::None); 99 99 100 100 if (client->platformCALayerShowRepaintCounter(owner())) { -
trunk/Source/WebCore/platform/graphics/mac/WebLayer.mm
r219610 r219620 58 58 if (layer) { 59 59 PlatformCALayer::RepaintRectList rectsToPaint = PlatformCALayer::collectRectsToPaint(context, layer); 60 PlatformCALayer::drawLayerContents(context, layer, rectsToPaint, self.isRenderingInContext ? GraphicsLayerPaint Normal : GraphicsLayerPaintAllowAsyncImageDecoding);60 PlatformCALayer::drawLayerContents(context, layer, rectsToPaint, self.isRenderingInContext ? GraphicsLayerPaintFlags::None : GraphicsLayerPaintFlags::AllowAsyncImageDecoding); 61 61 } 62 62 } … … 138 138 139 139 FloatRect clipBounds = CGContextGetClipBoundingBox(context); 140 layer->owner()->platformCALayerPaintContents(layer, graphicsContext, clipBounds, self.isRenderingInContext ? GraphicsLayerPaint Normal : GraphicsLayerPaintAllowAsyncImageDecoding);140 layer->owner()->platformCALayerPaintContents(layer, graphicsContext, clipBounds, self.isRenderingInContext ? GraphicsLayerPaintFlags::None : GraphicsLayerPaintFlags::AllowAsyncImageDecoding); 141 141 } 142 142 } -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r219610 r219620 325 325 return DecodingMode::Synchronous; 326 326 #endif 327 if (bitmapImage.isLargeImageAsyncDecodingEnabledForTesting())328 return DecodingMode::Asynchronous;329 327 if (document().isImageDocument()) 330 328 return DecodingMode::Synchronous; … … 334 332 return DecodingMode::Synchronous; 335 333 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())339 334 return DecodingMode::Asynchronous; 340 335 return DecodingMode::Synchronous; -
trunk/Source/WebCore/rendering/RenderElement.h
r219610 r219620 288 288 289 289 bool noLongerAffectsParentBlock() const { return s_noLongerAffectsParentBlock; } 290 bool isVisibleInViewport() const;291 290 292 291 private: … … 318 317 void invalidateCachedFirstLineStyle(); 319 318 319 bool isVisibleInViewport() const; 320 320 bool canDestroyDecodedData() final { return !isVisibleInViewport(); } 321 321 VisibleInViewportState imageFrameAvailable(CachedImage&, ImageAnimatingState, const IntRect* changeRect) final; -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r219610 r219620 2570 2570 2571 2571 // Up-call from compositing layer drawing callback. 2572 void RenderLayerBacking::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& context, GraphicsLayerPaintingPhase paintingPhase, const FloatRect& clip, GraphicsLayerPaint Behavior layerPaintBehavior)2572 void RenderLayerBacking::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& context, GraphicsLayerPaintingPhase paintingPhase, const FloatRect& clip, GraphicsLayerPaintFlags flags) 2573 2573 { 2574 2574 #ifndef NDEBUG … … 2580 2580 adjustedClipRect.move(m_subpixelOffsetFromRenderer); 2581 2581 IntRect dirtyRect = enclosingIntRect(adjustedClipRect); 2582 2583 if (graphicsLayer->repaintCount())2584 layerPaintBehavior &= ~GraphicsLayerPaintAllowAsyncImageDecoding;2585 2582 2586 2583 if (graphicsLayer == m_graphicsLayer.get() … … 2597 2594 // We have to use the same root as for hit testing, because both methods can compute and cache clipRects. 2598 2595 PaintBehavior behavior = PaintBehaviorNormal; 2599 if ( layerPaintBehavior == GraphicsLayerPaintAllowAsyncImageDecoding)2596 if (flags == GraphicsLayerPaintFlags::AllowAsyncImageDecoding) 2600 2597 behavior |= PaintBehaviorAllowAsyncImageDecoding; 2601 2598 -
trunk/Source/WebCore/rendering/RenderLayerBacking.h
r219610 r219620 198 198 void notifyFlushBeforeDisplayRefresh(const GraphicsLayer*) override; 199 199 200 void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& clip, GraphicsLayerPaint Behavior) override;200 void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& clip, GraphicsLayerPaintFlags) override; 201 201 202 202 float deviceScaleFactor() const override; -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r219610 r219620 2896 2896 } 2897 2897 2898 void RenderLayerCompositor::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& context, GraphicsLayerPaintingPhase, const FloatRect& clip, GraphicsLayerPaint Behavior)2898 void RenderLayerCompositor::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& context, GraphicsLayerPaintingPhase, const FloatRect& clip, GraphicsLayerPaintFlags) 2899 2899 { 2900 2900 IntRect pixelSnappedRectForIntegralPositionedItems = snappedIntRect(LayoutRect(clip)); -
trunk/Source/WebCore/rendering/RenderLayerCompositor.h
r219610 r219620 333 333 // GraphicsLayerClient implementation 334 334 void notifyFlushRequired(const GraphicsLayer*) override; 335 void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect&, GraphicsLayerPaint Behavior) override;335 void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect&, GraphicsLayerPaintFlags) override; 336 336 void customPositionForVisibleRectComputation(const GraphicsLayer*, FloatPoint&) const override; 337 337 bool isTrackingRepaints() const override; -
trunk/Source/WebCore/testing/Internals.cpp
r219610 r219620 739 739 } 740 740 741 static Image* imageFromImageElement(HTMLImageElement& element)741 unsigned Internals::imageFrameIndex(HTMLImageElement& element) 742 742 { 743 743 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; 757 749 } 758 750 759 751 void Internals::setImageFrameDecodingDuration(HTMLImageElement& element, float duration) 760 752 { 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 }); 763 762 } 764 763 765 764 void Internals::resetImageAnimation(HTMLImageElement& element) 766 765 { 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(); 769 775 } 770 776 771 777 bool Internals::isImageAnimating(HTMLImageElement& element) 772 778 { 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 790 void 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); 781 801 } 782 802 783 803 unsigned Internals::imageDecodeCount(HTMLImageElement& element) 784 804 { 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(); 793 814 } 794 815 -
trunk/Source/WebCore/testing/Internals.h
r219610 r219620 123 123 void resetImageAnimation(HTMLImageElement&); 124 124 bool isImageAnimating(HTMLImageElement&); 125 void setClearDecoderAfterAsyncFrameRequestForTesting(HTMLImageElement&, bool enabled);125 void setClearDecoderAfterAsyncFrameRequestForTesting(HTMLImageElement&, bool); 126 126 unsigned imageDecodeCount(HTMLImageElement&); 127 void setLargeImageAsyncDecodingEnabledForTesting(HTMLImageElement&, bool enabled);128 127 129 128 void setGridMaxTracksLimit(unsigned); -
trunk/Source/WebCore/testing/Internals.idl
r219610 r219620 250 250 void resetImageAnimation(HTMLImageElement element); 251 251 boolean isImageAnimating(HTMLImageElement element); 252 void setClearDecoderAfterAsyncFrameRequestForTesting(HTMLImageElement element, boolean enabled);252 void setClearDecoderAfterAsyncFrameRequestForTesting(HTMLImageElement element, boolean value); 253 253 unsigned long imageDecodeCount(HTMLImageElement element); 254 void setLargeImageAsyncDecodingEnabledForTesting(HTMLImageElement element, boolean enabled);255 254 256 255 void setGridMaxTracksLimit(unsigned long maxTracksLimit); -
trunk/Source/WebKit/ChangeLog
r219618 r219620 1 2017-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 1 15 2017-07-18 Andy Estes <aestes@apple.com> 2 16 -
trunk/Source/WebKit/Shared/mac/RemoteLayerBackingStore.mm
r219610 r219620 337 337 context.scale(m_scale); 338 338 339 auto flags = m_layer->context() && m_layer->context()->nextFlushIsForImmediatePaint() ? WebCore::GraphicsLayerPaint Normal : WebCore::GraphicsLayerPaintAllowAsyncImageDecoding;339 auto flags = m_layer->context() && m_layer->context()->nextFlushIsForImmediatePaint() ? WebCore::GraphicsLayerPaintFlags::None : WebCore::GraphicsLayerPaintFlags::AllowAsyncImageDecoding; 340 340 341 341 // FIXME: This should be moved to PlatformCALayerRemote for better layering. -
trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp
r219610 r219620 267 267 } 268 268 269 void CompositingCoordinator::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const FloatRect& clipRect, GraphicsLayerPaint Behavior)269 void CompositingCoordinator::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const FloatRect& clipRect, GraphicsLayerPaintFlags) 270 270 { 271 271 m_client.paintLayerContents(graphicsLayer, graphicsContext, enclosingIntRect(clipRect)); -
trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h
r219610 r219620 102 102 void notifyAnimationStarted(const WebCore::GraphicsLayer*, const String&, double time) override; 103 103 void notifyFlushRequired(const WebCore::GraphicsLayer*) override; 104 void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& clipRect, WebCore::GraphicsLayerPaint Behavior) override;104 void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& clipRect, WebCore::GraphicsLayerPaintFlags) override; 105 105 float deviceScaleFactor() const override; 106 106 float pageScaleFactor() const override; -
trunk/Source/WebKitLegacy/win/ChangeLog
r219610 r219620 1 2017-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 1 15 2017-07-18 Said Abou-Hallawa <sabouhallawa@apple.com> 2 16 -
trunk/Source/WebKitLegacy/win/FullscreenVideoController.cpp
r219610 r219620 188 188 virtual void platformCALayerAnimationStarted(CFTimeInterval beginTime) { } 189 189 virtual GraphicsLayer::CompositingCoordinatesOrientation platformCALayerContentsOrientation() const { return GraphicsLayer::CompositingCoordinatesBottomUp; } 190 virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect&, GraphicsLayerPaint Behavior) { }190 virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect&, GraphicsLayerPaintFlags) { } 191 191 virtual bool platformCALayerShowDebugBorders() const { return false; } 192 192 virtual bool platformCALayerShowRepaintCounter(PlatformCALayer*) const { return false; } -
trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp
r219610 r219620 404 404 } 405 405 406 void AcceleratedCompositingContext::paintContents(const GraphicsLayer*, GraphicsContext& context, GraphicsLayerPaintingPhase, const FloatRect& rectToPaint, GraphicsLayerPaint Behavior)406 void AcceleratedCompositingContext::paintContents(const GraphicsLayer*, GraphicsContext& context, GraphicsLayerPaintingPhase, const FloatRect& rectToPaint, GraphicsLayerPaintFlags) 407 407 { 408 408 context.save(); -
trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.h
r219610 r219620 53 53 54 54 // GraphicsLayerClient 55 void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& rectToPaint, WebCore::GraphicsLayerPaint Behavior) override;55 void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& rectToPaint, WebCore::GraphicsLayerPaintFlags) override; 56 56 float deviceScaleFactor() const override; 57 57
Note: See TracChangeset
for help on using the changeset viewer.