Changeset 213721 in webkit
- Timestamp:
- Mar 10, 2017 11:15:23 AM (7 years ago)
- Location:
- tags/Safari-604.1.10
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/Safari-604.1.10/Source/WebCore/ChangeLog
r213712 r213721 1 2017-03-10 Jason Marcell <jmarcell@apple.com> 2 3 Merge r213715. rdar://problem/24709033 4 5 2017-03-10 Commit Queue <commit-queue@webkit.org> 6 7 Unreviewed, rolling out r213618. 8 https://bugs.webkit.org/show_bug.cgi?id=169475 9 10 Suspect this is the cause of a large memory regression 11 (Requested by jonlee_ on #webkit). 12 13 Reverted changeset: 14 15 "Enable async image decoding for large images" 16 https://bugs.webkit.org/show_bug.cgi?id=165039 17 http://trac.webkit.org/changeset/213618 18 1 19 2017-03-10 Antti Koivisto <antti@apple.com> 2 20 -
tags/Safari-604.1.10/Source/WebCore/html/HTMLImageElement.cpp
r213618 r213721 290 290 if (!m_imageLoader.image() && !renderImageResource.cachedImage()) 291 291 renderImage.setImageSizeForAltText(); 292 293 renderImage.registerForAsyncImageDecodingCallback();294 }295 296 void HTMLImageElement::willDetachRenderers()297 {298 if (!is<RenderImage>(renderer()))299 return;300 301 renderer()->unregisterForAsyncImageDecodingCallback();302 292 } 303 293 -
tags/Safari-604.1.10/Source/WebCore/html/HTMLImageElement.h
r213618 r213721 106 106 107 107 void didAttachRenderers() override; 108 void willDetachRenderers() override;109 108 RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override; 110 109 void setBestFitURLAndDPRFromImageCandidate(const ImageCandidate&); -
tags/Safari-604.1.10/Source/WebCore/page/FrameView.cpp
r213712 r213721 1059 1059 1060 1060 renderView->compositor().flushPendingLayerChanges(&rootFrameForFlush == m_frame.ptr()); 1061 1062 if (TiledBacking* tiledBacking = this->tiledBacking())1063 requestAsyncDecodingForImagesInAbsoluteRectIncludingSubframes(tiledBacking->tileCoverageRect());1064 1065 1061 return true; 1066 1062 } … … 2532 2528 viewportContentsChanged(); 2533 2529 } 2534 2535 void FrameView::applyRecursivelyWithAbsoluteRect(const IntRect& rect, const std::function<void(FrameView&, const IntRect&)>& apply)2536 {2537 apply(*this, rect);2538 2539 // Recursive call for subframes. We cache the current FrameView's windowClipRect to avoid recomputing it for every subframe.2540 IntRect windowClipRect = contentsToWindow(rect);2541 SetForScope<IntRect*> windowClipRectCache(m_cachedWindowClipRect, &windowClipRect);2542 for (Frame* childFrame = frame().tree().firstChild(); childFrame; childFrame = childFrame->tree().nextSibling()) {2543 if (auto* childView = childFrame->view())2544 childView->applyRecursivelyWithAbsoluteRect(rect, apply);2545 }2546 }2547 2530 2548 2531 void FrameView::applyRecursivelyWithVisibleRect(const std::function<void (FrameView& frameView, const IntRect& visibleRect)>& apply) … … 2596 2579 applyRecursivelyWithVisibleRect([] (FrameView& frameView, const IntRect& visibleRect) { 2597 2580 frameView.resumeVisibleImageAnimations(visibleRect); 2598 });2599 }2600 2601 void FrameView::requestAsyncDecodingForImagesInAbsoluteRect(const IntRect& rect)2602 {2603 if (!frame().view()) {2604 // The frame is being destroyed.2605 return;2606 }2607 2608 if (rect.isEmpty())2609 return;2610 2611 if (auto* renderView = frame().contentRenderer())2612 renderView->requestAsyncDecodingForImagesInAbsoluteRect(rect);2613 }2614 2615 void FrameView::requestAsyncDecodingForImagesInAbsoluteRectIncludingSubframes(const IntRect& rect)2616 {2617 if (!frame().settings().largeImageAsyncDecodingEnabled())2618 return;2619 2620 applyRecursivelyWithAbsoluteRect(rect, [] (FrameView& frameView, const IntRect& rect) {2621 frameView.requestAsyncDecodingForImagesInAbsoluteRect(rect);2622 2581 }); 2623 2582 } -
tags/Safari-604.1.10/Source/WebCore/page/FrameView.h
r213618 r213721 276 276 void viewportContentsChanged(); 277 277 WEBCORE_EXPORT void resumeVisibleImageAnimationsIncludingSubframes(); 278 void requestAsyncDecodingForImagesInAbsoluteRectIncludingSubframes(const IntRect&);279 278 280 279 String mediaType() const; … … 647 646 void autoSizeIfEnabled(); 648 647 649 void applyRecursivelyWithAbsoluteRect(const IntRect&, const std::function<void(FrameView& frameView, const IntRect& rect)>&);650 648 void applyRecursivelyWithVisibleRect(const std::function<void (FrameView& frameView, const IntRect& visibleRect)>&); 651 649 void resumeVisibleImageAnimations(const IntRect& visibleRect); 652 650 void updateScriptedAnimationsAndTimersThrottlingState(const IntRect& visibleRect); 653 void requestAsyncDecodingForImagesInAbsoluteRect(const IntRect&);654 651 655 652 void updateLayerFlushThrottling(); -
tags/Safari-604.1.10/Source/WebCore/platform/graphics/BitmapImage.cpp
r213618 r213721 68 68 if (!destroyAll) 69 69 m_source.destroyDecodedDataBeforeFrame(m_currentFrame); 70 else if (m_source.has AsyncDecodingQueue())70 else if (m_source.hasDecodingQueue()) 71 71 m_source.destroyAllDecodedDataExcludeFrame(m_currentFrame); 72 72 else … … 75 75 // There's no need to throw away the decoder unless we're explicitly asked 76 76 // to destroy all of the frames. 77 if (!destroyAll || m_source.has AsyncDecodingQueue())77 if (!destroyAll || m_source.hasDecodingQueue()) 78 78 m_source.clearFrameBufferCache(m_currentFrame); 79 79 else … … 104 104 { 105 105 if (!frameHasValidNativeImageAtIndex(index, subsamplingLevel, sizeForDrawing)) { 106 LOG(Images, "BitmapImage::%s - %p - url: %s [subsamplingLevel was %d, resampling]", __FUNCTION__, this, sourceURL(). utf8().data(), static_cast<int>(frameSubsamplingLevelAtIndex(index)));106 LOG(Images, "BitmapImage::%s - %p - url: %s [subsamplingLevel was %d, resampling]", __FUNCTION__, this, sourceURL().characters8(), static_cast<int>(frameSubsamplingLevelAtIndex(index))); 107 107 invalidatePlatformData(); 108 108 } … … 165 165 StartAnimationResult result = internalStartAnimation(); 166 166 167 if (result == StartAnimationResult::DecodingActive && showDebugBackground()) { 168 fillWithSolidColor(context, destRect, Color::yellow, op); 169 return; 170 } 171 172 NativeImagePtr image; 173 if (frameIsBeingDecodedAtIndex(m_currentFrame, m_sizeForDrawing)) { 174 ASSERT(!canAnimate() && !m_currentFrame); 175 m_needsRepaint = true; 176 177 if (!frameHasDecodedNativeImage(m_currentFrame)) { 178 if (showDebugBackground()) 179 fillWithSolidColor(context, destRect, Color::yellow, op); 180 return; 181 } 182 183 image = frameImageAtIndex(m_currentFrame); 184 } else { 185 float scale = subsamplingScale(context, destRect, srcRect); 186 m_currentSubsamplingLevel = allowSubsampling() ? m_source.subsamplingLevelForScale(scale) : SubsamplingLevel::Default; 187 LOG(Images, "BitmapImage::%s - %p - url: %s [subsamplingLevel = %d scale = %.4f]", __FUNCTION__, this, sourceURL().utf8().data(), static_cast<int>(m_currentSubsamplingLevel), scale); 188 189 ASSERT_IMPLIES(result == StartAnimationResult::DecodingActive, m_source.frameHasValidNativeImageAtIndex(m_currentFrame, m_currentSubsamplingLevel, m_sizeForDrawing)); 190 image = frameImageAtIndex(m_currentFrame, m_currentSubsamplingLevel, m_sizeForDrawing, &context); 191 } 192 193 if (!image) // If it's too early we won't have an image yet. 194 return; 195 196 Color color = singlePixelSolidColor(); 167 Color color; 168 if (result == StartAnimationResult::DecodingActive && showDebugBackground()) 169 color = Color::yellow; 170 else 171 color = singlePixelSolidColor(); 172 197 173 if (color.isValid()) { 198 174 fillWithSolidColor(context, destRect, color, op); 199 175 return; 200 176 } 177 178 float scale = subsamplingScale(context, destRect, srcRect); 179 m_currentSubsamplingLevel = allowSubsampling() ? m_source.subsamplingLevelForScale(scale) : SubsamplingLevel::Default; 180 LOG(Images, "BitmapImage::%s - %p - url: %s [m_currentFrame = %ld subsamplingLevel = %d scale = %.4f]", __FUNCTION__, this, sourceURL().characters8(), m_currentFrame, static_cast<int>(m_currentSubsamplingLevel), scale); 181 182 ASSERT_IMPLIES(result == StartAnimationResult::DecodingActive, m_source.frameHasValidNativeImageAtIndex(m_currentFrame, m_currentSubsamplingLevel, m_sizeForDrawing)); 183 auto image = frameImageAtIndex(m_currentFrame, m_currentSubsamplingLevel, m_sizeForDrawing, &context); 184 if (!image) // If it's too early we won't have an image yet. 185 return; 201 186 202 187 ImageOrientation orientation(description.imageOrientation()); … … 283 268 if (m_frameTimer) 284 269 return StartAnimationResult::TimerActive; 285 270 286 271 // Don't start a new animation until we draw the frame that is currently being decoded. 287 272 size_t nextFrame = (m_currentFrame + 1) % frameCount(); 288 273 if (frameIsBeingDecodedAtIndex(nextFrame, m_sizeForDrawing)) { 289 LOG(Images, "BitmapImage::%s - %p - url: %s [nextFrame = %ld is being decoded]", __FUNCTION__, this, sourceURL(). utf8().data(), nextFrame);274 LOG(Images, "BitmapImage::%s - %p - url: %s [nextFrame = %ld is being decoded]", __FUNCTION__, this, sourceURL().characters8(), nextFrame); 290 275 return StartAnimationResult::DecodingActive; 291 276 } … … 333 318 #if !LOG_DISABLED 334 319 if (isAsyncDecode) 335 LOG(Images, "BitmapImage::%s - %p - url: %s [requesting async decoding for nextFrame = %ld]", __FUNCTION__, this, sourceURL(). utf8().data(), nextFrame);320 LOG(Images, "BitmapImage::%s - %p - url: %s [requesting async decoding for nextFrame = %ld]", __FUNCTION__, this, sourceURL().characters8(), nextFrame); 336 321 else 337 LOG(Images, "BitmapImage::%s - %p - url: %s [cachedFrameCount = %ld nextFrame = %ld]", __FUNCTION__, this, sourceURL(). utf8().data(), ++m_cachedFrameCount, nextFrame);322 LOG(Images, "BitmapImage::%s - %p - url: %s [cachedFrameCount = %ld nextFrame = %ld]", __FUNCTION__, this, sourceURL().characters8(), ++m_cachedFrameCount, nextFrame); 338 323 #else 339 324 UNUSED_PARAM(isAsyncDecode); … … 362 347 } 363 348 } 364 349 365 350 // Don't advance to nextFrame unless its decoding has finished or was not required. 366 351 size_t nextFrame = (m_currentFrame + 1) % frameCount(); … … 371 356 if (showDebugBackground()) 372 357 imageObserver()->changedInRect(this); 373 LOG(Images, "BitmapImage::%s - %p - url: %s [lateFrameCount = %ld nextFrame = %ld]", __FUNCTION__, this, sourceURL(). utf8().data(), ++m_lateFrameCount, nextFrame);358 LOG(Images, "BitmapImage::%s - %p - url: %s [lateFrameCount = %ld nextFrame = %ld]", __FUNCTION__, this, sourceURL().characters8(), ++m_lateFrameCount, nextFrame); 374 359 } 375 360 } … … 385 370 imageObserver()->animationAdvanced(this); 386 371 387 LOG(Images, "BitmapImage::%s - %p - url: %s [m_currentFrame = %ld]", __FUNCTION__, this, sourceURL(). utf8().data(), m_currentFrame);372 LOG(Images, "BitmapImage::%s - %p - url: %s [m_currentFrame = %ld]", __FUNCTION__, this, sourceURL().characters8(), m_currentFrame); 388 373 } 389 374 … … 411 396 { 412 397 UNUSED_PARAM(index); 413 if (canAnimate()) { 414 ASSERT(index == (m_currentFrame + 1) % frameCount()); 415 416 // Don't advance to nextFrame unless the timer was fired before its decoding finishes. 417 if (canAnimate() && !m_frameTimer) 418 internalAdvanceAnimation(); 419 else 420 LOG(Images, "BitmapImage::%s - %p - url: %s [earlyFrameCount = %ld nextFrame = %ld]", __FUNCTION__, this, sourceURL().utf8().data(), ++m_earlyFrameCount, index); 421 } else { 422 ASSERT(index == m_currentFrame && !m_currentFrame); 423 424 if (m_needsRepaint) { 425 imageObserver()->changedInRect(this, nullptr); 426 m_needsRepaint = false; 427 } 428 429 // Keep the number of decoding threads under control. 430 if (m_source.isAsyncDecodingQueueIdle()) 431 m_source.stopAsyncDecodingQueue(); 432 } 433 } 434 435 void BitmapImage::requestAsyncDecoding(const IntSize& sizeForDrawing) 436 { 437 if (!isLargeImageAsyncDecodingRequired()) 438 return; 439 440 ASSERT(!m_currentFrame); 441 bool isAsyncDecode = m_source.requestFrameAsyncDecodingAtIndex(0, m_currentSubsamplingLevel, sizeForDrawing); 442 443 #if !LOG_DISABLED 444 if (isAsyncDecode) 445 LOG(Images, "BitmapImage::%s - %p - url: %s", __FUNCTION__, this, sourceURL().utf8().data()); 446 #else 447 UNUSED_PARAM(isAsyncDecode); 448 #endif 398 ASSERT(index == (m_currentFrame + 1) % frameCount()); 399 400 // Don't advance to nextFrame unless the timer was fired before its decoding finishes. 401 if (canAnimate() && !m_frameTimer) 402 internalAdvanceAnimation(); 403 else 404 LOG(Images, "BitmapImage::%s - %p - url: %s [earlyFrameCount = %ld nextFrame = %ld]", __FUNCTION__, this, sourceURL().characters8(), ++m_earlyFrameCount, index); 449 405 } 450 406 -
tags/Safari-604.1.10/Source/WebCore/platform/graphics/BitmapImage.h
r213618 r213721 174 174 void resetAnimation() override; 175 175 void newFrameNativeImageAvailableAtIndex(size_t) override; 176 void requestAsyncDecoding(const IntSize& sizeForDrawing) override;177 176 178 177 // Handle platform-specific data … … 209 208 double m_desiredFrameStartTime { 0 }; // The system time at which we hope to see the next call to startAnimation(). 210 209 bool m_animationFinished { false }; 211 bool m_needsRepaint { false };212 210 213 211 float m_frameDecodingDurationForTesting { 0 }; -
tags/Safari-604.1.10/Source/WebCore/platform/graphics/Image.h
r213618 r213721 131 131 virtual void resetAnimation() {} 132 132 virtual void newFrameNativeImageAvailableAtIndex(size_t) { } 133 virtual void requestAsyncDecoding(const IntSize&) { }134 133 135 134 // Typically the CachedImage that owns us. -
tags/Safari-604.1.10/Source/WebCore/platform/graphics/ImageFrameCache.cpp
r213618 r213721 68 68 ImageFrameCache::~ImageFrameCache() 69 69 { 70 ASSERT(!has AsyncDecodingQueue());70 ASSERT(!hasDecodingQueue()); 71 71 } 72 72 … … 257 257 { 258 258 if (!m_decodingQueue) 259 m_decodingQueue = WorkQueue::create("org.webkit.ImageDecoder", WorkQueue::Type::Serial, WorkQueue::QOS:: Default);259 m_decodingQueue = WorkQueue::create("org.webkit.ImageDecoder", WorkQueue::Type::Serial, WorkQueue::QOS::UserInteractive); 260 260 261 261 return *m_decodingQueue; … … 264 264 void ImageFrameCache::startAsyncDecodingQueue() 265 265 { 266 if (has AsyncDecodingQueue() || !isDecoderAvailable())266 if (hasDecodingQueue() || !isDecoderAvailable()) 267 267 return; 268 268 … … 307 307 return false; 308 308 309 if (!has AsyncDecodingQueue())309 if (!hasDecodingQueue()) 310 310 startAsyncDecodingQueue(); 311 311 … … 315 315 } 316 316 317 bool ImageFrameCache::isAsyncDecodingQueueIdle() const318 {319 for (const ImageFrame& frame : m_frames) {320 if (frame.isBeingDecoded())321 return false;322 }323 return true;324 }325 326 317 void ImageFrameCache::stopAsyncDecodingQueue() 327 318 { 328 if (!has AsyncDecodingQueue())319 if (!hasDecodingQueue()) 329 320 return; 330 321 -
tags/Safari-604.1.10/Source/WebCore/platform/graphics/ImageFrameCache.h
r213618 r213721 72 72 bool requestFrameAsyncDecodingAtIndex(size_t, SubsamplingLevel, const IntSize&); 73 73 void stopAsyncDecodingQueue(); 74 bool hasAsyncDecodingQueue() const { return m_decodingQueue; } 75 bool isAsyncDecodingQueueIdle() const; 74 bool hasDecodingQueue() { return m_decodingQueue; } 76 75 77 76 // Image metadata which is calculated either by the ImageDecoder or directly -
tags/Safari-604.1.10/Source/WebCore/platform/graphics/ImageSource.h
r213618 r213721 71 71 bool isAsyncDecodingRequired(); 72 72 bool requestFrameAsyncDecodingAtIndex(size_t index, SubsamplingLevel subsamplingLevel, const IntSize& sizeForDrawing) { return m_frameCache->requestFrameAsyncDecodingAtIndex(index, subsamplingLevel, sizeForDrawing); } 73 bool hasAsyncDecodingQueue() const { return m_frameCache->hasAsyncDecodingQueue(); } 74 bool isAsyncDecodingQueueIdle() const { return m_frameCache->isAsyncDecodingQueueIdle(); } 73 bool hasDecodingQueue() const { return m_frameCache->hasDecodingQueue(); } 75 74 void stopAsyncDecodingQueue() { m_frameCache->stopAsyncDecodingQueue(); } 76 75 -
tags/Safari-604.1.10/Source/WebCore/platform/graphics/TiledBacking.h
r213618 r213721 146 146 virtual IntRect boundsWithoutMargin() const = 0; 147 147 148 // Exposed for testing 148 149 virtual IntRect tileCoverageRect() const = 0; 150 virtual IntRect tileGridExtent() const = 0; 149 151 virtual void setScrollingModeIndication(ScrollingModeIndication) = 0; 150 151 // Exposed for testing152 virtual IntRect tileGridExtent() const = 0;153 152 154 153 #if USE(CA) -
tags/Safari-604.1.10/Source/WebCore/rendering/RenderElement.cpp
r213618 r213721 155 155 if (isRegisteredForVisibleInViewportCallback()) 156 156 view().unregisterForVisibleInViewportCallback(*this); 157 if (isRegisteredForAsyncImageDecodingCallback())158 view().unregisterForAsyncImageDecodingCallback(*this);159 157 } 160 158 … … 1437 1435 } 1438 1436 1439 bool RenderElement::intersectsAbsoluteRect(const IntRect& rect) const 1440 { 1441 if (style().visibility() != VISIBLE) 1437 static bool shouldRepaintForImageAnimation(const RenderElement& renderer, const IntRect& visibleRect) 1438 { 1439 const Document& document = renderer.document(); 1440 if (document.activeDOMObjectsAreSuspended()) 1442 1441 return false; 1443 if (view().frameView().isOffscreen()) 1442 if (renderer.style().visibility() != VISIBLE) 1443 return false; 1444 if (renderer.view().frameView().isOffscreen()) 1444 1445 return false; 1445 1446 … … 1448 1449 // be propagated to the root. At this point, we unfortunately don't have access to the image anymore so we 1449 1450 // can no longer check if it is a background image. 1450 bool backgroundIsPaintedByRoot = isDocumentElementRenderer();1451 if ( isBody()) {1452 auto& rootRenderer = * parent(); // If <body> has a renderer then <html> does too.1451 bool backgroundIsPaintedByRoot = renderer.isDocumentElementRenderer(); 1452 if (renderer.isBody()) { 1453 auto& rootRenderer = *renderer.parent(); // If <body> has a renderer then <html> does too. 1453 1454 ASSERT(rootRenderer.isDocumentElementRenderer()); 1454 1455 ASSERT(is<HTMLHtmlElement>(rootRenderer.element())); … … 1457 1458 1458 1459 } 1459 LayoutRect backgroundPaintingRect = backgroundIsPaintedByRoot ? view().backgroundRect() : absoluteClippedOverflowRect(); 1460 return rect.intersects(enclosingIntRect(backgroundPaintingRect)); 1460 LayoutRect backgroundPaintingRect = backgroundIsPaintedByRoot ? renderer.view().backgroundRect() : renderer.absoluteClippedOverflowRect(); 1461 if (!visibleRect.intersects(enclosingIntRect(backgroundPaintingRect))) 1462 return false; 1463 1464 return true; 1461 1465 } 1462 1466 … … 1493 1497 auto& frameView = view().frameView(); 1494 1498 auto visibleRect = frameView.windowToContents(frameView.windowClipRect()); 1495 if ( document().activeDOMObjectsAreSuspended() || !intersectsAbsoluteRect(visibleRect)) {1499 if (!shouldRepaintForImageAnimation(*this, visibleRect)) { 1496 1500 // FIXME: It would be better to pass the image along with the renderer 1497 1501 // so that we can be smarter about detecting if the image is inside the … … 1506 1510 { 1507 1511 ASSERT(m_hasPausedImageAnimations); 1508 if ( document().activeDOMObjectsAreSuspended() || !intersectsAbsoluteRect(visibleRect))1512 if (!shouldRepaintForImageAnimation(*this, visibleRect)) 1509 1513 return false; 1510 1514 … … 1516 1520 1517 1521 return true; 1518 }1519 1520 void RenderElement::registerForAsyncImageDecodingCallback()1521 {1522 if (isRegisteredForAsyncImageDecodingCallback())1523 return;1524 1525 view().registerForAsyncImageDecodingCallback(*this);1526 setIsRegisteredForAsyncImageDecodingCallback(true);1527 }1528 1529 void RenderElement::unregisterForAsyncImageDecodingCallback()1530 {1531 if (!isRegisteredForAsyncImageDecodingCallback())1532 return;1533 1534 view().unregisterForAsyncImageDecodingCallback(*this);1535 setIsRegisteredForAsyncImageDecodingCallback(false);1536 1522 } 1537 1523 -
tags/Safari-604.1.10/Source/WebCore/rendering/RenderElement.h
r213618 r213721 139 139 bool borderImageIsLoadedAndCanBeRendered() const; 140 140 bool mayCauseRepaintInsideViewport(const IntRect* visibleRect = nullptr) const; 141 bool intersectsAbsoluteRect(const IntRect&) const;142 141 143 142 // Returns true if this renderer requires a new stacking context. … … 192 191 bool hasPausedImageAnimations() const { return m_hasPausedImageAnimations; } 193 192 void setHasPausedImageAnimations(bool b) { m_hasPausedImageAnimations = b; } 194 195 void registerForAsyncImageDecodingCallback();196 void unregisterForAsyncImageDecodingCallback();197 193 198 194 void setRenderBoxNeedsLazyRepaint(bool b) { m_renderBoxNeedsLazyRepaint = b; } -
tags/Safari-604.1.10/Source/WebCore/rendering/RenderObject.cpp
r213618 r213721 1996 1996 ensureRareData().setVisibleInViewportState(visible); 1997 1997 } 1998 1999 void RenderObject::setIsRegisteredForAsyncImageDecodingCallback(bool registered)2000 {2001 if (registered || hasRareData())2002 ensureRareData().setIsRegisteredForAsyncImageDecodingCallback(registered);2003 }2004 1998 2005 1999 RenderObject::RareDataMap& RenderObject::rareDataMap() -
tags/Safari-604.1.10/Source/WebCore/rendering/RenderObject.h
r213618 r213721 459 459 }; 460 460 VisibleInViewportState visibleInViewportState() { return m_bitfields.hasRareData() ? rareData().visibleInViewportState() : VisibilityUnknown; } 461 462 bool isRegisteredForAsyncImageDecodingCallback() { return m_bitfields.hasRareData() && rareData().isRegisteredForAsyncImageDecodingCallback(); }463 461 464 462 bool hasLayer() const { return m_bitfields.hasLayer(); } … … 572 570 void setIsRegisteredForVisibleInViewportCallback(bool); 573 571 void setVisibleInViewportState(VisibleInViewportState); 574 void setIsRegisteredForAsyncImageDecodingCallback(bool);575 572 576 573 // Hook so that RenderTextControl can return the line height of its inner renderer. … … 989 986 , m_isRegisteredForVisibleInViewportCallback(false) 990 987 , m_visibleInViewportState(VisibilityUnknown) 991 , m_isRegisteredForAsyncImageDecodingCallback(false)992 988 { 993 989 } … … 1000 996 ADD_BOOLEAN_BITFIELD(isRegisteredForVisibleInViewportCallback, IsRegisteredForVisibleInViewportCallback); 1001 997 ADD_ENUM_BITFIELD(visibleInViewportState, VisibleInViewportState, VisibleInViewportState, 2); 1002 ADD_BOOLEAN_BITFIELD(isRegisteredForAsyncImageDecodingCallback, IsRegisteredForAsyncImageDecodingCallback);1003 998 std::unique_ptr<RenderStyle> cachedFirstLineStyle; 1004 999 }; -
tags/Safari-604.1.10/Source/WebCore/rendering/RenderReplaced.h
r213618 r213721 33 33 LayoutUnit computeReplacedLogicalHeight() const override; 34 34 35 LayoutSize intrinsicSize() const final { return m_intrinsicSize; }36 35 LayoutRect replacedContentRect(const LayoutSize& intrinsicSize) const; 37 36 … … 47 46 void layout() override; 48 47 48 LayoutSize intrinsicSize() const final { return m_intrinsicSize; } 49 49 void computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intrinsicRatio) const override; 50 50 -
tags/Safari-604.1.10/Source/WebCore/rendering/RenderView.cpp
r213639 r213721 36 36 #include "HTMLIFrameElement.h" 37 37 #include "HitTestResult.h" 38 #include "Image.h"39 38 #include "ImageQualityController.h" 40 39 #include "NodeTraversal.h" 41 40 #include "Page.h" 42 #include "RenderDescendantIterator.h"43 41 #include "RenderGeometryMap.h" 44 #include "RenderImage.h"45 42 #include "RenderIterator.h" 46 43 #include "RenderLayer.h" … … 1426 1423 } 1427 1424 1428 void RenderView::registerForAsyncImageDecodingCallback(RenderElement& renderer)1429 {1430 ASSERT(!m_asyncDecodingImageRenderers.contains(&renderer));1431 m_asyncDecodingImageRenderers.add(&renderer);1432 }1433 1434 void RenderView::unregisterForAsyncImageDecodingCallback(RenderElement& renderer)1435 {1436 ASSERT(m_asyncDecodingImageRenderers.contains(&renderer));1437 m_asyncDecodingImageRenderers.remove(&renderer);1438 }1439 1440 void RenderView::requestAsyncDecodingForImagesInAbsoluteRect(const IntRect& rect)1441 {1442 for (auto* renderer : m_asyncDecodingImageRenderers) {1443 if (!renderer->intersectsAbsoluteRect(rect))1444 continue;1445 1446 auto& renderImage = downcast<RenderImage>(*renderer);1447 1448 CachedImage* image = renderImage.cachedImage();1449 if (!image || !image->hasImage())1450 continue;1451 1452 // Get the destination rectangle of the image scaled by the all the scaling factors1453 // that will eventually be applied to the graphics context.1454 LayoutRect replacedContentRect = renderImage.replacedContentRect(renderImage.intrinsicSize());1455 FloatRect rect = snapRectToDevicePixels(replacedContentRect, document().deviceScaleFactor());1456 rect.scale(frame().page()->pageScaleFactor() * frame().pageZoomFactor() * document().deviceScaleFactor());1457 1458 image->image()->requestAsyncDecoding(expandedIntSize(rect.size()));1459 }1460 }1461 1462 1425 RenderView::RepaintRegionAccumulator::RepaintRegionAccumulator(RenderView* view) 1463 1426 : m_rootView(view ? view->document().topDocument().renderView() : nullptr) -
tags/Safari-604.1.10/Source/WebCore/rendering/RenderView.h
r213618 r213721 232 232 void addRendererWithPausedImageAnimations(RenderElement&); 233 233 void removeRendererWithPausedImageAnimations(RenderElement&); 234 void registerForAsyncImageDecodingCallback(RenderElement&);235 void unregisterForAsyncImageDecodingCallback(RenderElement&);236 void requestAsyncDecodingForImagesInAbsoluteRect(const IntRect&);237 234 238 235 class RepaintRegionAccumulator { … … 392 389 HashSet<RenderElement*> m_renderersWithPausedImageAnimation; 393 390 HashSet<RenderElement*> m_visibleInViewportRenderers; 394 HashSet<RenderElement*> m_asyncDecodingImageRenderers;395 391 Vector<RefPtr<RenderWidget>> m_protectedRenderWidgets; 396 392 -
tags/Safari-604.1.10/Source/WebKit2/ChangeLog
r213708 r213721 1 2017-03-10 Jason Marcell <jmarcell@apple.com> 2 3 Merge r213715. rdar://problem/24709033 4 5 2017-03-10 Commit Queue <commit-queue@webkit.org> 6 7 Unreviewed, rolling out r213618. 8 https://bugs.webkit.org/show_bug.cgi?id=169475 9 10 Suspect this is the cause of a large memory regression 11 (Requested by jonlee_ on #webkit). 12 13 Reverted changeset: 14 15 "Enable async image decoding for large images" 16 https://bugs.webkit.org/show_bug.cgi?id=165039 17 http://trac.webkit.org/changeset/213618 18 1 19 2017-03-10 Zan Dobersek <zdobersek@igalia.com> 2 20 -
tags/Safari-604.1.10/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
r213676 r213721 1692 1692 } 1693 1693 1694 void WKPreferencesSetLargeImageAsyncDecodingEnabled(WKPreferencesRef preferencesRef, bool flag)1695 {1696 toImpl(preferencesRef)->setLargeImageAsyncDecodingEnabled(flag);1697 }1698 1699 bool WKPreferencesGetLargeImageAsyncDecodingEnabled(WKPreferencesRef preferencesRef)1700 {1701 return toImpl(preferencesRef)->largeImageAsyncDecodingEnabled();1702 }1703 1704 void WKPreferencesSetAnimatedImageAsyncDecodingEnabled(WKPreferencesRef preferencesRef, bool flag)1705 {1706 toImpl(preferencesRef)->setAnimatedImageAsyncDecodingEnabled(flag);1707 }1708 1709 bool WKPreferencesGetAnimatedImageAsyncDecodingEnabled(WKPreferencesRef preferencesRef)1710 {1711 return toImpl(preferencesRef)->animatedImageAsyncDecodingEnabled();1712 }1713 1714 1694 void WKPreferencesSetShouldSuppressKeyboardInputDuringProvisionalNavigation(WKPreferencesRef preferencesRef, bool flag) 1715 1695 { -
tags/Safari-604.1.10/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h
r213676 r213721 466 466 WK_EXPORT bool WKPreferencesGetSubtleCryptoEnabled(WKPreferencesRef); 467 467 468 // Defaults to true.469 WK_EXPORT void WKPreferencesSetLargeImageAsyncDecodingEnabled(WKPreferencesRef preferencesRef, bool flag);470 WK_EXPORT bool WKPreferencesGetLargeImageAsyncDecodingEnabled(WKPreferencesRef preferencesRef);471 472 // Defaults to true.473 WK_EXPORT void WKPreferencesSetAnimatedImageAsyncDecodingEnabled(WKPreferencesRef preferencesRef, bool flag);474 WK_EXPORT bool WKPreferencesGetAnimatedImageAsyncDecodingEnabled(WKPreferencesRef preferencesRef);475 476 468 // Defaults to false 477 469 WK_EXPORT void WKPreferencesSetShouldSuppressKeyboardInputDuringProvisionalNavigation(WKPreferencesRef, bool flag); -
tags/Safari-604.1.10/Tools/ChangeLog
r213696 r213721 1 2017-03-10 Jason Marcell <jmarcell@apple.com> 2 3 Merge r213715. rdar://problem/24709033 4 5 2017-03-10 Commit Queue <commit-queue@webkit.org> 6 7 Unreviewed, rolling out r213618. 8 https://bugs.webkit.org/show_bug.cgi?id=169475 9 10 Suspect this is the cause of a large memory regression 11 (Requested by jonlee_ on #webkit). 12 13 Reverted changeset: 14 15 "Enable async image decoding for large images" 16 https://bugs.webkit.org/show_bug.cgi?id=165039 17 http://trac.webkit.org/changeset/213618 18 1 19 2017-03-09 Brian Nicholson <bnicholson@mozilla.com> and Alex Christensen <achristensen@webkit.org> 2 20 -
tags/Safari-604.1.10/Tools/DumpRenderTree/mac/DumpRenderTree.mm
r213676 r213721 957 957 958 958 [preferences setMediaStreamEnabled:YES]; 959 960 [preferences setLargeImageAsyncDecodingEnabled:NO];961 959 962 960 [WebPreferences _clearNetworkLoaderSession]; -
tags/Safari-604.1.10/Tools/WebKitTestRunner/TestController.cpp
r213688 r213721 720 720 721 721 WKPreferencesSetMockCaptureDevicesEnabled(preferences, true); 722 723 WKPreferencesSetLargeImageAsyncDecodingEnabled(preferences, false);724 722 725 723 platformResetPreferencesToConsistentValues();
Note: See TracChangeset
for help on using the changeset viewer.