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/LayoutBlockFlow.h" | 9 #include "core/layout/LayoutBlockFlow.h" |
10 #include "core/layout/compositing/CompositedLayerMapping.h" | 10 #include "core/layout/compositing/CompositedLayerMapping.h" |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 { | 412 { |
413 // Update selection rect when we are doing full invalidation (in case that t
he object is moved, | 413 // Update selection rect when we are doing full invalidation (in case that t
he object is moved, |
414 // composite status changed, etc.) or shouldInvalidationSelection is set (in
case that the | 414 // composite status changed, etc.) or shouldInvalidationSelection is set (in
case that the |
415 // selection itself changed). | 415 // selection itself changed). |
416 bool fullInvalidation = isImmediateFullPaintInvalidationReason(reason); | 416 bool fullInvalidation = isImmediateFullPaintInvalidationReason(reason); |
417 if (!fullInvalidation && !m_object.shouldInvalidateSelection()) | 417 if (!fullInvalidation && !m_object.shouldInvalidateSelection()) |
418 return; | 418 return; |
419 | 419 |
420 LayoutRect oldSelectionRect = selectionPaintInvalidationMap().get(&m_object)
; | 420 LayoutRect oldSelectionRect = selectionPaintInvalidationMap().get(&m_object)
; |
421 LayoutRect newSelectionRect = m_object.localSelectionRect(); | 421 LayoutRect newSelectionRect = m_object.localSelectionRect(); |
422 if (!newSelectionRect.isEmpty()) | 422 if (!newSelectionRect.isEmpty()) { |
423 m_context.mapLocalRectToPaintInvalidationBacking(m_object, newSelectionR
ect); | 423 m_context.mapLocalRectToPaintInvalidationBacking(m_object, newSelectionR
ect); |
424 | 424 newSelectionRect.move(m_object.scrollAdjustmentForPaintInvalidation(*m_c
ontext.paintInvalidationContainer)); |
425 newSelectionRect.move(m_object.scrollAdjustmentForPaintInvalidation(*m_conte
xt.paintInvalidationContainer)); | 425 } |
426 | 426 |
427 setPreviousSelectionPaintInvalidationRect(m_object, newSelectionRect); | 427 setPreviousSelectionPaintInvalidationRect(m_object, newSelectionRect); |
428 | 428 |
429 if (!fullInvalidation) { | 429 if (!fullInvalidation) { |
430 fullyInvalidatePaint(PaintInvalidationSelection, oldSelectionRect, newSe
lectionRect); | 430 fullyInvalidatePaint(PaintInvalidationSelection, oldSelectionRect, newSe
lectionRect); |
431 m_context.paintingLayer->setNeedsRepaint(); | 431 m_context.paintingLayer->setNeedsRepaint(); |
432 m_object.invalidateDisplayItemClients(PaintInvalidationSelection); | 432 m_object.invalidateDisplayItemClients(PaintInvalidationSelection); |
433 } | 433 } |
434 } | 434 } |
435 | 435 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 m_object.invalidateDisplayItemClients(reason); | 467 m_object.invalidateDisplayItemClients(reason); |
468 return reason; | 468 return reason; |
469 } | 469 } |
470 | 470 |
471 DisablePaintInvalidationStateAsserts::DisablePaintInvalidationStateAsserts() | 471 DisablePaintInvalidationStateAsserts::DisablePaintInvalidationStateAsserts() |
472 : m_disabler(&gDisablePaintInvalidationStateAsserts, true) | 472 : m_disabler(&gDisablePaintInvalidationStateAsserts, true) |
473 { | 473 { |
474 } | 474 } |
475 | 475 |
476 } // namespace blink | 476 } // namespace blink |
OLD | NEW |