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

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

Issue 724483002: Move painting code from RenderTableCell to TableCellPainter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/paint/TableCellPainter.cpp ('k') | Source/core/paint/TableSectionPainter.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 // 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/TableRowPainter.h" 6 #include "core/paint/TableRowPainter.h"
7 7
8 #include "core/paint/ObjectPainter.h" 8 #include "core/paint/ObjectPainter.h"
9 #include "core/paint/TableCellPainter.h"
9 #include "core/rendering/GraphicsContextAnnotator.h" 10 #include "core/rendering/GraphicsContextAnnotator.h"
10 #include "core/rendering/PaintInfo.h" 11 #include "core/rendering/PaintInfo.h"
11 #include "core/rendering/RenderTableCell.h" 12 #include "core/rendering/RenderTableCell.h"
12 #include "core/rendering/RenderTableRow.h" 13 #include "core/rendering/RenderTableRow.h"
13 14
14 namespace blink { 15 namespace blink {
15 16
16 void TableRowPainter::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset ) 17 void TableRowPainter::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset )
17 { 18 {
18 ASSERT(m_renderTableRow.hasSelfPaintingLayer()); 19 ASSERT(m_renderTableRow.hasSelfPaintingLayer());
19 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, &m_renderTableRow); 20 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, &m_renderTableRow);
20 21
21 paintOutlineForRowIfNeeded(paintInfo, paintOffset); 22 paintOutlineForRowIfNeeded(paintInfo, paintOffset);
22 for (RenderTableCell* cell = m_renderTableRow.firstCell(); cell; cell = cell ->nextCell()) { 23 for (RenderTableCell* cell = m_renderTableRow.firstCell(); cell; cell = cell ->nextCell()) {
23 // Paint the row background behind the cell. 24 // Paint the row background behind the cell.
24 if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == P aintPhaseChildBlockBackground) 25 if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == P aintPhaseChildBlockBackground)
25 cell->paintBackgroundsBehindCell(paintInfo, paintOffset, &m_renderTa bleRow); 26 TableCellPainter(*cell).paintBackgroundsBehindCell(paintInfo, paintO ffset, &m_renderTableRow);
26 if (!cell->hasSelfPaintingLayer()) 27 if (!cell->hasSelfPaintingLayer())
27 cell->paint(paintInfo, paintOffset); 28 cell->paint(paintInfo, paintOffset);
28 } 29 }
29 } 30 }
30 31
31 void TableRowPainter::paintOutlineForRowIfNeeded(PaintInfo& paintInfo, const Lay outPoint& paintOffset) 32 void TableRowPainter::paintOutlineForRowIfNeeded(PaintInfo& paintInfo, const Lay outPoint& paintOffset)
32 { 33 {
33 LayoutPoint adjustedPaintOffset = paintOffset + m_renderTableRow.location(); 34 LayoutPoint adjustedPaintOffset = paintOffset + m_renderTableRow.location();
34 PaintPhase paintPhase = paintInfo.phase; 35 PaintPhase paintPhase = paintInfo.phase;
35 if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline) && m_renderTableRow.style()->visibility() == VISIBLE) 36 if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline) && m_renderTableRow.style()->visibility() == VISIBLE)
36 ObjectPainter(m_renderTableRow).paintOutline(paintInfo, LayoutRect(adjus tedPaintOffset, m_renderTableRow.size())); 37 ObjectPainter(m_renderTableRow).paintOutline(paintInfo, LayoutRect(adjus tedPaintOffset, m_renderTableRow.size()));
37 } 38 }
38 39
39 } // namespace blink 40 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/TableCellPainter.cpp ('k') | Source/core/paint/TableSectionPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698