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