Chromium Code Reviews| Index: Source/core/rendering/RenderObject.cpp |
| diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp |
| index 96a28d4392bcdb5cd41f7d77e5274e5d91ee2bc2..0126eede5936817e4b9033b259ccdba3e86867ee 100644 |
| --- a/Source/core/rendering/RenderObject.cpp |
| +++ b/Source/core/rendering/RenderObject.cpp |
| @@ -101,13 +101,6 @@ namespace { |
| static bool gModifyRenderTreeStructureAnyState = false; |
| -typedef WillBeHeapHashSet<RawPtrWillBeWeakMember<const RenderObject> > RenderObjectWeakSet; |
| -RenderObjectWeakSet& renderObjectNeverHadPaintInvalidationSet() |
| -{ |
| - DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<RenderObjectWeakSet>, set, (adoptPtrWillBeNoop(new RenderObjectWeakSet()))); |
| - return *set; |
| -} |
| - |
| } // namespace |
| using namespace HTMLNames; |
| @@ -242,9 +235,6 @@ RenderObject::RenderObject(Node* node) |
| #endif |
| , m_bitfields(node) |
| { |
| - if (firstPaintInvalidationTrackingEnabled()) |
| - renderObjectNeverHadPaintInvalidationSet().add(this); |
| - |
| #ifndef NDEBUG |
| renderObjectCounter.increment(); |
| #endif |
| @@ -253,9 +243,6 @@ RenderObject::RenderObject(Node* node) |
| RenderObject::~RenderObject() |
| { |
| - if (firstPaintInvalidationTrackingEnabled()) |
| - renderObjectNeverHadPaintInvalidationSet().remove(this); |
| - |
| ASSERT(!m_hasAXObject); |
| #if ENABLE(OILPAN) |
| ASSERT(m_didCallDestroy); |
| @@ -1098,20 +1085,6 @@ void RenderObject::paint(PaintInfo&, const LayoutPoint&) |
| { |
| } |
| -void RenderObject::setHadPaintInvalidation() |
| -{ |
| - if (firstPaintInvalidationTrackingEnabled()) |
| - renderObjectNeverHadPaintInvalidationSet().remove(this); |
| -} |
| - |
| -bool RenderObject::hadPaintInvalidation() const |
| -{ |
| - if (!firstPaintInvalidationTrackingEnabled()) |
| - return true; |
| - |
| - return !renderObjectNeverHadPaintInvalidationSet().contains(this); |
| -} |
| - |
| const RenderLayerModelObject* RenderObject::containerForPaintInvalidation() const |
| { |
| RELEASE_ASSERT(isRooted()); |
| @@ -1205,13 +1178,13 @@ void RenderObject::invalidatePaintUsingContainer(const RenderLayerModelObject* p |
| } |
| if (paintInvalidationContainer->isRenderView()) { |
| - toRenderView(paintInvalidationContainer)->invalidatePaintForRectangle(r); |
| + toRenderView(paintInvalidationContainer)->invalidatePaintForRectangle(r, invalidationReason); |
| return; |
| } |
| if (paintInvalidationContainer->view()->usesCompositing()) { |
| ASSERT(paintInvalidationContainer->isPaintInvalidationContainer()); |
| - paintInvalidationContainer->setBackingNeedsPaintInvalidationInRect(r); |
| + paintInvalidationContainer->setBackingNeedsPaintInvalidationInRect(r, invalidationReason); |
| } |
| } |
| @@ -1264,6 +1237,8 @@ const char* RenderObject::invalidationReasonToString(InvalidationReason reason) |
| return "selection"; |
| case InvalidationLayer: |
| return "layer"; |
| + case InvalidationRendererInsertion: |
| + return "renderer insertion"; |
| case InvalidationRendererRemoval: |
| return "renderer removal"; |
| case InvalidationPaintRectangle: |
| @@ -1346,7 +1321,7 @@ InvalidationReason RenderObject::getPaintInvalidationReason(const RenderLayerMod |
| const LayoutRect& oldBounds, const LayoutPoint& oldPositionFromPaintInvalidationBacking, const LayoutRect& newBounds, const LayoutPoint& newPositionFromPaintInvalidationBacking) |
| { |
| if (shouldDoFullPaintInvalidation()) |
| - return InvalidationFull; |
| + return m_bitfields.fullPaintInvalidationReason(); |
| // Presumably a background or a border exists if border-fit:lines was specified. |
| if (style()->borderFit() == BorderFitLines) |
| @@ -3077,16 +3052,22 @@ bool RenderObject::isRelayoutBoundaryForInspector() const |
| void RenderObject::setShouldDoFullPaintInvalidation(bool b, MarkingBehavior markBehavior) |
| { |
| + setShouldDoFullPaintInvalidationWithReason(b ? InvalidationFull : InvalidationNone, markBehavior); |
| +} |
| + |
| +void RenderObject::setShouldDoFullPaintInvalidationWithReason(InvalidationReason reason, MarkingBehavior markBehavior) |
| +{ |
| // RenderText objects don't know how to invalidate paint for themselves, since they don't know how to compute their bounds. |
| // Instead the parent fully invalidate when any text needs full paint invalidation. |
| if (isText()) { |
| - parent()->setShouldDoFullPaintInvalidation(b, markBehavior); |
| + parent()->setShouldDoFullPaintInvalidationWithReason(reason, markBehavior); |
| return; |
| } |
| - m_bitfields.setShouldDoFullPaintInvalidation(b); |
| + if (!shouldDoFullPaintInvalidation()) |
|
Xianzhu
2014/09/23 21:06:41
This is incorrect. It will prevent us from resetti
Xianzhu
2014/09/23 21:26:17
Fixed.
|
| + m_bitfields.setFullPaintInvalidationReason(reason); |
| - if (markBehavior == MarkContainingBlockChain && b) { |
| + if (markBehavior == MarkContainingBlockChain && reason != InvalidationNone) { |
| ASSERT(document().lifecycle().state() != DocumentLifecycle::InPaintInvalidation); |
| frame()->page()->animator().scheduleVisualUpdate(); // In case that this is called not during FrameView::updateLayoutAndStyleForPainting(). |
| markContainingBlockChainForPaintInvalidation(); |