Changeset 216901 in webkit
- Timestamp:
- May 15, 2017 10:14:50 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r216892 r216901 1 2017-05-15 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 Do not delete asynchronously decoded frames for large images if their clients are in the viewport 4 https://bugs.webkit.org/show_bug.cgi?id=170640 5 6 Reviewed by Simon Fraser. 7 8 * fast/images/async-image-background-image-repeated.html: 9 * fast/images/async-image-background-image.html: 10 * fast/images/sprite-sheet-image-draw.html: 11 1 12 2017-05-15 Youenn Fablet <youenn@apple.com> 2 13 -
trunk/LayoutTests/fast/images/async-image-background-image-repeated.html
r216450 r216901 58 58 59 59 Promise.all(promises).then(() => { 60 // Ensure internals.destroyDecodedDataForAllImages() will not destroy 61 // the images' decoded data because it is inside the viewport. 62 internals.destroyDecodedDataForAllImages(); 60 63 testRunner.notifyDone(); 61 64 }); -
trunk/LayoutTests/fast/images/async-image-background-image.html
r216225 r216901 45 45 // Wait for the image frame to finish decoding before finishing the test. 46 46 element.addEventListener("webkitImageFrameReady", function() { 47 // Ensure internals.destroyDecodedDataForAllImages() will not destroy 48 // the image's decoded data because it is inside the viewport. 49 internals.destroyDecodedDataForAllImages(); 47 50 testRunner.notifyDone(); 48 51 }, false); -
trunk/LayoutTests/fast/images/sprite-sheet-image-draw.html
r216450 r216901 38 38 // Wait for the image frame to finish decoding before finishing the test. 39 39 element.addEventListener("webkitImageFrameReady", function() { 40 // Ensure internals.destroyDecodedDataForAllImages() will not destroy 41 // the image's decoded data because it is inside the viewport. 42 internals.destroyDecodedDataForAllImages(); 40 43 testRunner.notifyDone(); 41 44 }, false); -
trunk/Source/WebCore/ChangeLog
r216898 r216901 1 2017-05-15 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 Do not delete asynchronously decoded frames for large images if their clients are in the viewport 4 https://bugs.webkit.org/show_bug.cgi?id=170640 5 6 Reviewed by Simon Fraser. 7 8 The image flickering problem happens when a large image is visible in the 9 view port and for some reason, the decoded frame gets destroyed. When this 10 image is repainted, BitmapImage::draw() does not find a valid decoded frame 11 for that image. It then requests an async decoding for the image and just 12 draws nothing in the image rectangle. Drawing no content between two drawing 13 phases in which the image is drawn causes the unwanted flickering. 14 15 To fix this issue we need to protect the decoded frames of all the images 16 in the view port from being destroyed. When BitmapImage::destroyDecodedData() 17 is called, it is going to check, through the ImageObserver, whether any 18 of its clients is visible. And if so, the current decoded frame won't be 19 destroyed. 20 21 Tests: Modifying existing tests. 22 23 * loader/cache/CachedImage.cpp: 24 (WebCore::CachedImage::CachedImageObserver::decodedSizeChanged): 25 (WebCore::CachedImage::CachedImageObserver::didDraw): 26 (WebCore::CachedImage::CachedImageObserver::canDestroyDecodedData): 27 (WebCore::CachedImage::CachedImageObserver::imageFrameAvailable): 28 (WebCore::CachedImage::CachedImageObserver::changedInRect): 29 (WebCore::CachedImage::decodedSizeChanged): 30 (WebCore::CachedImage::didDraw): 31 (WebCore::CachedImage::canDestroyDecodedData): Finds out whether it's okay 32 to discard the image decoded data or not. 33 (WebCore::CachedImage::imageFrameAvailable): 34 (WebCore::CachedImage::changedInRect): 35 * loader/cache/CachedImage.h: 36 * loader/cache/CachedImageClient.h: 37 (WebCore::CachedImageClient::canDestroyDecodedData): 38 * loader/cache/MemoryCache.cpp: 39 (WebCore::MemoryCache::destroyDecodedDataForAllImages): This function is 40 currently not used. Use in the internal destroyDecodedDataForAllImages() 41 but unlike what CachedImage::destroyDecodedData() does, make it destroy 42 the decoded frames without deleting the image itself. 43 * loader/cache/MemoryCache.h: 44 * platform/graphics/BitmapImage.cpp: 45 (WebCore::BitmapImage::destroyDecodedData): 46 (WebCore::BitmapImage::draw): 47 (WebCore::BitmapImage::canDestroyCurrentFrameDecodedData): 48 (WebCore::BitmapImage::advanceAnimation): 49 (WebCore::BitmapImage::internalAdvanceAnimation): 50 (WebCore::BitmapImage::imageFrameAvailableAtIndex): 51 * platform/graphics/BitmapImage.h: 52 * platform/graphics/GraphicsContext3D.cpp: 53 (WebCore::GraphicsContext3D::packImageData): 54 * platform/graphics/ImageFrameCache.cpp: 55 (WebCore::ImageFrameCache::decodedSizeChanged): 56 (ImageFrameCache::cacheAsyncFrameNativeImageAtIndex): The assertion in this 57 function is wrong. frameIsCompleteAtIndex() can be false when the an image 58 decoding is requested but can be true when the decoding finishes. 59 * platform/graphics/ImageObserver.h: 60 * platform/graphics/cairo/ImageCairo.cpp: 61 (WebCore::Image::drawPattern): 62 * platform/graphics/cg/ImageCG.cpp: 63 (WebCore::Image::drawPattern): 64 * platform/graphics/cg/ImageDecoderCG.cpp: 65 (WebCore::ImageDecoder::frameIsCompleteAtIndex): 66 * platform/graphics/cg/PDFDocumentImage.cpp: 67 (WebCore::PDFDocumentImage::decodedSizeChanged): 68 (WebCore::PDFDocumentImage::draw): 69 * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp: 70 (WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded): 71 * platform/graphics/win/ImageDirect2D.cpp: 72 (WebCore::Image::drawPattern): 73 * rendering/RenderElement.cpp: 74 (WebCore::RenderElement::isVisibleInDocumentRect): 75 (WebCore::RenderElement::isVisibleInViewport): 76 (WebCore::RenderElement::imageFrameAvailable): 77 (WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded): 78 (WebCore::RenderElement::shouldRepaintInVisibleRect): Deleted. Function 79 is renamed to isVisibleInViewport() for better readability. 80 * rendering/RenderElement.h: 81 * svg/graphics/SVGImage.cpp: 82 (WebCore::SVGImage::draw): 83 * svg/graphics/SVGImageClients.h: 84 * testing/Internals.cpp: 85 (WebCore::Internals::destroyDecodedDataForAllImages): 86 * testing/Internals.h: 87 * testing/Internals.idl: 88 1 89 2017-05-15 Youenn Fablet <youenn@apple.com> 2 90 -
trunk/Source/WebCore/loader/cache/CachedImage.cpp
r216702 r216901 331 331 } 332 332 333 void CachedImage::CachedImageObserver::decodedSizeChanged(const Image *image, long long delta)333 void CachedImage::CachedImageObserver::decodedSizeChanged(const Image& image, long long delta) 334 334 { 335 335 for (auto cachedImage : m_cachedImages) … … 337 337 } 338 338 339 void CachedImage::CachedImageObserver::didDraw(const Image *image)339 void CachedImage::CachedImageObserver::didDraw(const Image& image) 340 340 { 341 341 for (auto cachedImage : m_cachedImages) … … 343 343 } 344 344 345 void CachedImage::CachedImageObserver::imageFrameAvailable(const Image* image, ImageAnimatingState animatingState, const IntRect* changeRect) 345 bool CachedImage::CachedImageObserver::canDestroyDecodedData(const Image& image) 346 { 347 for (auto cachedImage : m_cachedImages) { 348 if (&image != cachedImage->image()) 349 continue; 350 if (!cachedImage->canDestroyDecodedData(image)) 351 return false; 352 } 353 return true; 354 } 355 356 void CachedImage::CachedImageObserver::imageFrameAvailable(const Image& image, ImageAnimatingState animatingState, const IntRect* changeRect) 346 357 { 347 358 for (auto cachedImage : m_cachedImages) … … 349 360 } 350 361 351 void CachedImage::CachedImageObserver::changedInRect(const Image *image, const IntRect* rect)362 void CachedImage::CachedImageObserver::changedInRect(const Image& image, const IntRect* rect) 352 363 { 353 364 for (auto cachedImage : m_cachedImages) … … 477 488 } 478 489 479 void CachedImage::decodedSizeChanged(const Image *image, long long delta)480 { 481 if ( !image ||image != m_image)490 void CachedImage::decodedSizeChanged(const Image& image, long long delta) 491 { 492 if (&image != m_image) 482 493 return; 483 494 … … 486 497 } 487 498 488 void CachedImage::didDraw(const Image *image)489 { 490 if ( !image ||image != m_image)499 void CachedImage::didDraw(const Image& image) 500 { 501 if (&image != m_image) 491 502 return; 492 503 … … 498 509 } 499 510 500 void CachedImage::imageFrameAvailable(const Image* image, ImageAnimatingState animatingState, const IntRect* changeRect) 501 { 502 if (!image || image != m_image) 511 bool CachedImage::canDestroyDecodedData(const Image& image) 512 { 513 if (&image != m_image) 514 return false; 515 516 CachedResourceClientWalker<CachedImageClient> clientWalker(m_clients); 517 while (CachedImageClient* client = clientWalker.next()) { 518 if (!client->canDestroyDecodedData()) 519 return false; 520 } 521 522 return true; 523 } 524 525 void CachedImage::imageFrameAvailable(const Image& image, ImageAnimatingState animatingState, const IntRect* changeRect) 526 { 527 if (&image != m_image) 503 528 return; 504 529 … … 515 540 } 516 541 517 void CachedImage::changedInRect(const Image *image, const IntRect* rect)518 { 519 if ( !image ||image != m_image)542 void CachedImage::changedInRect(const Image& image, const IntRect* rect) 543 { 544 if (&image != m_image) 520 545 return; 521 546 notifyObservers(rect); -
trunk/Source/WebCore/loader/cache/CachedImage.h
r215952 r216901 128 128 129 129 // ImageObserver API 130 URL sourceUrl() const override { return m_cachedImages[0]->url(); }131 void decodedSizeChanged(const Image *, long long delta) final;132 void didDraw(const Image *) final;130 URL sourceUrl() const override { return !m_cachedImages.isEmpty() ? m_cachedImages[0]->url() : URL(); } 131 void decodedSizeChanged(const Image&, long long delta) final; 132 void didDraw(const Image&) final; 133 133 134 void imageFrameAvailable(const Image*, ImageAnimatingState, const IntRect* changeRect = nullptr) final; 135 void changedInRect(const Image*, const IntRect*) final; 134 bool canDestroyDecodedData(const Image&) final; 135 void imageFrameAvailable(const Image&, ImageAnimatingState, const IntRect* changeRect = nullptr) final; 136 void changedInRect(const Image&, const IntRect*) final; 136 137 137 138 Vector<CachedImage*> m_cachedImages; 138 139 }; 139 140 140 void decodedSizeChanged(const Image*, long long delta); 141 void didDraw(const Image*); 142 void imageFrameAvailable(const Image*, ImageAnimatingState, const IntRect* changeRect = nullptr); 143 void changedInRect(const Image*, const IntRect*); 141 void decodedSizeChanged(const Image&, long long delta); 142 void didDraw(const Image&); 143 bool canDestroyDecodedData(const Image&); 144 void imageFrameAvailable(const Image&, ImageAnimatingState, const IntRect* changeRect = nullptr); 145 void changedInRect(const Image&, const IntRect*); 144 146 145 147 void addIncrementalDataBuffer(SharedBuffer&); -
trunk/Source/WebCore/loader/cache/CachedImageClient.h
r215952 r216901 43 43 virtual void imageChanged(CachedImage*, const IntRect* = nullptr) { } 44 44 45 // Called when GIF animation progresses. 45 virtual bool canDestroyDecodedData() { return true; } 46 47 // Called when a new decoded frame for a large image is available or when an animated image is ready to advance to the next frame. 46 48 virtual VisibleInViewportState imageFrameAvailable(CachedImage& image, ImageAnimatingState, const IntRect* changeRect) { imageChanged(&image, changeRect); return VisibleInViewportState::No; } 47 49 -
trunk/Source/WebCore/loader/cache/MemoryCache.cpp
r215160 r216901 290 290 { 291 291 MemoryCache::singleton().forEachResource([](CachedResource& resource) { 292 if (resource.isImage()) 293 resource.destroyDecodedData(); 292 if (!resource.isImage()) 293 return; 294 295 if (auto image = downcast<CachedImage>(resource).image()) 296 image->destroyDecodedData(); 294 297 }); 295 298 } -
trunk/Source/WebCore/loader/cache/MemoryCache.h
r215152 r216901 105 105 void forEachResource(const std::function<void(CachedResource&)>&); 106 106 void forEachSessionResource(SessionID, const std::function<void(CachedResource&)>&); 107 void destroyDecodedDataForAllImages();107 WEBCORE_EXPORT void destroyDecodedDataForAllImages(); 108 108 109 109 // Sets the cache's memory capacities, in bytes. These will hold only approximately, -
trunk/Source/WebCore/platform/graphics/BitmapImage.cpp
r216882 r216901 80 80 if (!destroyAll) 81 81 m_source.destroyDecodedDataBeforeFrame(m_currentFrame); 82 else if ( m_source.hasAsyncDecodingQueue())82 else if (!canDestroyDecodedData()) { 83 83 m_source.destroyAllDecodedDataExcludeFrame(m_currentFrame); 84 else { 84 destroyAll = false; 85 } else { 85 86 m_source.destroyAllDecodedData(); 86 87 m_currentFrameDecodingStatus = ImageFrame::DecodingStatus::Invalid; … … 89 90 // There's no need to throw away the decoder unless we're explicitly asked 90 91 // to destroy all of the frames. 91 if (!destroyAll || m_source.hasAsyncDecodingQueue())92 if (!destroyAll) 92 93 m_source.clearFrameBufferCache(m_currentFrame); 93 94 else … … 247 248 248 249 if (imageObserver()) 249 imageObserver()->didDraw( this);250 imageObserver()->didDraw(*this); 250 251 } 251 252 … … 314 315 m_frameTimer = std::make_unique<Timer>(*this, &BitmapImage::advanceAnimation); 315 316 m_frameTimer->startOneShot(delay); 317 } 318 319 bool BitmapImage::canDestroyDecodedData() 320 { 321 // Animated images should preserve the current frame till the next one finishes decoding. 322 if (m_source.hasAsyncDecodingQueue()) 323 return false; 324 325 // Small image should be decoded synchronously. Deleting its decoded frame is fine. 326 if (!shouldUseAsyncDecodingForLargeImages()) 327 return true; 328 329 return !imageObserver() || imageObserver()->canDestroyDecodedData(*this); 316 330 } 317 331 … … 409 423 // Force repaint if showDebugBackground() is on. 410 424 if (m_showDebugBackground) 411 imageObserver()->changedInRect( this);425 imageObserver()->changedInRect(*this); 412 426 LOG(Images, "BitmapImage::%s - %p - url: %s [lateFrameCount = %ld nextFrame = %ld]", __FUNCTION__, this, sourceURL().string().utf8().data(), ++m_lateFrameCount, nextFrame); 413 427 } … … 424 438 m_currentFrameDecodingStatus = frameDecodingStatusAtIndex(m_currentFrame); 425 439 if (imageObserver()) 426 imageObserver()->imageFrameAvailable( this, ImageAnimatingState::Yes);440 imageObserver()->imageFrameAvailable(*this, ImageAnimatingState::Yes); 427 441 428 442 LOG(Images, "BitmapImage::%s - %p - url: %s [m_currentFrame = %ld]", __FUNCTION__, this, sourceURL().string().utf8().data(), m_currentFrame); … … 475 489 m_currentFrameDecodingStatus = frameDecodingStatusAtIndex(m_currentFrame); 476 490 if (imageObserver()) 477 imageObserver()->imageFrameAvailable( this, ImageAnimatingState::No);491 imageObserver()->imageFrameAvailable(*this, ImageAnimatingState::No); 478 492 } 479 493 } -
trunk/Source/WebCore/platform/graphics/BitmapImage.h
r216882 r216901 192 192 void clearTimer(); 193 193 void startTimer(Seconds delay); 194 bool canDestroyDecodedData(); 194 195 bool isBitmapImage() const override { return true; } 195 196 void dump(TextStream&) const override; -
trunk/Source/WebCore/platform/graphics/GraphicsContext3D.cpp
r212651 r216901 369 369 bool GraphicsContext3D::packImageData(Image* image, const void* pixels, GC3Denum format, GC3Denum type, bool flipY, AlphaOp alphaOp, DataFormat sourceFormat, unsigned width, unsigned height, unsigned sourceUnpackAlignment, Vector<uint8_t>& data) 370 370 { 371 if (! pixels)371 if (!image || !pixels) 372 372 return false; 373 373 … … 381 381 return false; 382 382 if (ImageObserver* observer = image->imageObserver()) 383 observer->didDraw( image);383 observer->didDraw(*image); 384 384 return true; 385 385 } -
trunk/Source/WebCore/platform/graphics/ImageFrameCache.cpp
r216882 r216901 125 125 return; 126 126 127 m_image->imageObserver()->decodedSizeChanged( m_image, decodedSize);127 m_image->imageObserver()->decodedSizeChanged(*m_image, decodedSize); 128 128 } 129 129 -
trunk/Source/WebCore/platform/graphics/ImageObserver.h
r215952 r216901 42 42 public: 43 43 virtual URL sourceUrl() const = 0; 44 virtual void decodedSizeChanged(const Image *, long long delta) = 0;44 virtual void decodedSizeChanged(const Image&, long long delta) = 0; 45 45 46 virtual void didDraw(const Image *) = 0;46 virtual void didDraw(const Image&) = 0; 47 47 48 virtual void imageFrameAvailable(const Image*, ImageAnimatingState, const IntRect* changeRect = nullptr) = 0; 49 virtual void changedInRect(const Image*, const IntRect* changeRect = nullptr) = 0; 48 virtual bool canDestroyDecodedData(const Image&) = 0; 49 virtual void imageFrameAvailable(const Image&, ImageAnimatingState, const IntRect* changeRect = nullptr) = 0; 50 virtual void changedInRect(const Image&, const IntRect* changeRect = nullptr) = 0; 50 51 }; 51 52 -
trunk/Source/WebCore/platform/graphics/cairo/ImageCairo.cpp
r206631 r216901 44 44 45 45 if (imageObserver()) 46 imageObserver()->didDraw( this);46 imageObserver()->didDraw(*this); 47 47 } 48 48 -
trunk/Source/WebCore/platform/graphics/cg/ImageCG.cpp
r206631 r216901 44 44 45 45 if (imageObserver()) 46 imageObserver()->didDraw( this);46 imageObserver()->didDraw(*this); 47 47 } 48 48 -
trunk/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp
r216450 r216901 308 308 { 309 309 ASSERT(frameCount()); 310 // CGImageSourceGetStatusAtIndex() changes the return status value from kCGImageStatusIncomplete 311 // to kCGImageStatusComplete only if (index > 1 && index < frameCount() - 1). To get an accurate 312 // result for the last frame (or the single frame of the static image) use CGImageSourceGetStatus() 313 // instead for this frame. 314 if (index == frameCount() - 1) 315 return CGImageSourceGetStatus(m_nativeDecoder.get()) == kCGImageStatusComplete; 310 316 return CGImageSourceGetStatusAtIndex(m_nativeDecoder.get(), index) == kCGImageStatusComplete; 311 317 } -
trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp
r215211 r216901 184 184 185 185 if (imageObserver()) 186 imageObserver()->decodedSizeChanged( this, -static_cast<long long>(m_cachedBytes) + newCachedBytes);186 imageObserver()->decodedSizeChanged(*this, -static_cast<long long>(m_cachedBytes) + newCachedBytes); 187 187 188 188 ASSERT(s_allDecodedDataSize >= m_cachedBytes); … … 289 289 290 290 if (imageObserver()) 291 imageObserver()->didDraw( this);291 imageObserver()->didDraw(*this); 292 292 } 293 293 -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.cpp
r198735 r216901 38 38 39 39 if (m_image->imageObserver()) 40 m_image->imageObserver()->didDraw( m_image.get());40 m_image->imageObserver()->didDraw(*m_image); 41 41 m_image = nullptr; 42 42 } -
trunk/Source/WebCore/platform/graphics/win/ImageDirect2D.cpp
r207357 r216901 102 102 103 103 if (imageObserver()) 104 imageObserver()->didDraw( this);104 imageObserver()->didDraw(*this); 105 105 } 106 106 -
trunk/Source/WebCore/rendering/RenderElement.cpp
r216631 r216901 1433 1433 } 1434 1434 1435 bool RenderElement:: shouldRepaintInVisibleRect(const IntRect& visibleRect) const1435 bool RenderElement::isVisibleInDocumentRect(const IntRect& documentRect) const 1436 1436 { 1437 1437 if (document().activeDOMObjectsAreSuspended()) … … 1457 1457 1458 1458 LayoutRect backgroundPaintingRect = backgroundIsPaintedByRoot ? view().backgroundRect() : absoluteClippedOverflowRect(); 1459 if (! visibleRect.intersects(enclosingIntRect(backgroundPaintingRect)))1459 if (!documentRect.intersects(enclosingIntRect(backgroundPaintingRect))) 1460 1460 return false; 1461 1461 … … 1494 1494 } 1495 1495 1496 VisibleInViewportState RenderElement::imageFrameAvailable(CachedImage& image, ImageAnimatingState animatingState, const IntRect* changeRect) 1496 bool RenderElement::isVisibleInViewport() const 1497 1497 { 1498 1498 auto& frameView = view().frameView(); 1499 1499 auto visibleRect = frameView.windowToContents(frameView.windowClipRect()); 1500 bool shouldRepaint = shouldRepaintInVisibleRect(visibleRect); 1501 1502 if (!shouldRepaint && animatingState == ImageAnimatingState::Yes) 1500 return isVisibleInDocumentRect(visibleRect); 1501 } 1502 1503 VisibleInViewportState RenderElement::imageFrameAvailable(CachedImage& image, ImageAnimatingState animatingState, const IntRect* changeRect) 1504 { 1505 bool isVisible = isVisibleInViewport(); 1506 1507 if (!isVisible && animatingState == ImageAnimatingState::Yes) 1503 1508 view().addRendererWithPausedImageAnimations(*this, image); 1504 1509 1505 1510 // Static images should repaint even if they are outside the viewport rectangle 1506 1511 // because they should be inside the TileCoverageRect. 1507 if ( shouldRepaint|| animatingState == ImageAnimatingState::No)1512 if (isVisible || animatingState == ImageAnimatingState::No) 1508 1513 imageChanged(&image, changeRect); 1509 1514 … … 1511 1516 element()->dispatchWebKitImageReadyEventForTesting(); 1512 1517 1513 return shouldRepaint? VisibleInViewportState::Yes : VisibleInViewportState::No;1518 return isVisible ? VisibleInViewportState::Yes : VisibleInViewportState::No; 1514 1519 } 1515 1520 … … 1523 1528 { 1524 1529 ASSERT(m_hasPausedImageAnimations); 1525 if (! shouldRepaintInVisibleRect(visibleRect))1530 if (!isVisibleInDocumentRect(visibleRect)) 1526 1531 return false; 1527 1532 -
trunk/Source/WebCore/rendering/RenderElement.h
r216631 r216901 142 142 bool borderImageIsLoadedAndCanBeRendered() const; 143 143 bool mayCauseRepaintInsideViewport(const IntRect* visibleRect = nullptr) const; 144 bool shouldRepaintInVisibleRect(const IntRect& visibleRect) const;144 bool isVisibleInDocumentRect(const IntRect& documentRect) const; 145 145 146 146 // Returns true if this renderer requires a new stacking context. … … 319 319 void invalidateCachedFirstLineStyle(); 320 320 321 bool isVisibleInViewport() const; 322 bool canDestroyDecodedData() final { return !isVisibleInViewport(); } 321 323 VisibleInViewportState imageFrameAvailable(CachedImage&, ImageAnimatingState, const IntRect* changeRect) final; 322 324 void didRemoveCachedImageClient(CachedImage&) final; -
trunk/Source/WebCore/svg/graphics/SVGImage.cpp
r215211 r216901 322 322 323 323 if (imageObserver()) 324 imageObserver()->didDraw( this);324 imageObserver()->didDraw(*this); 325 325 } 326 326 -
trunk/Source/WebCore/svg/graphics/SVGImageClients.h
r215952 r216901 61 61 return; 62 62 63 imageObserver->imageFrameAvailable( m_image, m_image->isAnimating() ? ImageAnimatingState::Yes : ImageAnimatingState::No, &r);63 imageObserver->imageFrameAvailable(*m_image, m_image->isAnimating() ? ImageAnimatingState::Yes : ImageAnimatingState::No, &r); 64 64 } 65 65 -
trunk/Source/WebCore/testing/Internals.cpp
r216892 r216901 730 730 MemoryCache::singleton().pruneLiveResourcesToSize(size, true); 731 731 } 732 733 void Internals::destroyDecodedDataForAllImages() 734 { 735 MemoryCache::singleton().destroyDecodedDataForAllImages(); 736 } 732 737 733 738 unsigned Internals::memoryCacheSize() const -
trunk/Source/WebCore/testing/Internals.h
r216696 r216901 115 115 void clearMemoryCache(); 116 116 void pruneMemoryCacheToSize(unsigned size); 117 void destroyDecodedDataForAllImages(); 117 118 unsigned memoryCacheSize() const; 118 119 -
trunk/Source/WebCore/testing/Internals.idl
r216696 r216901 104 104 void clearMemoryCache(); 105 105 void pruneMemoryCacheToSize(long size); 106 void destroyDecodedDataForAllImages(); 106 107 long memoryCacheSize(); 107 108 void setOverrideCachePolicy(CachePolicy policy); -
trunk/Source/WebKit/mac/ChangeLog
r216886 r216901 1 2017-05-15 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 Do not delete asynchronously decoded frames for large images if their clients are in the viewport 4 https://bugs.webkit.org/show_bug.cgi?id=170640 5 6 Reviewed by Simon Fraser. 7 8 Enable the async decoding for large images. 9 10 * WebView/WebView.mm: 11 (-[WebView _preferencesChanged:]): 12 1 13 2017-05-15 Jer Noble <jer.noble@apple.com> 2 14 -
trunk/Source/WebKit/mac/WebView/WebView.mm
r216704 r216901 3086 3086 settings.setShouldConvertInvalidURLsToBlank(shouldConvertInvalidURLsToBlank()); 3087 3087 3088 // FIXME: enable async image decoding after the flickering bug wk170640 is fixed. 3089 // settings.setLargeImageAsyncDecodingEnabled([preferences largeImageAsyncDecodingEnabled]); 3090 settings.setLargeImageAsyncDecodingEnabled(false); 3088 settings.setLargeImageAsyncDecodingEnabled([preferences largeImageAsyncDecodingEnabled]); 3091 3089 settings.setAnimatedImageAsyncDecodingEnabled([preferences animatedImageAsyncDecodingEnabled]); 3092 3090 } -
trunk/Source/WebKit2/ChangeLog
r216898 r216901 1 2017-05-15 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 Do not delete asynchronously decoded frames for large images if their clients are in the viewport 4 https://bugs.webkit.org/show_bug.cgi?id=170640 5 6 Reviewed by Simon Fraser. 7 8 Enable the async decoding for large images. 9 10 * WebProcess/WebPage/WebPage.cpp: 11 (WebKit::WebPage::updatePreferences): 12 1 13 2017-05-15 Youenn Fablet <youenn@apple.com> 2 14 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r216886 r216901 3378 3378 setForceAlwaysUserScalable(m_forceAlwaysUserScalable || store.getBoolValueForKey(WebPreferencesKey::forceAlwaysUserScalableKey())); 3379 3379 #endif 3380 // FIXME: enable async image decoding after the flickering bug wk170640 is fixed. 3381 // settings.setLargeImageAsyncDecodingEnabled(store.getBoolValueForKey(WebPreferencesKey::largeImageAsyncDecodingEnabledKey())); 3382 settings.setLargeImageAsyncDecodingEnabled(false); 3380 settings.setLargeImageAsyncDecodingEnabled(store.getBoolValueForKey(WebPreferencesKey::largeImageAsyncDecodingEnabledKey())); 3383 3381 settings.setAnimatedImageAsyncDecodingEnabled(store.getBoolValueForKey(WebPreferencesKey::animatedImageAsyncDecodingEnabledKey())); 3384 3382 settings.setShouldSuppressKeyboardInputDuringProvisionalNavigation(store.getBoolValueForKey(WebPreferencesKey::shouldSuppressKeyboardInputDuringProvisionalNavigationKey()));
Note: See TracChangeset
for help on using the changeset viewer.