Commit ce9af4ce authored by Fredrik Söderqvist's avatar Fredrik Söderqvist Committed by Chromium LUCI CQ

Remove some explicit casts in FillLayer in favor of accessors

Makes the code a little more readable.

Change-Id: Ia9b58ac2c7b8c9179df7aa29b83d00bbd5ff3c56
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2640417
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@{#845232}
parent 5535ec91
......@@ -407,10 +407,10 @@ bool FillLayer::ImageTilesLayer() const {
// TODO(schenney) We could relax the repeat mode requirement if we also knew
// the rect we had to fill, and the portion of the image we need to use, and
// know that the latter covers the former.
return (static_cast<EFillRepeat>(repeat_x_) == EFillRepeat::kRepeatFill ||
static_cast<EFillRepeat>(repeat_x_) == EFillRepeat::kRoundFill) &&
(static_cast<EFillRepeat>(repeat_y_) == EFillRepeat::kRepeatFill ||
static_cast<EFillRepeat>(repeat_y_) == EFillRepeat::kRoundFill);
return (RepeatX() == EFillRepeat::kRepeatFill ||
RepeatX() == EFillRepeat::kRoundFill) &&
(RepeatY() == EFillRepeat::kRepeatFill ||
RepeatY() == EFillRepeat::kRoundFill);
}
bool FillLayer::ImageOccludesNextLayers(const Document& document,
......@@ -424,8 +424,8 @@ bool FillLayer::ImageOccludesNextLayers(const Document& document,
case kCompositeCopy:
return ImageTilesLayer();
case kCompositeSourceOver:
return (blend_mode_ == static_cast<unsigned>(BlendMode::kNormal)) &&
ImageTilesLayer() && ImageIsOpaque(document, style);
return GetBlendMode() == BlendMode::kNormal && ImageTilesLayer() &&
ImageIsOpaque(document, style);
default: {}
}
......
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