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

Side by Side Diff: Source/core/layout/LayoutFlowThread.cpp

Issue 1265933002: Make LayoutFlowThread::fragmentsBoundingBox() faster. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Code review. 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 | « no previous file | Source/core/layout/LayoutMultiColumnSet.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 /* 1 /*
2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 LayoutMultiColumnSet* columnSet = *iter; 159 LayoutMultiColumnSet* columnSet = *iter;
160 columnSet->collectLayerFragments(layerFragments, layerBoundingBox, dirty RectInMulticolContainer); 160 columnSet->collectLayerFragments(layerFragments, layerBoundingBox, dirty RectInMulticolContainer);
161 } 161 }
162 } 162 }
163 163
164 LayoutRect LayoutFlowThread::fragmentsBoundingBox(const LayoutRect& layerBoundin gBox) const 164 LayoutRect LayoutFlowThread::fragmentsBoundingBox(const LayoutRect& layerBoundin gBox) const
165 { 165 {
166 ASSERT(!m_columnSetsInvalidated); 166 ASSERT(!m_columnSetsInvalidated);
167 167
168 LayoutRect result; 168 LayoutRect result;
169 for (auto* columnSet : m_multiColumnSetList) { 169 for (auto* columnSet : m_multiColumnSetList)
170 DeprecatedPaintLayerFragments fragments; 170 result.unite(columnSet->fragmentsBoundingBox(layerBoundingBox));
171 columnSet->collectLayerFragments(fragments, layerBoundingBox, LayoutRect (LayoutRect::infiniteIntRect()));
172 for (const auto& fragment : fragments) {
173 LayoutRect fragmentRect(layerBoundingBox);
174 fragmentRect.intersect(fragment.paginationClip);
175 fragmentRect.moveBy(fragment.paginationOffset);
176 result.unite(fragmentRect);
177 }
178 }
179 171
180 return result; 172 return result;
181 } 173 }
182 174
183 void LayoutFlowThread::MultiColumnSetSearchAdapter::collectIfNeeded(const MultiC olumnSetInterval& interval) 175 void LayoutFlowThread::MultiColumnSetSearchAdapter::collectIfNeeded(const MultiC olumnSetInterval& interval)
184 { 176 {
185 if (m_result) 177 if (m_result)
186 return; 178 return;
187 if (interval.low() <= m_offset && interval.high() > m_offset) 179 if (interval.low() <= m_offset && interval.high() > m_offset)
188 m_result = interval.data(); 180 m_result = interval.data();
189 } 181 }
190 182
191 } // namespace blink 183 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/layout/LayoutMultiColumnSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698