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

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

Issue 381473002: Use reference for FillLayer if possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | « Source/core/rendering/RenderObject.cpp ('k') | Source/core/rendering/RenderTheme.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1165 1165
1166 RenderTable* tableElt = table(); 1166 RenderTable* tableElt = table();
1167 if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstC hild()) 1167 if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstC hild())
1168 return; 1168 return;
1169 1169
1170 LayoutPoint adjustedPaintOffset = paintOffset; 1170 LayoutPoint adjustedPaintOffset = paintOffset;
1171 if (backgroundObject != this) 1171 if (backgroundObject != this)
1172 adjustedPaintOffset.moveBy(location()); 1172 adjustedPaintOffset.moveBy(location());
1173 1173
1174 Color c = backgroundObject->resolveColor(CSSPropertyBackgroundColor); 1174 Color c = backgroundObject->resolveColor(CSSPropertyBackgroundColor);
1175 const FillLayer* bgLayer = backgroundObject->style()->backgroundLayers(); 1175 const FillLayer& bgLayer = backgroundObject->style()->backgroundLayers();
1176 1176
1177 if (bgLayer->hasImage() || c.alpha()) { 1177 if (bgLayer.hasImage() || c.alpha()) {
1178 // We have to clip here because the background would paint 1178 // We have to clip here because the background would paint
1179 // on top of the borders otherwise. This only matters for cells and row s. 1179 // on top of the borders otherwise. This only matters for cells and row s.
1180 bool shouldClip = backgroundObject->hasLayer() && (backgroundObject == t his || backgroundObject == parent()) && tableElt->collapseBorders(); 1180 bool shouldClip = backgroundObject->hasLayer() && (backgroundObject == t his || backgroundObject == parent()) && tableElt->collapseBorders();
1181 GraphicsContextStateSaver stateSaver(*paintInfo.context, shouldClip); 1181 GraphicsContextStateSaver stateSaver(*paintInfo.context, shouldClip);
1182 if (shouldClip) { 1182 if (shouldClip) {
1183 LayoutRect clipRect(adjustedPaintOffset.x() + borderLeft(), adjusted PaintOffset.y() + borderTop(), 1183 LayoutRect clipRect(adjustedPaintOffset.x() + borderLeft(), adjusted PaintOffset.y() + borderTop(),
1184 width() - borderLeft() - borderRight(), height() - borderTop() - borderBottom()); 1184 width() - borderLeft() - borderRight(), height() - borderTop() - borderBottom());
1185 paintInfo.context->clip(clipRect); 1185 paintInfo.context->clip(clipRect);
1186 } 1186 }
1187 paintFillLayers(paintInfo, c, bgLayer, LayoutRect(adjustedPaintOffset, p ixelSnappedSize()), BackgroundBleedNone, CompositeSourceOver, backgroundObject); 1187 paintFillLayers(paintInfo, c, bgLayer, LayoutRect(adjustedPaintOffset, p ixelSnappedSize()), BackgroundBleedNone, CompositeSourceOver, backgroundObject);
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
1261 1261
1262 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const Render Object* parent) 1262 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const Render Object* parent)
1263 { 1263 {
1264 RenderTableCell* newCell = RenderTableCell::createAnonymous(&parent->documen t()); 1264 RenderTableCell* newCell = RenderTableCell::createAnonymous(&parent->documen t());
1265 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay( parent->style(), TABLE_CELL); 1265 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay( parent->style(), TABLE_CELL);
1266 newCell->setStyle(newStyle.release()); 1266 newCell->setStyle(newStyle.release());
1267 return newCell; 1267 return newCell;
1268 } 1268 }
1269 1269
1270 } // namespace WebCore 1270 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderObject.cpp ('k') | Source/core/rendering/RenderTheme.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698