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

Unified Diff: sky/engine/core/rendering/RenderBlock.cpp

Issue 710743006: Remove ResourceLoadPriorityOptimizer. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/rendering/RenderBlock.h ('k') | sky/engine/core/rendering/RenderImage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/RenderBlock.cpp
diff --git a/sky/engine/core/rendering/RenderBlock.cpp b/sky/engine/core/rendering/RenderBlock.cpp
index 652b626f0335253d42df4f392e4125a8ed205d34..1d0a01dc9ea5ca0d3555528f1c2fe41ebd7536c1 100644
--- a/sky/engine/core/rendering/RenderBlock.cpp
+++ b/sky/engine/core/rendering/RenderBlock.cpp
@@ -30,7 +30,6 @@
#include "core/dom/shadow/ShadowRoot.h"
#include "core/editing/Editor.h"
#include "core/editing/FrameSelection.h"
-#include "core/fetch/ResourceLoadPriorityOptimizer.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
#include "core/page/Page.h"
@@ -116,31 +115,6 @@ static void removeBlockFromDescendantAndContainerMaps(RenderBlock* block, Tracke
}
}
-static void appendImageIfNotNull(Vector<ImageResource*>& imageResources, const StyleImage* styleImage)
-{
- if (styleImage && styleImage->cachedImage()) {
- ImageResource* imageResource = styleImage->cachedImage();
- if (imageResource && !imageResource->isLoaded())
- imageResources.append(styleImage->cachedImage());
- }
-}
-
-static void appendLayers(Vector<ImageResource*>& images, const FillLayer& styleLayer)
-{
- for (const FillLayer* layer = &styleLayer; layer; layer = layer->next())
- appendImageIfNotNull(images, layer->image());
-}
-
-static void appendImagesFromStyle(Vector<ImageResource*>& images, RenderStyle& blockStyle)
-{
- appendLayers(images, blockStyle.backgroundLayers());
- appendLayers(images, blockStyle.maskLayers());
-
- appendImageIfNotNull(images, blockStyle.listStyleImage());
- appendImageIfNotNull(images, blockStyle.borderImageSource());
- appendImageIfNotNull(images, blockStyle.maskBoxImageSource());
-}
-
void RenderBlock::removeFromGlobalMaps()
{
if (gPercentHeightDescendantsMap)
@@ -275,15 +249,6 @@ void RenderBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldSty
// It's possible for our border/padding to change, but for the overall logical width of the block to
// end up being the same. We keep track of this change so in layoutBlock, we can know to set relayoutChildren=true.
m_hasBorderOrPaddingLogicalWidthChanged = oldStyle && diff.needsFullLayout() && needsLayout() && borderOrPaddingLogicalWidthChanged(oldStyle, newStyle);
-
- // If the style has unloaded images, want to notify the ResourceLoadPriorityOptimizer so that
- // network priorities can be set.
- Vector<ImageResource*> images;
- appendImagesFromStyle(images, *newStyle);
- if (images.isEmpty())
- ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->removeRenderObject(this);
- else
- ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->addRenderObject(this);
}
void RenderBlock::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvalidationState)
@@ -886,39 +851,6 @@ void RenderBlock::layout()
invalidateBackgroundObscurationStatus();
}
-bool RenderBlock::updateImageLoadingPriorities()
-{
- Vector<ImageResource*> images;
- appendImagesFromStyle(images, *style());
-
- if (images.isEmpty())
- return false;
-
- LayoutRect viewBounds = viewRect();
- LayoutRect objectBounds = absoluteContentBox();
- // The object bounds might be empty right now, so intersects will fail since it doesn't deal
- // with empty rects. Use LayoutRect::contains in that case.
- bool isVisible;
- if (!objectBounds.isEmpty())
- isVisible = viewBounds.intersects(objectBounds);
- else
- isVisible = viewBounds.contains(objectBounds);
-
- ResourceLoadPriorityOptimizer::VisibilityStatus status = isVisible ?
- ResourceLoadPriorityOptimizer::Visible : ResourceLoadPriorityOptimizer::NotVisible;
-
- LayoutRect screenArea;
- if (!objectBounds.isEmpty()) {
- screenArea = viewBounds;
- screenArea.intersect(objectBounds);
- }
-
- for (Vector<ImageResource*>::iterator it = images.begin(), end = images.end(); it != end; ++it)
- ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->notifyImageResourceVisibility(*it, status, screenArea);
-
- return true;
-}
-
bool RenderBlock::widthAvailableToChildrenHasChanged()
{
bool widthAvailableToChildrenHasChanged = m_hasBorderOrPaddingLogicalWidthChanged;
« no previous file with comments | « sky/engine/core/rendering/RenderBlock.h ('k') | sky/engine/core/rendering/RenderImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698