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

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

Issue 550363004: Factor painting code out of RenderBox into a new class called BoxPainter. (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/rendering/RenderObject.cpp ('k') | Source/core/rendering/RenderTableCell.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, 2010, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved.
8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 12 matching lines...) Expand all
23 * Boston, MA 02110-1301, USA. 23 * Boston, MA 02110-1301, USA.
24 */ 24 */
25 25
26 #include "config.h" 26 #include "config.h"
27 #include "core/rendering/RenderTable.h" 27 #include "core/rendering/RenderTable.h"
28 28
29 #include "core/HTMLNames.h" 29 #include "core/HTMLNames.h"
30 #include "core/dom/Document.h" 30 #include "core/dom/Document.h"
31 #include "core/frame/FrameView.h" 31 #include "core/frame/FrameView.h"
32 #include "core/html/HTMLTableElement.h" 32 #include "core/html/HTMLTableElement.h"
33 #include "core/paint/BoxPainter.h"
33 #include "core/rendering/AutoTableLayout.h" 34 #include "core/rendering/AutoTableLayout.h"
34 #include "core/rendering/FixedTableLayout.h" 35 #include "core/rendering/FixedTableLayout.h"
35 #include "core/rendering/GraphicsContextAnnotator.h" 36 #include "core/rendering/GraphicsContextAnnotator.h"
36 #include "core/rendering/HitTestResult.h" 37 #include "core/rendering/HitTestResult.h"
37 #include "core/rendering/RenderLayer.h" 38 #include "core/rendering/RenderLayer.h"
38 #include "core/rendering/RenderTableCaption.h" 39 #include "core/rendering/RenderTableCaption.h"
39 #include "core/rendering/RenderTableCell.h" 40 #include "core/rendering/RenderTableCell.h"
40 #include "core/rendering/RenderTableCol.h" 41 #include "core/rendering/RenderTableCol.h"
41 #include "core/rendering/RenderTableSection.h" 42 #include "core/rendering/RenderTableSection.h"
42 #include "core/rendering/RenderView.h" 43 #include "core/rendering/RenderView.h"
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 } 703 }
703 } 704 }
704 705
705 void RenderTable::paintBoxDecorationBackground(PaintInfo& paintInfo, const Layou tPoint& paintOffset) 706 void RenderTable::paintBoxDecorationBackground(PaintInfo& paintInfo, const Layou tPoint& paintOffset)
706 { 707 {
707 if (!paintInfo.shouldPaintWithinRoot(this)) 708 if (!paintInfo.shouldPaintWithinRoot(this))
708 return; 709 return;
709 710
710 LayoutRect rect(paintOffset, size()); 711 LayoutRect rect(paintOffset, size());
711 subtractCaptionRect(rect); 712 subtractCaptionRect(rect);
712 paintBoxDecorationBackgroundWithRect(paintInfo, paintOffset, rect); 713 BoxPainter(*this).paintBoxDecorationBackgroundWithRect(paintInfo, paintOffse t, rect);
713 } 714 }
714 715
715 void RenderTable::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset ) 716 void RenderTable::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset )
716 { 717 {
717 if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask) 718 if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
718 return; 719 return;
719 720
720 LayoutRect rect(paintOffset, size()); 721 LayoutRect rect(paintOffset, size());
721 subtractCaptionRect(rect); 722 subtractCaptionRect(rect);
722 723
723 paintMaskImages(paintInfo, rect); 724 BoxPainter(*this).paintMaskImages(paintInfo, rect);
724 } 725 }
725 726
726 void RenderTable::computeIntrinsicLogicalWidths(LayoutUnit& minWidth, LayoutUnit & maxWidth) const 727 void RenderTable::computeIntrinsicLogicalWidths(LayoutUnit& minWidth, LayoutUnit & maxWidth) const
727 { 728 {
728 recalcSectionsIfNeeded(); 729 recalcSectionsIfNeeded();
729 // FIXME: Do the recalc in borderStart/borderEnd and make those const_cast t his call. 730 // FIXME: Do the recalc in borderStart/borderEnd and make those const_cast t his call.
730 // Then m_borderStart/m_borderEnd will be transparent a cache and it removes the possibility 731 // Then m_borderStart/m_borderEnd will be transparent a cache and it removes the possibility
731 // of reading out stale values. 732 // of reading out stale values.
732 const_cast<RenderTable*>(this)->recalcBordersInRowDirection(); 733 const_cast<RenderTable*>(this)->recalcBordersInRowDirection();
733 // FIXME: Restructure the table layout code so that we can make this method const. 734 // FIXME: Restructure the table layout code so that we can make this method const.
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
1417 const BorderValue& RenderTable::tableEndBorderAdjoiningCell(const RenderTableCel l* cell) const 1418 const BorderValue& RenderTable::tableEndBorderAdjoiningCell(const RenderTableCel l* cell) const
1418 { 1419 {
1419 ASSERT(cell->isFirstOrLastCellInRow()); 1420 ASSERT(cell->isFirstOrLastCellInRow());
1420 if (hasSameDirectionAs(cell->row())) 1421 if (hasSameDirectionAs(cell->row()))
1421 return style()->borderEnd(); 1422 return style()->borderEnd();
1422 1423
1423 return style()->borderStart(); 1424 return style()->borderStart();
1424 } 1425 }
1425 1426
1426 } 1427 }
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderObject.cpp ('k') | Source/core/rendering/RenderTableCell.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698