Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Side by Side Diff: third_party/WebKit/Source/core/paint/BlockFlowPaintInvalidator.cpp

Issue 2872423002: Tweak PaintInvalidationReasons (Closed)
Patch Set: Rebaseline-cl Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/BlockFlowPaintInvalidator.h" 5 #include "core/paint/BlockFlowPaintInvalidator.h"
6 6
7 #include "core/layout/LayoutBlockFlow.h" 7 #include "core/layout/LayoutBlockFlow.h"
8 #include "core/layout/LayoutInline.h" 8 #include "core/layout/LayoutInline.h"
9 #include "core/paint/BoxPaintInvalidator.h" 9 #include "core/paint/BoxPaintInvalidator.h"
10 #include "core/paint/PaintInvalidator.h" 10 #include "core/paint/PaintInvalidator.h"
(...skipping 28 matching lines...) Expand all
39 } 39 }
40 40
41 void BlockFlowPaintInvalidator::InvalidateDisplayItemClients( 41 void BlockFlowPaintInvalidator::InvalidateDisplayItemClients(
42 PaintInvalidationReason reason) { 42 PaintInvalidationReason reason) {
43 ObjectPaintInvalidator object_paint_invalidator(block_flow_); 43 ObjectPaintInvalidator object_paint_invalidator(block_flow_);
44 object_paint_invalidator.InvalidateDisplayItemClient(block_flow_, reason); 44 object_paint_invalidator.InvalidateDisplayItemClient(block_flow_, reason);
45 45
46 // PaintInvalidationRectangle happens when we invalidate the caret. 46 // PaintInvalidationRectangle happens when we invalidate the caret.
47 // The later conditions don't apply when we invalidate the caret or the 47 // The later conditions don't apply when we invalidate the caret or the
48 // selection. 48 // selection.
49 if (reason == kPaintInvalidationRectangle || 49 if (reason == PaintInvalidationReason::kRectangle ||
50 reason == kPaintInvalidationSelection) 50 reason == PaintInvalidationReason::kSelection)
51 return; 51 return;
52 52
53 RootInlineBox* line = block_flow_.FirstRootBox(); 53 RootInlineBox* line = block_flow_.FirstRootBox();
54 if (line && line->IsFirstLineStyle()) { 54 if (line && line->IsFirstLineStyle()) {
55 // It's the RootInlineBox that paints the ::first-line background. Note that 55 // It's the RootInlineBox that paints the ::first-line background. Note that
56 // since it may be expensive to figure out if the first line is affected by 56 // since it may be expensive to figure out if the first line is affected by
57 // any ::first-line selectors at all, we just invalidate it unconditionally 57 // any ::first-line selectors at all, we just invalidate it unconditionally
58 // which is typically cheaper. 58 // which is typically cheaper.
59 object_paint_invalidator.InvalidateDisplayItemClient(*line, reason); 59 object_paint_invalidator.InvalidateDisplayItemClient(*line, reason);
60 } 60 }
61 61
62 if (block_flow_.MultiColumnFlowThread()) { 62 if (block_flow_.MultiColumnFlowThread()) {
63 // Invalidate child LayoutMultiColumnSets which may need to repaint column 63 // Invalidate child LayoutMultiColumnSets which may need to repaint column
64 // rules after m_blockFlow's column rule style and/or layout changed. 64 // rules after m_blockFlow's column rule style and/or layout changed.
65 for (LayoutObject* child = block_flow_.FirstChild(); child; 65 for (LayoutObject* child = block_flow_.FirstChild(); child;
66 child = child->NextSibling()) { 66 child = child->NextSibling()) {
67 if (child->IsLayoutMultiColumnSet() && 67 if (child->IsLayoutMultiColumnSet() &&
68 !child->ShouldDoFullPaintInvalidation()) 68 !child->ShouldDoFullPaintInvalidation())
69 object_paint_invalidator.InvalidateDisplayItemClient(*child, reason); 69 object_paint_invalidator.InvalidateDisplayItemClient(*child, reason);
70 } 70 }
71 } 71 }
72 } 72 }
73 73
74 } // namespace blink 74 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698