Commit ea4b26bc authored by Fredrik Söderquist's avatar Fredrik Söderquist Committed by Commit Bot

Use StyleImage::HasIntrinsicSize in FillLayer invalidation determination

This better matches what BackgroundImageGeometry checks.

Rename the somewhat terse |img| to the ever so slightly less terse
|image|, and mark it const.

Change-Id: I9e3cbe86285bc448c2e79d31c813071191150a11
Reviewed-on: https://chromium-review.googlesource.com/c/1489235
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Auto-Submit: Fredrik Söderquist <fs@opera.com>
Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635566}
parent a36886cc
...@@ -30,8 +30,8 @@ static bool ShouldFullyInvalidateFillLayersOnWidthChange( ...@@ -30,8 +30,8 @@ static bool ShouldFullyInvalidateFillLayersOnWidthChange(
return true; return true;
// The layer properties checked below apply only when there is a valid image. // The layer properties checked below apply only when there is a valid image.
StyleImage* img = layer.GetImage(); const StyleImage* image = layer.GetImage();
if (!img || !img->CanRender()) if (!image || !image->CanRender())
return false; return false;
if (layer.RepeatX() != EFillRepeat::kRepeatFill && if (layer.RepeatX() != EFillRepeat::kRepeatFill &&
...@@ -58,7 +58,7 @@ static bool ShouldFullyInvalidateFillLayersOnWidthChange( ...@@ -58,7 +58,7 @@ static bool ShouldFullyInvalidateFillLayersOnWidthChange(
if (width.IsPercentOrCalc() && !width.IsZero()) if (width.IsPercentOrCalc() && !width.IsZero())
return true; return true;
if (width.IsAuto() && img->IsGeneratedImage()) if (width.IsAuto() && !image->HasIntrinsicSize())
return true; return true;
return false; return false;
...@@ -72,8 +72,8 @@ static bool ShouldFullyInvalidateFillLayersOnHeightChange( ...@@ -72,8 +72,8 @@ static bool ShouldFullyInvalidateFillLayersOnHeightChange(
return true; return true;
// The layer properties checked below apply only when there is a valid image. // The layer properties checked below apply only when there is a valid image.
StyleImage* img = layer.GetImage(); const StyleImage* image = layer.GetImage();
if (!img || !img->CanRender()) if (!image || !image->CanRender())
return false; return false;
if (layer.RepeatY() != EFillRepeat::kRepeatFill && if (layer.RepeatY() != EFillRepeat::kRepeatFill &&
...@@ -100,7 +100,7 @@ static bool ShouldFullyInvalidateFillLayersOnHeightChange( ...@@ -100,7 +100,7 @@ static bool ShouldFullyInvalidateFillLayersOnHeightChange(
if (height.IsPercentOrCalc() && !height.IsZero()) if (height.IsPercentOrCalc() && !height.IsZero())
return true; return true;
if (height.IsAuto() && img->IsGeneratedImage()) if (height.IsAuto() && !image->HasIntrinsicSize())
return true; return true;
return false; return false;
......
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