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

Side by Side Diff: Source/core/paint/ListMarkerPainter.cpp

Issue 1159033010: [S.P.] Include selection rect in list marker cull rect when needed (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 "config.h" 5 #include "config.h"
6 #include "core/paint/ListMarkerPainter.h" 6 #include "core/paint/ListMarkerPainter.h"
7 7
8 #include "core/layout/LayoutListItem.h" 8 #include "core/layout/LayoutListItem.h"
9 #include "core/layout/LayoutListMarker.h" 9 #include "core/layout/LayoutListMarker.h"
10 #include "core/layout/TextRunConstructor.h" 10 #include "core/layout/TextRunConstructor.h"
11 #include "core/paint/BlockPainter.h" 11 #include "core/paint/BlockPainter.h"
12 #include "core/paint/LayoutObjectDrawingRecorder.h" 12 #include "core/paint/LayoutObjectDrawingRecorder.h"
13 #include "core/paint/PaintInfo.h" 13 #include "core/paint/PaintInfo.h"
14 #include "platform/geometry/LayoutPoint.h" 14 #include "platform/geometry/LayoutPoint.h"
15 #include "platform/graphics/GraphicsContextStateSaver.h" 15 #include "platform/graphics/GraphicsContextStateSaver.h"
16 #include "wtf/unicode/CharacterNames.h" 16 #include "wtf/unicode/CharacterNames.h"
17 17
18 namespace blink { 18 namespace blink {
19 19
20 void ListMarkerPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& pai ntOffset) 20 void ListMarkerPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& pai ntOffset)
21 { 21 {
22 if (paintInfo.phase != PaintPhaseForeground) 22 if (paintInfo.phase != PaintPhaseForeground)
23 return; 23 return;
24 24
25 if (m_layoutListMarker.style()->visibility() != VISIBLE) 25 if (m_layoutListMarker.style()->visibility() != VISIBLE)
26 return; 26 return;
27 27
28 LayoutPoint boxOrigin(paintOffset + m_layoutListMarker.location()); 28 LayoutPoint boxOrigin(paintOffset + m_layoutListMarker.location());
29 LayoutRect overflowRect(m_layoutListMarker.visualOverflowRect()); 29 LayoutRect overflowRect(m_layoutListMarker.visualOverflowRect());
30 if (m_layoutListMarker.selectionState() != LayoutObject::SelectionNone)
31 overflowRect.unite(m_layoutListMarker.localSelectionRect());
chrishtr 2015/06/04 18:13:22 I wonder if the other classes that have a special
fs 2015/06/05 08:56:19 Most likely - I added one for InlineTextBox last w
30 overflowRect.moveBy(boxOrigin); 32 overflowRect.moveBy(boxOrigin);
31 33
32 IntRect pixelSnappedOverflowRect = pixelSnappedIntRect(overflowRect); 34 IntRect pixelSnappedOverflowRect = pixelSnappedIntRect(overflowRect);
33 if (!paintInfo.rect.intersects(pixelSnappedOverflowRect)) 35 if (!paintInfo.rect.intersects(pixelSnappedOverflowRect))
34 return; 36 return;
35 37
36 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutListMarker, paintInfo.phase, pixelSnappedOverflowRect); 38 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutListMarker, paintInfo.phase, pixelSnappedOverflowRect);
37 if (recorder.canUseCachedDrawing()) 39 if (recorder.canUseCachedDrawing())
38 return; 40 return;
39 41
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 context->drawText(font, textRunPaintInfo, textOrigin); 210 context->drawText(font, textRunPaintInfo, textOrigin);
209 context->drawText(font, suffixRunInfo, textOrigin + IntSize(font.wid th(textRun), 0)); 211 context->drawText(font, suffixRunInfo, textOrigin + IntSize(font.wid th(textRun), 0));
210 } else { 212 } else {
211 context->drawText(font, suffixRunInfo, textOrigin); 213 context->drawText(font, suffixRunInfo, textOrigin);
212 context->drawText(font, textRunPaintInfo, textOrigin + IntSize(font. width(suffixRun), 0)); 214 context->drawText(font, textRunPaintInfo, textOrigin + IntSize(font. width(suffixRun), 0));
213 } 215 }
214 } 216 }
215 } 217 }
216 218
217 } // namespace blink 219 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698