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

Side by Side Diff: Source/core/rendering/RenderTableCell.cpp

Issue 564973002: Move a bunch more painting code out of RenderBoxModelObject and into BoxPainter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove unnecessary include. Created 6 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 /* 1 /*
2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 1135
1136 // We never paint diagonals at the joins. We simply let the border with the highest 1136 // We never paint diagonals at the joins. We simply let the border with the highest
1137 // precedence paint on top of borders with lower precedence. 1137 // precedence paint on top of borders with lower precedence.
1138 CollapsedBorders borders; 1138 CollapsedBorders borders;
1139 borders.addBorder(topVal, BSTop, renderTop, borderRect.x(), borderRect.y(), borderRect.maxX(), borderRect.y() + topWidth, topStyle); 1139 borders.addBorder(topVal, BSTop, renderTop, borderRect.x(), borderRect.y(), borderRect.maxX(), borderRect.y() + topWidth, topStyle);
1140 borders.addBorder(bottomVal, BSBottom, renderBottom, borderRect.x(), borderR ect.maxY() - bottomWidth, borderRect.maxX(), borderRect.maxY(), bottomStyle); 1140 borders.addBorder(bottomVal, BSBottom, renderBottom, borderRect.x(), borderR ect.maxY() - bottomWidth, borderRect.maxX(), borderRect.maxY(), bottomStyle);
1141 borders.addBorder(leftVal, BSLeft, renderLeft, borderRect.x(), borderRect.y( ), borderRect.x() + leftWidth, borderRect.maxY(), leftStyle); 1141 borders.addBorder(leftVal, BSLeft, renderLeft, borderRect.x(), borderRect.y( ), borderRect.x() + leftWidth, borderRect.maxY(), leftStyle);
1142 borders.addBorder(rightVal, BSRight, renderRight, borderRect.maxX() - rightW idth, borderRect.y(), borderRect.maxX(), borderRect.maxY(), rightStyle); 1142 borders.addBorder(rightVal, BSRight, renderRight, borderRect.maxX() - rightW idth, borderRect.y(), borderRect.maxX(), borderRect.maxY(), rightStyle);
1143 1143
1144 GraphicsContext* graphicsContext = paintInfo.context; 1144 GraphicsContext* graphicsContext = paintInfo.context;
1145 bool antialias = shouldAntialiasLines(graphicsContext); 1145 bool antialias = BoxPainter::shouldAntialiasLines(graphicsContext);
1146 1146
1147 for (CollapsedBorder* border = borders.nextBorder(); border; border = border s.nextBorder()) { 1147 for (CollapsedBorder* border = borders.nextBorder(); border; border = border s.nextBorder()) {
1148 if (border->borderValue.isSameIgnoringColor(*table()->currentBorderValue ())) { 1148 if (border->borderValue.isSameIgnoringColor(*table()->currentBorderValue ())) {
1149 drawLineForBoxSide(graphicsContext, border->x1, border->y1, border-> x2, border->y2, border->side, 1149 drawLineForBoxSide(graphicsContext, border->x1, border->y1, border-> x2, border->y2, border->side,
1150 border->borderValue.color().resolve(style()->visitedDependentCol or(CSSPropertyColor)), border->style, 0, 0, antialias); 1150 border->borderValue.color().resolve(style()->visitedDependentCol or(CSSPropertyColor)), border->style, 0, 0, antialias);
1151 } 1151 }
1152 } 1152 }
1153 } 1153 }
1154 1154
1155 void RenderTableCell::paintBackgroundsBehindCell(PaintInfo& paintInfo, const Lay outPoint& paintOffset, RenderObject* backgroundObject) 1155 void RenderTableCell::paintBackgroundsBehindCell(PaintInfo& paintInfo, const Lay outPoint& paintOffset, RenderObject* backgroundObject)
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 1190
1191 void RenderTableCell::paintBoxDecorationBackground(PaintInfo& paintInfo, const L ayoutPoint& paintOffset) 1191 void RenderTableCell::paintBoxDecorationBackground(PaintInfo& paintInfo, const L ayoutPoint& paintOffset)
1192 { 1192 {
1193 if (!paintInfo.shouldPaintWithinRoot(this)) 1193 if (!paintInfo.shouldPaintWithinRoot(this))
1194 return; 1194 return;
1195 1195
1196 RenderTable* tableElt = table(); 1196 RenderTable* tableElt = table();
1197 if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstC hild()) 1197 if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstC hild())
1198 return; 1198 return;
1199 1199
1200 BoxPainter boxPainter(*this);
1201
1200 LayoutRect paintRect = LayoutRect(paintOffset, pixelSnappedSize()); 1202 LayoutRect paintRect = LayoutRect(paintOffset, pixelSnappedSize());
1201 paintBoxShadow(paintInfo, paintRect, style(), Normal); 1203 boxPainter.paintBoxShadow(paintInfo, paintRect, style(), Normal);
1202 1204
1203 // Paint our cell background. 1205 // Paint our cell background.
1204 paintBackgroundsBehindCell(paintInfo, paintOffset, this); 1206 paintBackgroundsBehindCell(paintInfo, paintOffset, this);
1205 1207
1206 paintBoxShadow(paintInfo, paintRect, style(), Inset); 1208 boxPainter.paintBoxShadow(paintInfo, paintRect, style(), Inset);
1207 1209
1208 if (!style()->hasBorder() || tableElt->collapseBorders()) 1210 if (!style()->hasBorder() || tableElt->collapseBorders())
1209 return; 1211 return;
1210 1212
1211 paintBorder(paintInfo, paintRect, style()); 1213 BoxPainter(*this).paintBorder(paintInfo, paintRect, style());
pdr. 2014/09/11 21:00:39 Similarly here.
1212 } 1214 }
1213 1215
1214 void RenderTableCell::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOf fset) 1216 void RenderTableCell::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOf fset)
1215 { 1217 {
1216 if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask) 1218 if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
1217 return; 1219 return;
1218 1220
1219 RenderTable* tableElt = table(); 1221 RenderTable* tableElt = table();
1220 if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstC hild()) 1222 if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstC hild())
1221 return; 1223 return;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1261 1263
1262 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const Render Object* parent) 1264 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const Render Object* parent)
1263 { 1265 {
1264 RenderTableCell* newCell = RenderTableCell::createAnonymous(&parent->documen t()); 1266 RenderTableCell* newCell = RenderTableCell::createAnonymous(&parent->documen t());
1265 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay( parent->style(), TABLE_CELL); 1267 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay( parent->style(), TABLE_CELL);
1266 newCell->setStyle(newStyle.release()); 1268 newCell->setStyle(newStyle.release());
1267 return newCell; 1269 return newCell;
1268 } 1270 }
1269 1271
1270 } // namespace blink 1272 } // namespace blink
OLDNEW
« Source/core/rendering/RenderFieldset.cpp ('K') | « Source/core/rendering/RenderObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698