| 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/PaintInvalidator.h" | 5 #include "core/paint/PaintInvalidator.h" |
| 6 | 6 |
| 7 #include "core/editing/FrameSelection.h" | 7 #include "core/editing/FrameSelection.h" |
| 8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
| 9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
| 10 #include "core/frame/Settings.h" | 10 #include "core/frame/Settings.h" |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 &layoutView->containerForPaintInvalidation(); | 356 &layoutView->containerForPaintInvalidation(); |
| 357 context.paintingLayer = layoutView->layer(); | 357 context.paintingLayer = layoutView->layer(); |
| 358 | 358 |
| 359 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 359 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
| 360 ScopedUndoFrameViewContentClipAndScroll undo(frameView, context); | 360 ScopedUndoFrameViewContentClipAndScroll undo(frameView, context); |
| 361 frameView.invalidatePaintOfScrollControlsIfNeeded(context); | 361 frameView.invalidatePaintOfScrollControlsIfNeeded(context); |
| 362 } | 362 } |
| 363 | 363 |
| 364 if (frameView.frame().selection().isCaretBoundsDirty()) | 364 if (frameView.frame().selection().isCaretBoundsDirty()) |
| 365 frameView.frame().selection().invalidateCaretRect(); | 365 frameView.frame().selection().invalidateCaretRect(); |
| 366 | |
| 367 // Temporary callback for crbug.com/487345,402044 | |
| 368 // TODO(ojan): Make this more general to be used by PositionObserver | |
| 369 // and rAF throttling. | |
| 370 IntRect visibleRect = | |
| 371 frameView.rootFrameToContents(frameView.computeVisibleArea()); | |
| 372 layoutView->sendMediaPositionChangeNotifications(visibleRect); | |
| 373 } | 366 } |
| 374 | 367 |
| 375 void PaintInvalidator::invalidatePaintIfNeeded( | 368 void PaintInvalidator::invalidatePaintIfNeeded( |
| 376 const LayoutObject& object, | 369 const LayoutObject& object, |
| 377 PaintInvalidatorContext& context) { | 370 PaintInvalidatorContext& context) { |
| 378 object.getMutableForPainting().ensureIsReadyForPaintInvalidation(); | 371 object.getMutableForPainting().ensureIsReadyForPaintInvalidation(); |
| 379 | 372 |
| 380 if (!context.forcedSubtreeInvalidationFlags && | 373 if (!context.forcedSubtreeInvalidationFlags && |
| 381 !object | 374 !object |
| 382 .shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState()) | 375 .shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState()) |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 PaintInvalidatorContext::ForcedSubtreeInvalidationRectUpdate; | 433 PaintInvalidatorContext::ForcedSubtreeInvalidationRectUpdate; |
| 441 } | 434 } |
| 442 | 435 |
| 443 void PaintInvalidator::processPendingDelayedPaintInvalidations() { | 436 void PaintInvalidator::processPendingDelayedPaintInvalidations() { |
| 444 for (auto target : m_pendingDelayedPaintInvalidations) | 437 for (auto target : m_pendingDelayedPaintInvalidations) |
| 445 target->getMutableForPainting().setShouldDoFullPaintInvalidation( | 438 target->getMutableForPainting().setShouldDoFullPaintInvalidation( |
| 446 PaintInvalidationDelayedFull); | 439 PaintInvalidationDelayedFull); |
| 447 } | 440 } |
| 448 | 441 |
| 449 } // namespace blink | 442 } // namespace blink |
| OLD | NEW |