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

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

Issue 481333005: Remove column set range map from RenderFlowThread. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
« no previous file with comments | « Source/core/rendering/RenderFlowThread.h ('k') | Source/core/rendering/RenderGrid.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) 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 m_multiColumnSetList.remove(columnSet); 59 m_multiColumnSetList.remove(columnSet);
60 } 60 }
61 61
62 void RenderFlowThread::invalidateRegions() 62 void RenderFlowThread::invalidateRegions()
63 { 63 {
64 if (m_regionsInvalidated) { 64 if (m_regionsInvalidated) {
65 ASSERT(selfNeedsLayout()); 65 ASSERT(selfNeedsLayout());
66 return; 66 return;
67 } 67 }
68 68
69 m_multiColumnSetRangeMap.clear();
70 setNeedsLayoutAndFullPaintInvalidation(); 69 setNeedsLayoutAndFullPaintInvalidation();
71 70
72 m_regionsInvalidated = true; 71 m_regionsInvalidated = true;
73 } 72 }
74 73
75 class CurrentRenderFlowThreadDisabler { 74 class CurrentRenderFlowThreadDisabler {
76 WTF_MAKE_NONCOPYABLE(CurrentRenderFlowThreadDisabler); 75 WTF_MAKE_NONCOPYABLE(CurrentRenderFlowThreadDisabler);
77 public: 76 public:
78 CurrentRenderFlowThreadDisabler(RenderView* view) 77 CurrentRenderFlowThreadDisabler(RenderView* view)
79 : m_view(view) 78 : m_view(view)
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 return m_multiColumnSetList.first(); 208 return m_multiColumnSetList.first();
210 } 209 }
211 210
212 RenderRegion* RenderFlowThread::lastRegion() const 211 RenderRegion* RenderFlowThread::lastRegion() const
213 { 212 {
214 if (!hasValidRegionInfo()) 213 if (!hasValidRegionInfo())
215 return 0; 214 return 0;
216 return m_multiColumnSetList.last(); 215 return m_multiColumnSetList.last();
217 } 216 }
218 217
219 void RenderFlowThread::setRegionRangeForBox(const RenderBox* box, LayoutUnit off setFromLogicalTopOfFirstPage)
220 {
221 if (!hasRegions())
222 return;
223
224 // FIXME: Not right for differing writing-modes.
225 RenderMultiColumnSet* startColumnSet = columnSetAtBlockOffset(offsetFromLogi calTopOfFirstPage);
226 RenderMultiColumnSet* endColumnSet = columnSetAtBlockOffset(offsetFromLogica lTopOfFirstPage + box->logicalHeight());
227 RenderMultiColumnSetRangeMap::iterator it = m_multiColumnSetRangeMap.find(bo x);
228 if (it == m_multiColumnSetRangeMap.end()) {
229 m_multiColumnSetRangeMap.set(box, RenderMultiColumnSetRange(startColumnS et, endColumnSet));
230 return;
231 }
232
233 // If nothing changed, just bail.
234 RenderMultiColumnSetRange& range = it->value;
235 if (range.startColumnSet() == startColumnSet && range.endColumnSet() == endC olumnSet)
236 return;
237
238 range.setRange(startColumnSet, endColumnSet);
239 }
240
241 void RenderFlowThread::getRegionRangeForBox(const RenderBox* box, RenderMultiCol umnSet*& startColumnSet, RenderMultiColumnSet*& endColumnSet) const
242 {
243 startColumnSet = 0;
244 endColumnSet = 0;
245 RenderMultiColumnSetRangeMap::const_iterator it = m_multiColumnSetRangeMap.f ind(box);
246 if (it == m_multiColumnSetRangeMap.end())
247 return;
248
249 const RenderMultiColumnSetRange& range = it->value;
250 startColumnSet = range.startColumnSet();
251 endColumnSet = range.endColumnSet();
252 ASSERT(m_multiColumnSetList.contains(startColumnSet) && m_multiColumnSetList .contains(endColumnSet));
253 }
254
255 void RenderFlowThread::updateRegionsFlowThreadPortionRect() 218 void RenderFlowThread::updateRegionsFlowThreadPortionRect()
256 { 219 {
257 LayoutUnit logicalHeight = 0; 220 LayoutUnit logicalHeight = 0;
258 // FIXME: Optimize not to clear the interval all the time. This implies manu ally managing the tree nodes lifecycle. 221 // FIXME: Optimize not to clear the interval all the time. This implies manu ally managing the tree nodes lifecycle.
259 m_multiColumnSetIntervalTree.clear(); 222 m_multiColumnSetIntervalTree.clear();
260 m_multiColumnSetIntervalTree.initIfNeeded(); 223 m_multiColumnSetIntervalTree.initIfNeeded();
261 for (RenderMultiColumnSetList::iterator iter = m_multiColumnSetList.begin(); iter != m_multiColumnSetList.end(); ++iter) { 224 for (RenderMultiColumnSetList::iterator iter = m_multiColumnSetList.begin(); iter != m_multiColumnSetList.end(); ++iter) {
262 RenderMultiColumnSet* columnSet = *iter; 225 RenderMultiColumnSet* columnSet = *iter;
263 226
264 LayoutUnit columnSetLogicalWidth = columnSet->pageLogicalWidth(); 227 LayoutUnit columnSetLogicalWidth = columnSet->pageLogicalWidth();
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 { 391 {
429 if (!m_renderFlowThread) 392 if (!m_renderFlowThread)
430 return; 393 return;
431 RenderView* view = m_renderFlowThread->view(); 394 RenderView* view = m_renderFlowThread->view();
432 ASSERT(view->flowThreadController()->currentRenderFlowThread() == m_renderFl owThread); 395 ASSERT(view->flowThreadController()->currentRenderFlowThread() == m_renderFl owThread);
433 view->flowThreadController()->setCurrentRenderFlowThread(m_previousRenderFlo wThread); 396 view->flowThreadController()->setCurrentRenderFlowThread(m_previousRenderFlo wThread);
434 } 397 }
435 398
436 399
437 } // namespace blink 400 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderFlowThread.h ('k') | Source/core/rendering/RenderGrid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698