Commit 6d4ee0b2 authored by Fredrik Söderqvist's avatar Fredrik Söderqvist Committed by Commit Bot

Remove |LayoutSVGModelObject::local_visual_rect_|

This is now always equal to the stroke bounding box (or object bounding
box if stroke does not apply or otherwise have no influence), so it can
be removed and VisualRectInLocalSVGCoordinates() forwarded to
StrokeBoundingBox().

Ditto for |LayoutSVGRoot::visual_rect_in_local_svg_coordinates_|.

Bug: 1028061
Change-Id: Idebfb8fb5ca4fd3c954c99068163e3947e042b49
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2450321
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814612}
parent d38953e7
......@@ -178,9 +178,9 @@ void LayoutSVGContainer::UpdateCachedBoundaries() {
NOT_DESTROYED();
auto old_object_bounding_box = object_bounding_box_;
SVGLayoutSupport::ComputeContainerBoundingBoxes(
this, object_bounding_box_, object_bounding_box_valid_,
stroke_bounding_box_, local_visual_rect_);
SVGLayoutSupport::ComputeContainerBoundingBoxes(this, object_bounding_box_,
object_bounding_box_valid_,
stroke_bounding_box_);
// Change of object_bounding_box_ may change reference box of resource
// effects.
......
......@@ -172,12 +172,8 @@ void LayoutSVGImage::UpdateLayout() {
if (EverHadLayout() && bbox_changed)
SVGResourceInvalidator(*this).InvalidateEffects();
bool update_parent_boundaries = false;
if (needs_boundaries_update_) {
local_visual_rect_ = object_bounding_box_;
needs_boundaries_update_ = false;
update_parent_boundaries = true;
}
bool update_parent_boundaries = needs_boundaries_update_;
needs_boundaries_update_ = false;
if (!needs_transform_update_ && transform_uses_reference_box_) {
needs_transform_update_ = CheckForImplicitTransformChange(bbox_changed);
......
......@@ -52,7 +52,7 @@ class LayoutSVGModelObject : public LayoutObject {
FloatRect VisualRectInLocalSVGCoordinates() const override {
NOT_DESTROYED();
return local_visual_rect_;
return StrokeBoundingBox();
}
void AbsoluteQuads(Vector<FloatQuad>&,
......@@ -96,9 +96,6 @@ class LayoutSVGModelObject : public LayoutObject {
void AddOutlineRects(Vector<PhysicalRect>&,
const PhysicalOffset& additional_offset,
NGOutlineType) const final;
protected:
FloatRect local_visual_rect_;
};
} // namespace blink
......
......@@ -534,9 +534,9 @@ const LayoutObject* LayoutSVGRoot::PushMappingToContainer(
void LayoutSVGRoot::UpdateCachedBoundaries() {
NOT_DESTROYED();
SVGLayoutSupport::ComputeContainerBoundingBoxes(
this, object_bounding_box_, object_bounding_box_valid_,
stroke_bounding_box_, visual_rect_in_local_svg_coordinates_);
SVGLayoutSupport::ComputeContainerBoundingBoxes(this, object_bounding_box_,
object_bounding_box_valid_,
stroke_bounding_box_);
}
bool LayoutSVGRoot::NodeAtPoint(HitTestResult& result,
......
......@@ -177,7 +177,7 @@ class CORE_EXPORT LayoutSVGRoot final : public LayoutReplaced {
}
FloatRect VisualRectInLocalSVGCoordinates() const override {
NOT_DESTROYED();
return visual_rect_in_local_svg_coordinates_;
return stroke_bounding_box_;
}
bool NodeAtPoint(HitTestResult&,
......@@ -224,7 +224,6 @@ class CORE_EXPORT LayoutSVGRoot final : public LayoutReplaced {
FloatRect object_bounding_box_;
bool object_bounding_box_valid_;
FloatRect stroke_bounding_box_;
FloatRect visual_rect_in_local_svg_coordinates_;
AffineTransform local_to_border_box_transform_;
bool is_layout_size_changed_ : 1;
bool did_screen_scale_factor_change_ : 1;
......
......@@ -303,10 +303,7 @@ void LayoutSVGShape::UpdateLayout() {
bbox_changed = true;
}
needs_shape_update_ = false;
local_visual_rect_ = StrokeBoundingBox();
needs_boundaries_update_ = false;
update_parent_boundaries = true;
}
......
......@@ -270,8 +270,7 @@ void SVGLayoutSupport::ComputeContainerBoundingBoxes(
const LayoutObject* container,
FloatRect& object_bounding_box,
bool& object_bounding_box_valid,
FloatRect& stroke_bounding_box,
FloatRect& local_visual_rect) {
FloatRect& stroke_bounding_box) {
object_bounding_box = FloatRect();
object_bounding_box_valid = false;
stroke_bounding_box = FloatRect();
......@@ -295,8 +294,6 @@ void SVGLayoutSupport::ComputeContainerBoundingBoxes(
stroke_bounding_box.Unite(
transform.MapRect(current->VisualRectInLocalSVGCoordinates()));
}
local_visual_rect = stroke_bounding_box;
}
bool SVGLayoutSupport::LayoutSizeOfNearestViewportChanged(
......
......@@ -92,8 +92,7 @@ class CORE_EXPORT SVGLayoutSupport {
static void ComputeContainerBoundingBoxes(const LayoutObject* container,
FloatRect& object_bounding_box,
bool& object_bounding_box_valid,
FloatRect& stroke_bounding_box,
FloatRect& local_visual_rect);
FloatRect& stroke_bounding_box);
// Important functions used by nearly all SVG layoutObjects centralizing
// coordinate transformations / visual rect calculations
......
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