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

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

Issue 1306433002: Let collapsed border drawings be cacheable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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/TableCellPainter.cpp ('k') | Source/platform/graphics/paint/DisplayItem.h » ('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/TablePainter.h" 6 #include "core/paint/TablePainter.h"
7 7
8 #include "core/layout/LayoutTable.h" 8 #include "core/layout/LayoutTable.h"
9 #include "core/layout/LayoutTableSection.h" 9 #include "core/layout/LayoutTableSection.h"
10 #include "core/style/CollapsedBorderValue.h" 10 #include "core/style/CollapsedBorderValue.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } 47 }
48 } 48 }
49 49
50 if (m_layoutTable.collapseBorders() && paintPhase == PaintPhaseChildBlockBac kground && m_layoutTable.style()->visibility() == VISIBLE) { 50 if (m_layoutTable.collapseBorders() && paintPhase == PaintPhaseChildBlockBac kground && m_layoutTable.style()->visibility() == VISIBLE) {
51 // Using our cached sorted styles, we then do individual passes, 51 // Using our cached sorted styles, we then do individual passes,
52 // painting each style of border from lowest precedence to highest prece dence. 52 // painting each style of border from lowest precedence to highest prece dence.
53 info.phase = PaintPhaseCollapsedTableBorders; 53 info.phase = PaintPhaseCollapsedTableBorders;
54 LayoutTable::CollapsedBorderValues collapsedBorders = m_layoutTable.coll apsedBorders(); 54 LayoutTable::CollapsedBorderValues collapsedBorders = m_layoutTable.coll apsedBorders();
55 size_t count = collapsedBorders.size(); 55 size_t count = collapsedBorders.size();
56 for (size_t i = 0; i < count; ++i) { 56 for (size_t i = 0; i < count; ++i) {
57 ScopeRecorder scopeRecorder(*info.context);
58 // FIXME: pass this value into children rather than storing temporar ily on the LayoutTable object. 57 // FIXME: pass this value into children rather than storing temporar ily on the LayoutTable object.
59 m_layoutTable.setCurrentBorderValue(&collapsedBorders[i]); 58 m_layoutTable.setCurrentBorderValue(&collapsedBorders[i]);
60 for (LayoutTableSection* section = m_layoutTable.bottomSection(); se ction; section = m_layoutTable.sectionAbove(section)) { 59 for (LayoutTableSection* section = m_layoutTable.bottomSection(); se ction; section = m_layoutTable.sectionAbove(section)) {
61 LayoutPoint childPoint = m_layoutTable.flipForWritingModeForChil d(section, paintOffset); 60 LayoutPoint childPoint = m_layoutTable.flipForWritingModeForChil d(section, paintOffset);
62 section->paint(info, childPoint); 61 section->paint(info, childPoint);
63 } 62 }
64 } 63 }
65 m_layoutTable.setCurrentBorderValue(0); 64 m_layoutTable.setCurrentBorderValue(0);
66 } 65 }
67 66
(...skipping 23 matching lines...) Expand all
91 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.conte xt, m_layoutTable, paintInfo.phase)) 90 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.conte xt, m_layoutTable, paintInfo.phase))
92 return; 91 return;
93 92
94 LayoutRect rect(paintOffset, m_layoutTable.size()); 93 LayoutRect rect(paintOffset, m_layoutTable.size());
95 m_layoutTable.subtractCaptionRect(rect); 94 m_layoutTable.subtractCaptionRect(rect);
96 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutTable, pain tInfo.phase, pixelSnappedIntRect(rect)); 95 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutTable, pain tInfo.phase, pixelSnappedIntRect(rect));
97 BoxPainter(m_layoutTable).paintMaskImages(paintInfo, rect); 96 BoxPainter(m_layoutTable).paintMaskImages(paintInfo, rect);
98 } 97 }
99 98
100 } // namespace blink 99 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/TableCellPainter.cpp ('k') | Source/platform/graphics/paint/DisplayItem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698