| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/paint/ObjectPaintInvalidator.h" | 5 #include "core/paint/ObjectPaintInvalidator.h" |
| 6 | 6 |
| 7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
| 8 #include "core/frame/LocalFrame.h" | 8 #include "core/frame/LocalFrame.h" |
| 9 #include "core/layout/LayoutView.h" | 9 #include "core/layout/LayoutView.h" |
| 10 #include "core/layout/api/LayoutPartItem.h" | 10 #include "core/layout/api/LayoutPartItem.h" |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 | 398 |
| 399 if (m_object.view()->document().printing() && | 399 if (m_object.view()->document().printing() && |
| 400 !RuntimeEnabledFeatures::printBrowserEnabled()) | 400 !RuntimeEnabledFeatures::printBrowserEnabled()) |
| 401 return LayoutRect(); // Don't invalidate paints if we're printing. | 401 return LayoutRect(); // Don't invalidate paints if we're printing. |
| 402 | 402 |
| 403 const LayoutBoxModelObject& paintInvalidationContainer = | 403 const LayoutBoxModelObject& paintInvalidationContainer = |
| 404 m_object.containerForPaintInvalidation(); | 404 m_object.containerForPaintInvalidation(); |
| 405 LayoutRect dirtyRectOnBacking = dirtyRect; | 405 LayoutRect dirtyRectOnBacking = dirtyRect; |
| 406 PaintLayer::mapRectToPaintInvalidationBacking( | 406 PaintLayer::mapRectToPaintInvalidationBacking( |
| 407 m_object, paintInvalidationContainer, dirtyRectOnBacking); | 407 m_object, paintInvalidationContainer, dirtyRectOnBacking); |
| 408 dirtyRectOnBacking.move(m_object.scrollAdjustmentForPaintInvalidation( | 408 if (m_object != paintInvalidationContainer) { |
| 409 paintInvalidationContainer)); | 409 dirtyRectOnBacking.move( |
| 410 paintInvalidationContainer.scrollAdjustmentForPaintInvalidation()); |
| 411 } |
| 410 invalidatePaintUsingContainer(paintInvalidationContainer, dirtyRectOnBacking, | 412 invalidatePaintUsingContainer(paintInvalidationContainer, dirtyRectOnBacking, |
| 411 PaintInvalidationRectangle); | 413 PaintInvalidationRectangle); |
| 412 | 414 |
| 413 slowSetPaintingLayerNeedsRepaint(); | 415 slowSetPaintingLayerNeedsRepaint(); |
| 414 if (displayItemClient) | 416 if (displayItemClient) |
| 415 invalidateDisplayItemClient(*displayItemClient, PaintInvalidationRectangle); | 417 invalidateDisplayItemClient(*displayItemClient, PaintInvalidationRectangle); |
| 416 else | 418 else |
| 417 m_object.invalidateDisplayItemClients(PaintInvalidationRectangle); | 419 m_object.invalidateDisplayItemClients(PaintInvalidationRectangle); |
| 418 | 420 |
| 419 return dirtyRectOnBacking; | 421 return dirtyRectOnBacking; |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 | 648 |
| 647 m_context.paintingLayer->setNeedsRepaint(); | 649 m_context.paintingLayer->setNeedsRepaint(); |
| 648 m_object.invalidateDisplayItemClients(reason); | 650 m_object.invalidateDisplayItemClients(reason); |
| 649 return reason; | 651 return reason; |
| 650 } | 652 } |
| 651 | 653 |
| 652 DisablePaintInvalidationStateAsserts::DisablePaintInvalidationStateAsserts() | 654 DisablePaintInvalidationStateAsserts::DisablePaintInvalidationStateAsserts() |
| 653 : m_disabler(&gDisablePaintInvalidationStateAsserts, true) {} | 655 : m_disabler(&gDisablePaintInvalidationStateAsserts, true) {} |
| 654 | 656 |
| 655 } // namespace blink | 657 } // namespace blink |
| OLD | NEW |