Commit e661c011 authored by Yoichi Osato's avatar Yoichi Osato Committed by Commit Bot

[LayoutNG] Remove redundant invalidation at ObjectPaintInvalidator

This patch removes the redundant invalidation because each LayoutObject now has
invalidation for LayoutNG.

This patch is a just revert of crrev.com/c/821394
([LayoutNG] Have LayoutText invalidating NGPaintFragments)

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_layout_ng;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I37373ed9015c476544c2d719fcf7cfcf7ab1ecc7
Reviewed-on: https://chromium-review.googlesource.com/1027592Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553952}
parent cd235dd9
......@@ -2523,11 +2523,6 @@ void LayoutBlockFlow::SetCachedLayoutResult(const NGConstraintSpace&,
void LayoutBlockFlow::SetPaintFragment(
scoped_refptr<const NGPhysicalFragment>) {}
Vector<NGPaintFragment*> LayoutBlockFlow::GetPaintFragments(
const LayoutObject&) const {
return Vector<NGPaintFragment*>();
}
void LayoutBlockFlow::ComputeOverflow(LayoutUnit old_client_after_edge,
bool recompute_floats) {
LayoutBlock::ComputeOverflow(old_client_after_edge, recompute_floats);
......
......@@ -454,7 +454,6 @@ class CORE_EXPORT LayoutBlockFlow : public LayoutBlock {
virtual void ResetNGInlineNodeData() {}
virtual bool HasNGInlineNodeData() const { return false; }
virtual NGPaintFragment* PaintFragment() const { return nullptr; }
virtual Vector<NGPaintFragment*> GetPaintFragments(const LayoutObject&) const;
virtual scoped_refptr<NGLayoutResult> CachedLayoutResult(
const NGConstraintSpace&,
NGBreakToken*) const;
......
......@@ -1618,9 +1618,6 @@ void LayoutInline::AddAnnotatedRegions(Vector<AnnotatedRegionValue>& regions) {
void LayoutInline::InvalidateDisplayItemClients(
PaintInvalidationReason invalidation_reason) const {
// TODO(yoichio): Cover other PaintInvalidateionReasons.
DCHECK(invalidation_reason != PaintInvalidationReason::kSelection ||
!EnclosingNGBlockFlow());
ObjectPaintInvalidator paint_invalidator(*this);
if (RuntimeEnabledFeatures::LayoutNGEnabled()) {
......
......@@ -2322,9 +2322,6 @@ scoped_refptr<AbstractInlineTextBox> LayoutText::FirstAbstractInlineTextBox() {
void LayoutText::InvalidateDisplayItemClients(
PaintInvalidationReason invalidation_reason) const {
// TODO(yoichio): Cover other PaintInvalidateionReasons.
DCHECK(invalidation_reason != PaintInvalidationReason::kSelection ||
!EnclosingNGBlockFlow());
ObjectPaintInvalidator paint_invalidator(*this);
if (RuntimeEnabledFeatures::LayoutNGEnabled()) {
......
......@@ -183,28 +183,6 @@ void LayoutNGMixin<Base>::SetPaintFragment(
Base::SetShouldDoFullPaintInvalidation(PaintInvalidationReason::kSubtree);
}
static Vector<NGPaintFragment*> GetNGPaintFragmentsInternal(
NGPaintFragment* paint,
const LayoutObject& layout_object) {
if (!paint)
return Vector<NGPaintFragment*>();
Vector<NGPaintFragment*> fragments;
if (paint->GetLayoutObject() == &layout_object)
fragments.push_back(paint);
for (const auto& child : paint->Children()) {
const auto& result =
GetNGPaintFragmentsInternal(child.get(), layout_object);
fragments.AppendVector(result);
}
return fragments;
}
template <typename Base>
Vector<NGPaintFragment*> LayoutNGMixin<Base>::GetPaintFragments(
const LayoutObject& layout_object) const {
return GetNGPaintFragmentsInternal(PaintFragment(), layout_object);
}
template <typename Base>
void LayoutNGMixin<Base>::InvalidateDisplayItemClients(
PaintInvalidationReason invalidation_reason) const {
......
......@@ -69,8 +69,6 @@ class CORE_TEMPLATE_CLASS_EXPORT LayoutNGMixin : public Base {
}
void SetPaintFragment(scoped_refptr<const NGPhysicalFragment>) override;
void ClearPaintFragment() override { paint_fragment_ = nullptr; }
Vector<NGPaintFragment*> GetPaintFragments(
const LayoutObject&) const override;
protected:
bool IsOfType(LayoutObject::LayoutObjectType) const override;
......
......@@ -6,12 +6,10 @@
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/layout/layout_block_flow.h"
#include "third_party/blink/renderer/core/layout/layout_embedded_content.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.h"
#include "third_party/blink/renderer/core/paint/find_paint_offset_and_visual_rect_needing_update.h"
#include "third_party/blink/renderer/core/paint/ng/ng_paint_fragment.h"
#include "third_party/blink/renderer/core/paint/paint_invalidator.h"
#include "third_party/blink/renderer/core/paint/paint_layer.h"
#include "third_party/blink/renderer/platform/graphics/graphics_layer.h"
......@@ -139,20 +137,6 @@ void ObjectPaintInvalidator::
});
}
static void InvalidateDisplayItemClients(const LayoutObject& layout_object,
PaintInvalidationReason reason) {
if (LayoutBlockFlow* block_flow = layout_object.EnclosingNGBlockFlow()) {
ObjectPaintInvalidator paint_invalidator(layout_object);
Vector<NGPaintFragment*> paint_fragments =
block_flow->GetPaintFragments(layout_object);
for (auto* const paint_fragment : paint_fragments)
paint_invalidator.InvalidateDisplayItemClient(*paint_fragment, reason);
return;
}
layout_object.InvalidateDisplayItemClients(reason);
}
DISABLE_CFI_PERF
void ObjectPaintInvalidator::InvalidatePaintOfPreviousVisualRect(
const LayoutBoxModelObject& paint_invalidation_container,
......@@ -173,7 +157,6 @@ void ObjectPaintInvalidator::InvalidatePaintOfPreviousVisualRect(
LayoutRect invalidation_rect = object_.FragmentsVisualRectBoundingBox();
InvalidatePaintUsingContainer(paint_invalidation_container,
invalidation_rect, reason);
// TODO(yoichio) Use InvalidateDisplayItemClients(object_, reason);
object_.InvalidateDisplayItemClients(reason);
}
......@@ -559,7 +542,7 @@ void ObjectPaintInvalidatorWithContext::InvalidateSelection(
old_selection_rect, new_selection_rect);
}
context_.painting_layer->SetNeedsRepaint();
InvalidateDisplayItemClients(object_, PaintInvalidationReason::kSelection);
object_.InvalidateDisplayItemClients(PaintInvalidationReason::kSelection);
}
DISABLE_CFI_PERF
......@@ -585,7 +568,6 @@ void ObjectPaintInvalidatorWithContext::InvalidatePartialRect(
}
context_.painting_layer->SetNeedsRepaint();
// TODO(yoichio) Use InvalidateDisplayItemClients(object_, reason);
object_.InvalidateDisplayItemClients(PaintInvalidationReason::kRectangle);
}
......@@ -643,7 +625,6 @@ ObjectPaintInvalidatorWithContext::InvalidatePaintWithComputedReason(
}
context_.painting_layer->SetNeedsRepaint();
// TODO(yoichio) Use InvalidateDisplayItemClients(object_, reason);
object_.InvalidateDisplayItemClients(reason);
return reason;
}
......
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