Changeset 233268 in webkit
- Timestamp:
- Jun 27, 2018 11:22:06 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r233257 r233268 1 2018-06-27 Simon Fraser <simon.fraser@apple.com> 2 3 https://hackernoon.com/ uses lots of layer backing store 4 https://bugs.webkit.org/show_bug.cgi?id=186909 5 rdar://problem/40257540 6 7 Reviewed by Tim Horton. 8 9 New test. 10 11 * compositing/backing/backing-store-attachment-outside-viewport-expected.txt: Added. 12 * compositing/backing/backing-store-attachment-outside-viewport.html: Added. 13 1 14 2018-06-27 Nan Wang <n_wang@apple.com> 2 15 -
trunk/LayoutTests/fast/images/animated-gif-iframe-webkit-transform.html
r179787 r233268 7 7 <p id="description"></p> 8 8 <div id="scroller" style="width: 800px; overflow: hidden"> 9 <div id="scroller-cont" style="height: 245px; width: 1 600px; position: relative; top: 0; left: 0; -webkit-transform: translate(0px, 0px) translateZ(0px);">10 <div id="wrapper1" style="-webkit-transform: translate3d(0px, 0px, 0px); width: 800px; height: 245px; float: left; margin: 0; padding: 0">9 <div id="scroller-cont" style="height: 245px; width: 1410px; position: relative; top: 0; left: 0; -webkit-transform: translate(0px, 0px) translateZ(0px);"> 10 <div id="wrapper1" style="-webkit-transform: translate3d(0px, 0px, 0px); width: 710px; height: 245px; float: left; margin: 0; padding: 0"> 11 11 <iframe id="testFrame1" src="resources/iframe-with-animated-gif.html" style="width: 245px; height: 245px;" onload="frameLoaded()"></iframe> 12 12 </div> 13 <div id="wrapper2" style="-webkit-transform: translate3d(0px, 0px, 0px); width: 800px; height: 245px; float: left; margin: 0; padding: 0">14 <iframe id="testFrame2" src="resources/iframe-with-animated-gif2.html" style=" width: 245px; height: 245px;" onload="frameLoaded()"></iframe>13 <div id="wrapper2" style="-webkit-transform: translate3d(0px, 0px, 0px); width: 700px; height: 245px; float: left; margin: 0; padding: 0"> 14 <iframe id="testFrame2" src="resources/iframe-with-animated-gif2.html" style="margin-left: 100px; width: 245px; height: 245px;" onload="frameLoaded()"></iframe> 15 15 </div> 16 16 </div> … … 53 53 debug("Translating images left so that first image is no longer visible, but second image is."); 54 54 forceLayout(); 55 document.getElementById("scroller-cont").style["-webkit-transform"] = "translate(- 800px, 0px)";55 document.getElementById("scroller-cont").style["-webkit-transform"] = "translate(-610px, 0px)"; 56 56 shouldBecomeEqual("isFirstImagePaused()", "true", checkSecondImageUnpaused); 57 57 } -
trunk/LayoutTests/fast/images/animated-gif-webkit-transform.html
r217950 r233268 5 5 </head> 6 6 <body onload="runTest()"> 7 <div id="scroller" style="width: 800px; overflow: hidden">8 <div id="scroller-cont" style="height: 245px; width: 1 600px; position: relative; top: 0; left: 0; -webkit-transform: translate(0px, 0px) translateZ(0px);">9 <div id="wrapper1" style="-webkit-transform: translate3d(0px, 0px, 0px); width: 800px; height: 245px; float: left; margin: 0; padding: 0">7 <div id="scroller" style="width: 800px; overflow: scroll"> 8 <div id="scroller-cont" style="height: 245px; width: 1410px; position: relative; top: 0; left: 0; -webkit-transform: translate(0px, 0px) translateZ(0px);"> 9 <div id="wrapper1" style="-webkit-transform: translate3d(0px, 0px, 0px); width: 710px; height: 245px; float: left; margin: 0; padding: 0"> 10 10 <img id="a" src="resources/animated.gif"/> 11 11 </div> 12 <div id="wrapper2" style="-webkit-transform: translate3d(0px, 0px, 0px); width: 800px; height: 245px; float: left; margin: 0; padding: 0">13 <img id="b" src="resources/animated-10color.gif" />12 <div id="wrapper2" style="-webkit-transform: translate3d(0px, 0px, 0px); width: 700px; height: 245px; float: left; margin: 0; padding: 0"> 13 <img id="b" src="resources/animated-10color.gif" style="margin-left: 100px;"/> 14 14 </div> 15 15 </div> … … 43 43 debug("Translating images left so that first image is no longer visible, but second image is."); 44 44 forceLayout(); 45 document.getElementById("scroller-cont").style["-webkit-transform"] = "translate(- 800px, 0px)";45 document.getElementById("scroller-cont").style["-webkit-transform"] = "translate(-610px, 0px)"; 46 46 shouldBecomeEqual("isFirstImagePaused()", "true", checkSecondImageUnpaused); 47 47 } -
trunk/Source/WebCore/ChangeLog
r233267 r233268 1 2018-06-27 Simon Fraser <simon.fraser@apple.com> 2 3 https://hackernoon.com/ uses lots of layer backing store 4 https://bugs.webkit.org/show_bug.cgi?id=186909 5 rdar://problem/40257540 6 7 Reviewed by Tim Horton. 8 9 The existing "backing store detached" logic, which was used to eliminate backing store 10 for compositing layers outside the viewport, had a number of bugs that allowed layers 11 to have backing store when they should not. 12 13 Specifically, any code path that ended up in setNeedsDisplay{InRect}() in PlatformCALayer 14 could trigger backing store creation on layers that should have never had any. 15 16 Rather than monkeypatch all the GraphicsLayerCA call sites that call setNeedsDisplay{InRect}(), 17 just bail early from the PlatformCALayer* methods that trigger repaints. 18 19 Tests didn't catch this because they just dumped the state of the backingStoreAttached flag. To fix this, 20 create backingStoreAttachedForTesting() which also tests whether the layer has contents. 21 22 Test: compositing/backing/backing-store-attachment-outside-viewport.html 23 24 * platform/graphics/GraphicsLayer.cpp: 25 (WebCore::GraphicsLayer::dumpProperties const): 26 (showGraphicsLayerTree): 27 * platform/graphics/GraphicsLayer.h: 28 (WebCore::GraphicsLayer::backingStoreAttachedForTesting const): 29 * platform/graphics/GraphicsLayerClient.h: 30 * platform/graphics/ca/GraphicsLayerCA.cpp: 31 (WebCore::GraphicsLayerCA::backingStoreAttachedForTesting const): 32 (WebCore::GraphicsLayerCA::setNeedsDisplay): 33 * platform/graphics/ca/GraphicsLayerCA.h: 34 * platform/graphics/ca/PlatformCALayer.h: 35 * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h: 36 * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: 37 (PlatformCALayerCocoa::setNeedsDisplay): 38 (PlatformCALayerCocoa::setNeedsDisplayInRect): 39 (PlatformCALayerCocoa::hasContents const): 40 1 41 2018-06-27 David Kilzer <ddkilzer@apple.com> 2 42 -
trunk/Source/WebCore/platform/graphics/BitmapImage.cpp
r232802 r233268 391 391 BitmapImage::StartAnimationStatus BitmapImage::internalStartAnimation() 392 392 { 393 LOG_WITH_STREAM(Images, stream << "BitmapImage " << this << " internalStartAnimation"); 394 393 395 if (!canAnimate()) 394 396 return StartAnimationStatus::CannotStart; -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp
r232246 r233268 788 788 789 789 if (behavior & LayerTreeAsTextIncludeBackingStoreAttached) 790 ts << indent << "(backingStoreAttached " << backingStoreAttached () << ")\n";790 ts << indent << "(backingStoreAttached " << backingStoreAttachedForTesting() << ")\n"; 791 791 792 792 if (!m_transform.isIdentity()) { … … 932 932 return; 933 933 934 String output = layer->layerTreeAsText(WebCore::LayerTreeAsText Debug | WebCore::LayerTreeAsTextIncludeVisibleRects | WebCore::LayerTreeAsTextIncludeTileCaches | WebCore::LayerTreeAsTextIncludeContentLayers);934 String output = layer->layerTreeAsText(WebCore::LayerTreeAsTextShowAll); 935 935 fprintf(stderr, "%s\n", output.utf8().data()); 936 936 } -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.h
r233189 r233268 553 553 554 554 virtual bool backingStoreAttached() const { return true; } 555 virtual bool backingStoreAttachedForTesting() const { return backingStoreAttached(); } 555 556 556 557 void setCanDetachBackingStore(bool b) { m_canDetachBackingStore = b; } -
trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h
r229174 r233268 73 73 LayerTreeAsTextIncludeAcceleratesDrawing = 1 << 7, 74 74 LayerTreeAsTextIncludeBackingStoreAttached = 1 << 8, 75 LayerTreeAsTextShowAll = 0xFFFF 75 76 }; 76 77 typedef unsigned LayerTreeAsTextBehavior; -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r233122 r233268 882 882 } 883 883 884 bool GraphicsLayerCA::backingStoreAttachedForTesting() const 885 { 886 return m_layer->backingStoreAttached() || m_layer->hasContents(); 887 } 888 884 889 void GraphicsLayerCA::setNeedsDisplay() 885 890 { 886 891 if (!drawsContent()) 887 return;888 889 if (!backingStoreAttached())890 892 return; 891 893 … … 2349 2351 || commitState.ancestorWithTransformAnimationIntersectsCoverageRect // FIXME: Compute backing exactly for descendants of animating layers. 2350 2352 || (isRunningTransformAnimation() && !animationExtent()); // Create backing if we don't know the animation extent. 2353 2354 LOG_WITH_STREAM(Compositing, stream << "GraphicsLayerCA " << this << " id " << primaryLayerID() << " setBackingStoreAttached: " << requiresBacking); 2351 2355 2352 2356 m_layer->setBackingStoreAttached(requiresBacking); -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
r231840 r233268 265 265 266 266 WEBCORE_EXPORT bool backingStoreAttached() const override; 267 WEBCORE_EXPORT bool backingStoreAttachedForTesting() const override; 267 268 268 269 bool animationIsRunning(const String& animationName) const -
trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h
r229209 r233268 181 181 virtual void setSupportsSubpixelAntialiasedText(bool) = 0; 182 182 183 virtual bool hasContents() const = 0; 183 184 virtual CFTypeRef contents() const = 0; 184 185 virtual void setContents(CFTypeRef) = 0; -
trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h
r229174 r233268 117 117 void setSupportsSubpixelAntialiasedText(bool) override; 118 118 119 bool hasContents() const override; 119 120 CFTypeRef contents() const override; 120 121 void setContents(CFTypeRef) override; -
trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm
r232501 r233268 392 392 void PlatformCALayerCocoa::setNeedsDisplay() 393 393 { 394 if (!m_backingStoreAttached) 395 return; 396 394 397 BEGIN_BLOCK_OBJC_EXCEPTIONS 395 398 [m_layer setNeedsDisplay]; … … 399 402 void PlatformCALayerCocoa::setNeedsDisplayInRect(const FloatRect& dirtyRect) 400 403 { 404 if (!m_backingStoreAttached) 405 return; 406 401 407 BEGIN_BLOCK_OBJC_EXCEPTIONS 402 408 [m_layer setNeedsDisplayInRect:dirtyRect]; … … 639 645 if (attached == m_backingStoreAttached) 640 646 return; 647 641 648 m_backingStoreAttached = attached; 642 649 … … 738 745 739 746 updateContentsFormat(); 747 } 748 749 bool PlatformCALayerCocoa::hasContents() const 750 { 751 return [m_layer contents]; 740 752 } 741 753 -
trunk/Source/WebKit/ChangeLog
r233266 r233268 1 2018-06-27 Simon Fraser <simon.fraser@apple.com> 2 3 https://hackernoon.com/ uses lots of layer backing store 4 https://bugs.webkit.org/show_bug.cgi?id=186909 5 rdar://problem/40257540 6 7 Reviewed by Tim Horton. 8 9 PlatformCALayerRemote was actually holding onto backing stores for layers with 10 backing store detached, which could increase memory use. When told that backing stores 11 are not attached, explicitly throw away the backing, and re-create it (via setNeedsDisplay) 12 when attached. This is now similar to what PlatformLayerCACocoa does. 13 14 * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp: 15 (WebKit::PlatformCALayerRemote::setNeedsDisplayInRect): 16 (WebKit::PlatformCALayerRemote::setNeedsDisplay): 17 (WebKit::PlatformCALayerRemote::hasContents const): 18 * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h: 19 1 20 2018-06-27 Jonathan Bedard <jbedard@apple.com> 2 21 -
trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp
r229209 r233268 191 191 { 192 192 ASSERT(owner()); 193 193 194 ASSERT(m_properties.backingStoreAttached); 195 194 196 if (!m_properties.backingStore) 195 197 m_properties.backingStore = std::make_unique<RemoteLayerBackingStore>(this); … … 203 205 return; 204 206 207 ASSERT(m_properties.backingStoreAttached); 208 205 209 m_properties.backingStore->ensureBackingStore(m_properties.bounds.size(), m_properties.contentsScale, m_acceleratesDrawing, m_wantsDeepColorBackingStore, m_properties.opaque); 206 210 } … … 208 212 void PlatformCALayerRemote::setNeedsDisplayInRect(const FloatRect& rect) 209 213 { 214 if (!m_properties.backingStoreAttached) 215 return; 216 210 217 ensureBackingStore(); 211 218 … … 216 223 void PlatformCALayerRemote::setNeedsDisplay() 217 224 { 225 if (!m_properties.backingStoreAttached) 226 return; 227 218 228 ensureBackingStore(); 219 229 … … 537 547 } 538 548 539 void PlatformCALayerRemote::setBackingStoreAttached(bool value)540 { 541 if (m_properties.backingStoreAttached == value)542 return; 543 544 m_properties.backingStoreAttached = value;549 void PlatformCALayerRemote::setBackingStoreAttached(bool attached) 550 { 551 if (m_properties.backingStoreAttached == attached) 552 return; 553 554 m_properties.backingStoreAttached = attached; 545 555 m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::BackingStoreAttachmentChanged); 556 557 if (attached) 558 setNeedsDisplay(); 559 else 560 m_properties.backingStore = nullptr; 546 561 } 547 562 … … 616 631 void PlatformCALayerRemote::setSupportsSubpixelAntialiasedText(bool) 617 632 { 633 } 634 635 bool PlatformCALayerRemote::hasContents() const 636 { 637 return !!m_properties.backingStore; 618 638 } 619 639 -
trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h
r229174 r233268 121 121 void setSupportsSubpixelAntialiasedText(bool) override; 122 122 123 bool hasContents() const override; 123 124 CFTypeRef contents() const override; 124 125 void setContents(CFTypeRef) override; -
trunk/Source/bmalloc/ChangeLog
r233216 r233268 1 2018-06-27 Simon Fraser <simon.fraser@apple.com> 2 3 https://hackernoon.com/ uses lots of layer backing store 4 https://bugs.webkit.org/show_bug.cgi?id=186909 5 rdar://problem/40257540 6 7 Reviewed by Tim Horton. 8 9 Drive-by typo fix. 10 11 * bmalloc/Scavenger.cpp: 12 (bmalloc::dumpStats): 13 1 14 2018-06-26 Saam Barati <sbarati@apple.com> 2 15 -
trunk/Source/bmalloc/bmalloc/Scavenger.cpp
r232599 r233268 159 159 mach_msg_type_number_t vmSize = TASK_VM_INFO_COUNT; 160 160 if (KERN_SUCCESS == task_info(mach_task_self(), TASK_VM_INFO, (task_info_t)(&vmInfo), &vmSize)) { 161 dump("phys_foot rpint", vmInfo.phys_footprint);161 dump("phys_footprint", vmInfo.phys_footprint); 162 162 dump("internal+compressed", vmInfo.internal + vmInfo.compressed); 163 163 }
Note: See TracChangeset
for help on using the changeset viewer.