Commit aeea9f39 authored by Liquan(Max) Gu's avatar Liquan(Max) Gu Committed by Commit Bot

[FCP++] Image: change IsImage to IsLayoutImage

The ImagePaintTimingDetector is now using IsImage to tell whether an
object is a layout image. But this is incorrect. We shuld use
IsLayoutImage instead.

Bug: 869924
Change-Id: I018118d41cb9a434d6c13c0920ca5a1486827216
Reviewed-on: https://chromium-review.googlesource.com/c/1471219Reviewed-by: default avatarSteve Kobes <skobes@chromium.org>
Commit-Queue: Liquan (Max) Gu <maxlg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#632022}
parent 90ae93cc
...@@ -26,7 +26,7 @@ namespace blink { ...@@ -26,7 +26,7 @@ namespace blink {
namespace { namespace {
#ifndef NDEBUG #ifndef NDEBUG
String GetImageUrl(const LayoutObject& object) { String GetImageUrl(const LayoutObject& object) {
if (object.IsImage()) { if (object.IsLayoutImage()) {
const ImageResourceContent* cached_image = const ImageResourceContent* cached_image =
ToLayoutImage(&object)->CachedImage(); ToLayoutImage(&object)->CachedImage();
return cached_image ? cached_image->Url().StrippedForUseAsReferrer() : ""; return cached_image ? cached_image->Url().StrippedForUseAsReferrer() : "";
...@@ -76,7 +76,7 @@ bool AttachedBackgroundImagesAllLoaded(const LayoutObject& object) { ...@@ -76,7 +76,7 @@ bool AttachedBackgroundImagesAllLoaded(const LayoutObject& object) {
} }
bool IsLoaded(const LayoutObject& object) { bool IsLoaded(const LayoutObject& object) {
if (object.IsImage()) { if (object.IsLayoutImage()) {
const ImageResourceContent* cached_image = const ImageResourceContent* cached_image =
ToLayoutImage(&object)->CachedImage(); ToLayoutImage(&object)->CachedImage();
return cached_image ? cached_image->IsLoaded() : false; return cached_image ? cached_image->IsLoaded() : false;
......
...@@ -38,7 +38,7 @@ void PaintTimingDetector::NotifyObjectPrePaint( ...@@ -38,7 +38,7 @@ void PaintTimingDetector::NotifyObjectPrePaint(
if (object.IsText()) { if (object.IsText()) {
text_paint_timing_detector_->RecordText(object, painting_layer); text_paint_timing_detector_->RecordText(object, painting_layer);
} }
if (object.IsImage() || object.IsVideo() || object.IsSVGImage() || if (object.IsLayoutImage() || object.IsVideo() || object.IsSVGImage() ||
ImagePaintTimingDetector::HasContentfulBackgroundImage(object)) { ImagePaintTimingDetector::HasContentfulBackgroundImage(object)) {
image_paint_timing_detector_->RecordImage(object, painting_layer); image_paint_timing_detector_->RecordImage(object, painting_layer);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment