Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Side by Side Diff: Source/core/rendering/RenderImage.cpp

Issue 153983004: Schedule image resource downloads by decreasing visual impact - Blink Side (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase + variable name change. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/rendering/RenderBlock.cpp ('k') | Source/platform/network/ResourceRequest.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com)
6 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 6 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
8 * Copyright (C) 2010 Google Inc. All rights reserved. 8 * Copyright (C) 2010 Google Inc. All rights reserved.
9 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. 9 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved.
10 * 10 *
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 // with empty rects. Use LayoutRect::contains in that case. 583 // with empty rects. Use LayoutRect::contains in that case.
584 bool isVisible; 584 bool isVisible;
585 if (!objectBounds.isEmpty()) 585 if (!objectBounds.isEmpty())
586 isVisible = viewBounds.intersects(objectBounds); 586 isVisible = viewBounds.intersects(objectBounds);
587 else 587 else
588 isVisible = viewBounds.contains(objectBounds); 588 isVisible = viewBounds.contains(objectBounds);
589 589
590 ResourceLoadPriorityOptimizer::VisibilityStatus status = isVisible ? 590 ResourceLoadPriorityOptimizer::VisibilityStatus status = isVisible ?
591 ResourceLoadPriorityOptimizer::Visible : ResourceLoadPriorityOptimizer:: NotVisible; 591 ResourceLoadPriorityOptimizer::Visible : ResourceLoadPriorityOptimizer:: NotVisible;
592 592
593 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->notifyImageR esourceVisibility(m_imageResource->cachedImage(), status); 593 LayoutRect screenArea;
594 if (!objectBounds.isEmpty()) {
595 screenArea = viewBounds;
596 screenArea.intersect(objectBounds);
597 }
598
599 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->notifyImageR esourceVisibility(m_imageResource->cachedImage(), status, screenArea);
594 600
595 return true; 601 return true;
596 } 602 }
597 603
598 void RenderImage::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, dou ble& intrinsicRatio, bool& isPercentageIntrinsicSize) const 604 void RenderImage::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, dou ble& intrinsicRatio, bool& isPercentageIntrinsicSize) const
599 { 605 {
600 RenderReplaced::computeIntrinsicRatioInformation(intrinsicSize, intrinsicRat io, isPercentageIntrinsicSize); 606 RenderReplaced::computeIntrinsicRatioInformation(intrinsicSize, intrinsicRat io, isPercentageIntrinsicSize);
601 607
602 // Our intrinsicSize is empty if we're rendering generated images with relat ive width/height. Figure out the right intrinsic size to use. 608 // Our intrinsicSize is empty if we're rendering generated images with relat ive width/height. Figure out the right intrinsic size to use.
603 if (intrinsicSize.isEmpty() && (m_imageResource->imageHasRelativeWidth() || m_imageResource->imageHasRelativeHeight())) { 609 if (intrinsicSize.isEmpty() && (m_imageResource->imageHasRelativeWidth() || m_imageResource->imageHasRelativeHeight())) {
(...skipping 25 matching lines...) Expand all
629 return 0; 635 return 0;
630 636
631 ImageResource* cachedImage = m_imageResource->cachedImage(); 637 ImageResource* cachedImage = m_imageResource->cachedImage();
632 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage( )) 638 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage( ))
633 return toSVGImage(cachedImage->image())->embeddedContentBox(); 639 return toSVGImage(cachedImage->image())->embeddedContentBox();
634 640
635 return 0; 641 return 0;
636 } 642 }
637 643
638 } // namespace WebCore 644 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBlock.cpp ('k') | Source/platform/network/ResourceRequest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698