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

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

Issue 576823004: Move painting code for tables into *Paint classes. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix 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
« no previous file with comments | « Source/core/paint/TableRowPainter.h ('k') | Source/core/paint/TableSectionPainter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "core/paint/TableRowPainter.h"
7
8 #include "core/rendering/GraphicsContextAnnotator.h"
9 #include "core/rendering/PaintInfo.h"
10 #include "core/rendering/RenderTableCell.h"
11 #include "core/rendering/RenderTableRow.h"
12
13 namespace blink {
14
15 void TableRowPainter::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset )
16 {
17 ASSERT(m_renderTableRow.hasSelfPaintingLayer());
18 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, &m_renderTableRow);
19
20 paintOutlineForRowIfNeeded(paintInfo, paintOffset);
21 for (RenderTableCell* cell = m_renderTableRow.firstCell(); cell; cell = cell ->nextCell()) {
22 // Paint the row background behind the cell.
23 if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == P aintPhaseChildBlockBackground)
24 cell->paintBackgroundsBehindCell(paintInfo, paintOffset, &m_renderTa bleRow);
25 if (!cell->hasSelfPaintingLayer())
26 cell->paint(paintInfo, paintOffset);
27 }
28 }
29
30 void TableRowPainter::paintOutlineForRowIfNeeded(PaintInfo& paintInfo, const Lay outPoint& paintOffset)
31 {
32 LayoutPoint adjustedPaintOffset = paintOffset + m_renderTableRow.location();
33 PaintPhase paintPhase = paintInfo.phase;
34 if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline) && m_renderTableRow.style()->visibility() == VISIBLE)
35 m_renderTableRow.paintOutline(paintInfo, LayoutRect(adjustedPaintOffset, m_renderTableRow.size()));
36 }
37
38 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/TableRowPainter.h ('k') | Source/core/paint/TableSectionPainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698