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

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

Issue 1427943002: Wrap SVGImage for container during paint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use IntSize for SVGImageForContainer Created 5 years, 1 month 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 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/ListMarkerText.h" 10 #include "core/layout/ListMarkerText.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutListMarker, paintInfo.phase, pixelSnappedOverflowRect, paintOffset); 67 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutListMarker, paintInfo.phase, pixelSnappedOverflowRect, paintOffset);
68 68
69 LayoutRect box(boxOrigin, m_layoutListMarker.size()); 69 LayoutRect box(boxOrigin, m_layoutListMarker.size());
70 70
71 IntRect marker = m_layoutListMarker.getRelativeMarkerRect(); 71 IntRect marker = m_layoutListMarker.getRelativeMarkerRect();
72 marker.moveBy(roundedIntPoint(boxOrigin)); 72 marker.moveBy(roundedIntPoint(boxOrigin));
73 73
74 GraphicsContext* context = paintInfo.context; 74 GraphicsContext* context = paintInfo.context;
75 75
76 if (m_layoutListMarker.isImage()) { 76 if (m_layoutListMarker.isImage()) {
77 context->drawImage(m_layoutListMarker.image()->image(&m_layoutListMarker , marker.size()).get(), marker); 77 context->drawImage(m_layoutListMarker.image()->image(
78 &m_layoutListMarker, marker.size(), m_layoutListMarker.styleRef().ef fectiveZoom()).get(), marker);
78 if (m_layoutListMarker.selectionState() != SelectionNone) { 79 if (m_layoutListMarker.selectionState() != SelectionNone) {
79 LayoutRect selRect = m_layoutListMarker.localSelectionRect(); 80 LayoutRect selRect = m_layoutListMarker.localSelectionRect();
80 selRect.moveBy(boxOrigin); 81 selRect.moveBy(boxOrigin);
81 context->fillRect(pixelSnappedIntRect(selRect), m_layoutListMarker.l istItem()->selectionBackgroundColor()); 82 context->fillRect(pixelSnappedIntRect(selRect), m_layoutListMarker.l istItem()->selectionBackgroundColor());
82 } 83 }
83 return; 84 return;
84 } 85 }
85 86
86 if (!RuntimeEnabledFeatures::selectionPaintingWithoutSelectionGapsEnabled() 87 if (!RuntimeEnabledFeatures::selectionPaintingWithoutSelectionGapsEnabled()
87 && m_layoutListMarker.selectionState() != SelectionNone) { 88 && m_layoutListMarker.selectionState() != SelectionNone) {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 if (m_layoutListMarker.style()->isLeftToRightDirection()) { 148 if (m_layoutListMarker.style()->isLeftToRightDirection()) {
148 context->drawText(font, textRunPaintInfo, textOrigin); 149 context->drawText(font, textRunPaintInfo, textOrigin);
149 context->drawText(font, suffixRunInfo, textOrigin + IntSize(font.width(t extRun), 0)); 150 context->drawText(font, suffixRunInfo, textOrigin + IntSize(font.width(t extRun), 0));
150 } else { 151 } else {
151 context->drawText(font, suffixRunInfo, textOrigin); 152 context->drawText(font, suffixRunInfo, textOrigin);
152 context->drawText(font, textRunPaintInfo, textOrigin + IntSize(font.widt h(suffixRun), 0)); 153 context->drawText(font, textRunPaintInfo, textOrigin + IntSize(font.widt h(suffixRun), 0));
153 } 154 }
154 } 155 }
155 156
156 } // namespace blink 157 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/ImagePainter.cpp ('k') | third_party/WebKit/Source/core/paint/NinePieceImagePainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698