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

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

Issue 1144203009: Strengthen the LayoutGrid dirtiness asserts. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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
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/GridPainter.h" 6 #include "core/paint/GridPainter.h"
7 7
8 #include "core/layout/LayoutGrid.h" 8 #include "core/layout/LayoutGrid.h"
9 #include "core/paint/BlockPainter.h" 9 #include "core/paint/BlockPainter.h"
10 #include "core/paint/PaintInfo.h" 10 #include "core/paint/PaintInfo.h"
(...skipping 23 matching lines...) Expand all
34 if (firstChild.first->style()->order() != secondChild.first->style()->or der()) 34 if (firstChild.first->style()->order() != secondChild.first->style()->or der())
35 return firstChild.first->style()->order() < secondChild.first->style ()->order(); 35 return firstChild.first->style()->order() < secondChild.first->style ()->order();
36 36
37 return firstChild.second < secondChild.second; 37 return firstChild.second < secondChild.second;
38 } 38 }
39 }; 39 };
40 40
41 void GridPainter::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& p aintOffset) 41 void GridPainter::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& p aintOffset)
42 { 42 {
43 ASSERT(!m_layoutGrid.needsLayout()); 43 ASSERT(!m_layoutGrid.needsLayout());
44 ASSERT_WITH_SECURITY_IMPLICATION(!m_layoutGrid.gridIsDirty());
45 44
46 LayoutRect localPaintInvalidationRect = LayoutRect(paintInfo.rect); 45 LayoutRect localPaintInvalidationRect = LayoutRect(paintInfo.rect);
47 localPaintInvalidationRect.moveBy(-paintOffset); 46 localPaintInvalidationRect.moveBy(-paintOffset);
48 47
49 GridSpan dirtiedColumns = dirtiedGridAreas(m_layoutGrid.columnPositions(), l ocalPaintInvalidationRect.x(), localPaintInvalidationRect.maxX()); 48 GridSpan dirtiedColumns = dirtiedGridAreas(m_layoutGrid.columnPositions(), l ocalPaintInvalidationRect.x(), localPaintInvalidationRect.maxX());
50 GridSpan dirtiedRows = dirtiedGridAreas(m_layoutGrid.rowPositions(), localPa intInvalidationRect.y(), localPaintInvalidationRect.maxY()); 49 GridSpan dirtiedRows = dirtiedGridAreas(m_layoutGrid.rowPositions(), localPa intInvalidationRect.y(), localPaintInvalidationRect.maxY());
51 50
52 Vector<std::pair<LayoutBox*, size_t>> gridItemsToBePainted; 51 Vector<std::pair<LayoutBox*, size_t>> gridItemsToBePainted;
53 52
54 for (GridSpan::iterator row = dirtiedRows.begin(); row != dirtiedRows.end(); ++row) { 53 for (GridSpan::iterator row = dirtiedRows.begin(); row != dirtiedRows.end(); ++row) {
(...skipping 20 matching lines...) Expand all
75 LayoutBox* current = gridItemAndPaintIndex.first; 74 LayoutBox* current = gridItemAndPaintIndex.first;
76 if (current == previous) 75 if (current == previous)
77 continue; 76 continue;
78 77
79 BlockPainter(m_layoutGrid).paintChildAsInlineBlock(*current, paintInfo, paintOffset); 78 BlockPainter(m_layoutGrid).paintChildAsInlineBlock(*current, paintInfo, paintOffset);
80 previous = current; 79 previous = current;
81 } 80 }
82 } 81 }
83 82
84 } // namespace blink 83 } // namespace blink
OLDNEW
« Source/core/layout/LayoutGrid.cpp ('K') | « Source/core/layout/LayoutGrid.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698