| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv
ed. | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv
ed. |
| 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) | 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) |
| 6 * Copyright (C) 2010 Daniel Bates (dbates@intudata.com) | 6 * Copyright (C) 2010 Daniel Bates (dbates@intudata.com) |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1121 return LayoutRect(0, newLogicalTop, width(), root->selectionHeight()); | 1121 return LayoutRect(0, newLogicalTop, width(), root->selectionHeight()); |
| 1122 return LayoutRect(newLogicalTop, 0, root->selectionHeight(), height()); | 1122 return LayoutRect(newLogicalTop, 0, root->selectionHeight(), height()); |
| 1123 } | 1123 } |
| 1124 | 1124 |
| 1125 void RenderListMarker::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffse
t) | 1125 void RenderListMarker::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffse
t) |
| 1126 { | 1126 { |
| 1127 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this); | 1127 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this); |
| 1128 | 1128 |
| 1129 if (paintInfo.phase != PaintPhaseForeground) | 1129 if (paintInfo.phase != PaintPhaseForeground) |
| 1130 return; | 1130 return; |
| 1131 | 1131 |
| 1132 if (style()->visibility() != VISIBLE) | 1132 if (style()->visibility() != VISIBLE) |
| 1133 return; | 1133 return; |
| 1134 | 1134 |
| 1135 LayoutPoint boxOrigin(paintOffset + location()); | 1135 LayoutPoint boxOrigin(paintOffset + location()); |
| 1136 LayoutRect overflowRect(visualOverflowRect()); | 1136 LayoutRect overflowRect(visualOverflowRect()); |
| 1137 overflowRect.moveBy(boxOrigin); | 1137 overflowRect.moveBy(boxOrigin); |
| 1138 overflowRect.inflate(maximalOutlineSize(paintInfo.phase)); | 1138 overflowRect.inflate(maximalOutlineSize(paintInfo.phase)); |
| 1139 | 1139 |
| 1140 if (!paintInfo.rect.intersects(pixelSnappedIntRect(overflowRect))) | 1140 if (!paintInfo.rect.intersects(pixelSnappedIntRect(overflowRect))) |
| 1141 return; | 1141 return; |
| 1142 | 1142 |
| 1143 LayoutRect box(boxOrigin, size()); | 1143 LayoutRect box(boxOrigin, size()); |
| 1144 | 1144 |
| 1145 IntRect marker = getRelativeMarkerRect(); | 1145 IntRect marker = getRelativeMarkerRect(); |
| 1146 marker.moveBy(roundedIntPoint(boxOrigin)); | 1146 marker.moveBy(roundedIntPoint(boxOrigin)); |
| 1147 | 1147 |
| 1148 GraphicsContext* context = paintInfo.context; | 1148 GraphicsContext* context = paintInfo.context; |
| 1149 | 1149 |
| 1150 if (isImage()) { | 1150 if (isImage()) { |
| 1151 context->drawImage(m_image->image(this, marker.size()).get(), style()->c
olorSpace(), marker); | 1151 context->drawImage(m_image->image(this, marker.size()).get(), marker); |
| 1152 if (selectionState() != SelectionNone) { | 1152 if (selectionState() != SelectionNone) { |
| 1153 LayoutRect selRect = localSelectionRect(); | 1153 LayoutRect selRect = localSelectionRect(); |
| 1154 selRect.moveBy(boxOrigin); | 1154 selRect.moveBy(boxOrigin); |
| 1155 context->fillRect(pixelSnappedIntRect(selRect), selectionBackgroundC
olor(), style()->colorSpace()); | 1155 context->fillRect(pixelSnappedIntRect(selRect), selectionBackgroundC
olor()); |
| 1156 } | 1156 } |
| 1157 return; | 1157 return; |
| 1158 } | 1158 } |
| 1159 | 1159 |
| 1160 if (selectionState() != SelectionNone) { | 1160 if (selectionState() != SelectionNone) { |
| 1161 LayoutRect selRect = localSelectionRect(); | 1161 LayoutRect selRect = localSelectionRect(); |
| 1162 selRect.moveBy(boxOrigin); | 1162 selRect.moveBy(boxOrigin); |
| 1163 context->fillRect(pixelSnappedIntRect(selRect), selectionBackgroundColor
(), style()->colorSpace()); | 1163 context->fillRect(pixelSnappedIntRect(selRect), selectionBackgroundColor
()); |
| 1164 } | 1164 } |
| 1165 | 1165 |
| 1166 const Color color(style()->visitedDependentColor(CSSPropertyColor)); | 1166 const Color color(style()->visitedDependentColor(CSSPropertyColor)); |
| 1167 context->setStrokeColor(color, style()->colorSpace()); | 1167 context->setStrokeColor(color); |
| 1168 context->setStrokeStyle(SolidStroke); | 1168 context->setStrokeStyle(SolidStroke); |
| 1169 context->setStrokeThickness(1.0f); | 1169 context->setStrokeThickness(1.0f); |
| 1170 context->setFillColor(color, style()->colorSpace()); | 1170 context->setFillColor(color); |
| 1171 | 1171 |
| 1172 EListStyleType type = style()->listStyleType(); | 1172 EListStyleType type = style()->listStyleType(); |
| 1173 switch (type) { | 1173 switch (type) { |
| 1174 case Disc: | 1174 case Disc: |
| 1175 context->fillEllipse(marker); | 1175 context->fillEllipse(marker); |
| 1176 return; | 1176 return; |
| 1177 case Circle: | 1177 case Circle: |
| 1178 context->strokeEllipse(marker); | 1178 context->strokeEllipse(marker); |
| 1179 return; | 1179 return; |
| 1180 case Square: | 1180 case Square: |
| (...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1850 void RenderListMarker::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) con
st | 1850 void RenderListMarker::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) con
st |
| 1851 { | 1851 { |
| 1852 MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering)
; | 1852 MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering)
; |
| 1853 RenderBox::reportMemoryUsage(memoryObjectInfo); | 1853 RenderBox::reportMemoryUsage(memoryObjectInfo); |
| 1854 info.addMember(m_text, "text"); | 1854 info.addMember(m_text, "text"); |
| 1855 info.addMember(m_image, "image"); | 1855 info.addMember(m_image, "image"); |
| 1856 info.addMember(m_listItem, "listItem"); | 1856 info.addMember(m_listItem, "listItem"); |
| 1857 } | 1857 } |
| 1858 | 1858 |
| 1859 } // namespace WebCore | 1859 } // namespace WebCore |
| OLD | NEW |