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

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

Issue 1316163002: Make the LayoutRect->FloatRect constructor explicit. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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
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"
(...skipping 21 matching lines...) Expand all
32 LayoutPoint boxOrigin(paintOffset + m_layoutListMarker.location()); 32 LayoutPoint boxOrigin(paintOffset + m_layoutListMarker.location());
33 LayoutRect overflowRect(m_layoutListMarker.visualOverflowRect()); 33 LayoutRect overflowRect(m_layoutListMarker.visualOverflowRect());
34 if (m_layoutListMarker.selectionState() != SelectionNone) 34 if (m_layoutListMarker.selectionState() != SelectionNone)
35 overflowRect.unite(m_layoutListMarker.localSelectionRect()); 35 overflowRect.unite(m_layoutListMarker.localSelectionRect());
36 overflowRect.moveBy(boxOrigin); 36 overflowRect.moveBy(boxOrigin);
37 37
38 IntRect pixelSnappedOverflowRect = pixelSnappedIntRect(overflowRect); 38 IntRect pixelSnappedOverflowRect = pixelSnappedIntRect(overflowRect);
39 if (!paintInfo.rect.intersects(pixelSnappedOverflowRect)) 39 if (!paintInfo.rect.intersects(pixelSnappedOverflowRect))
40 return; 40 return;
41 41
42 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutListMarker, paintInfo.phase, pixelSnappedOverflowRect); 42 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutListMarker, paintInfo.phase, LayoutRect(pixelSnappedOverflowRect));
jbroman 2015/08/26 21:45:08 this can use the IntRect overload you added, no ne
chrishtr 2015/08/26 22:32:21 Done.
43 43
44 LayoutRect box(boxOrigin, m_layoutListMarker.size()); 44 LayoutRect box(boxOrigin, m_layoutListMarker.size());
45 45
46 IntRect marker = m_layoutListMarker.getRelativeMarkerRect(); 46 IntRect marker = m_layoutListMarker.getRelativeMarkerRect();
47 marker.moveBy(roundedIntPoint(boxOrigin)); 47 marker.moveBy(roundedIntPoint(boxOrigin));
48 48
49 GraphicsContext* context = paintInfo.context; 49 GraphicsContext* context = paintInfo.context;
50 50
51 if (m_layoutListMarker.isImage()) { 51 if (m_layoutListMarker.isImage()) {
52 context->drawImage(m_layoutListMarker.image()->image(&m_layoutListMarker , marker.size()).get(), marker); 52 context->drawImage(m_layoutListMarker.image()->image(&m_layoutListMarker , marker.size()).get(), marker);
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 if (m_layoutListMarker.style()->isLeftToRightDirection()) { 183 if (m_layoutListMarker.style()->isLeftToRightDirection()) {
184 context->drawText(font, textRunPaintInfo, textOrigin); 184 context->drawText(font, textRunPaintInfo, textOrigin);
185 context->drawText(font, suffixRunInfo, textOrigin + IntSize(font.width(t extRun), 0)); 185 context->drawText(font, suffixRunInfo, textOrigin + IntSize(font.width(t extRun), 0));
186 } else { 186 } else {
187 context->drawText(font, suffixRunInfo, textOrigin); 187 context->drawText(font, suffixRunInfo, textOrigin);
188 context->drawText(font, textRunPaintInfo, textOrigin + IntSize(font.widt h(suffixRun), 0)); 188 context->drawText(font, textRunPaintInfo, textOrigin + IntSize(font.widt h(suffixRun), 0));
189 } 189 }
190 } 190 }
191 191
192 } // namespace blink 192 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698