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

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

Issue 1955423004: Include selection rect in paint invalidation for LayoutText. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to head and add one test. Created 4 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutText.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/BoxClipper.h" 5 #include "core/paint/BoxClipper.h"
6 6
7 #include "core/layout/LayoutBox.h" 7 #include "core/layout/LayoutBox.h"
8 #include "core/paint/ObjectPaintProperties.h" 8 #include "core/paint/ObjectPaintProperties.h"
9 #include "core/paint/PaintInfo.h" 9 #include "core/paint/PaintInfo.h"
10 #include "core/paint/PaintLayer.h" 10 #include "core/paint/PaintLayer.h"
(...skipping 29 matching lines...) Expand all
40 40
41 if (!isControlClip && !isOverflowOrContainmentClip) 41 if (!isControlClip && !isOverflowOrContainmentClip)
42 return; 42 return;
43 43
44 LayoutRect clipRect = isControlClip ? m_box.controlClipRect(accumulatedOffse t) : m_box.overflowClipRect(accumulatedOffset); 44 LayoutRect clipRect = isControlClip ? m_box.controlClipRect(accumulatedOffse t) : m_box.overflowClipRect(accumulatedOffset);
45 FloatRoundedRect clipRoundedRect(0, 0, 0, 0); 45 FloatRoundedRect clipRoundedRect(0, 0, 0, 0);
46 bool hasBorderRadius = m_box.style()->hasBorderRadius(); 46 bool hasBorderRadius = m_box.style()->hasBorderRadius();
47 if (hasBorderRadius) 47 if (hasBorderRadius)
48 clipRoundedRect = m_box.style()->getRoundedInnerBorderFor(LayoutRect(acc umulatedOffset, m_box.size())); 48 clipRoundedRect = m_box.style()->getRoundedInnerBorderFor(LayoutRect(acc umulatedOffset, m_box.size()));
49 49
50 // Selection does not affect visual overflow, so this optimization is invali d if selection 50 // Selection may extend beyond visual overflow, so this optimization is inva lid if selection is present.
51 // is present.
52 if (contentsClipBehavior == SkipContentsClipIfPossible && box.getSelectionSt ate() == SelectionNone) { 51 if (contentsClipBehavior == SkipContentsClipIfPossible && box.getSelectionSt ate() == SelectionNone) {
53 LayoutRect contentsVisualOverflow = m_box.contentsVisualOverflowRect(); 52 LayoutRect contentsVisualOverflow = m_box.contentsVisualOverflowRect();
54 if (contentsVisualOverflow.isEmpty()) 53 if (contentsVisualOverflow.isEmpty())
55 return; 54 return;
56 55
57 LayoutRect conservativeClipRect = clipRect; 56 LayoutRect conservativeClipRect = clipRect;
58 if (hasBorderRadius) 57 if (hasBorderRadius)
59 conservativeClipRect.intersect(LayoutRect(clipRoundedRect.radiusCent erRect())); 58 conservativeClipRect.intersect(LayoutRect(clipRoundedRect.radiusCent erRect()));
60 conservativeClipRect.moveBy(-accumulatedOffset); 59 conservativeClipRect.moveBy(-accumulatedOffset);
61 if (m_box.hasLayer()) 60 if (m_box.hasLayer())
(...skipping 14 matching lines...) Expand all
76 BoxClipper::~BoxClipper() 75 BoxClipper::~BoxClipper()
77 { 76 {
78 if (m_clipType == DisplayItem::UninitializedType) 77 if (m_clipType == DisplayItem::UninitializedType)
79 return; 78 return;
80 79
81 ASSERT(m_box.hasControlClip() || (m_box.hasOverflowClip() && !m_box.layer()- >isSelfPaintingLayer()) || m_box.style()->containsPaint()); 80 ASSERT(m_box.hasControlClip() || (m_box.hasOverflowClip() && !m_box.layer()- >isSelfPaintingLayer()) || m_box.style()->containsPaint());
82 m_paintInfo.context.getPaintController().endItem<EndClipDisplayItem>(m_box, DisplayItem::clipTypeToEndClipType(m_clipType)); 81 m_paintInfo.context.getPaintController().endItem<EndClipDisplayItem>(m_box, DisplayItem::clipTypeToEndClipType(m_clipType));
83 } 82 }
84 83
85 } // namespace blink 84 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutText.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698