| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/ViewPaintInvalidator.h" | 5 #include "core/paint/ViewPaintInvalidator.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutView.h" | 7 #include "core/layout/LayoutView.h" |
| 8 #include "core/paint/BoxPaintInvalidator.h" | 8 #include "core/paint/BoxPaintInvalidator.h" |
| 9 #include "platform/geometry/LayoutSize.h" | 9 #include "platform/geometry/LayoutSize.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 PaintInvalidationReason ViewPaintInvalidator::InvalidatePaintIfNeeded() { | 13 PaintInvalidationReason ViewPaintInvalidator::InvalidatePaint() { |
| 14 InvalidateBackgroundIfNeeded(); | 14 InvalidateBackgroundIfNeeded(); |
| 15 return BoxPaintInvalidator(view_, context_).InvalidatePaintIfNeeded(); | 15 return BoxPaintInvalidator(view_, context_).InvalidatePaint(); |
| 16 } | 16 } |
| 17 | 17 |
| 18 void ViewPaintInvalidator::InvalidateBackgroundIfNeeded() { | 18 void ViewPaintInvalidator::InvalidateBackgroundIfNeeded() { |
| 19 // Fixed attachment background is handled in LayoutView::layout(). | 19 // Fixed attachment background is handled in LayoutView::layout(). |
| 20 // TODO(wangxianzhu): Combine code for fixed-attachment background when we | 20 // TODO(wangxianzhu): Combine code for fixed-attachment background when we |
| 21 // enable rootLayerScrolling permanently. | 21 // enable rootLayerScrolling permanently. |
| 22 if (view_.StyleRef().HasEntirelyFixedBackground()) | 22 if (view_.StyleRef().HasEntirelyFixedBackground()) |
| 23 return; | 23 return; |
| 24 | 24 |
| 25 // LayoutView's non-fixed-attachment background is positioned in the | 25 // LayoutView's non-fixed-attachment background is positioned in the |
| (...skipping 15 matching lines...) Expand all Loading... |
| 41 background_layers)) || | 41 background_layers)) || |
| 42 (old_size.Height() != new_size.Height() && | 42 (old_size.Height() != new_size.Height() && |
| 43 LayoutBox::MustInvalidateFillLayersPaintOnHeightChange( | 43 LayoutBox::MustInvalidateFillLayersPaintOnHeightChange( |
| 44 background_layers))) { | 44 background_layers))) { |
| 45 view_.GetMutableForPainting().SetShouldDoFullPaintInvalidation( | 45 view_.GetMutableForPainting().SetShouldDoFullPaintInvalidation( |
| 46 kPaintInvalidationViewBackground); | 46 kPaintInvalidationViewBackground); |
| 47 } | 47 } |
| 48 } | 48 } |
| 49 | 49 |
| 50 } // namespace blink | 50 } // namespace blink |
| OLD | NEW |