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

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

Issue 769093002: Remove FlowThreadController and relateds. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase master Created 6 years 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
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 13 matching lines...) Expand all
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
25 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 25 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
26 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE. 27 * SUCH DAMAGE.
28 */ 28 */
29 29
30 #include "config.h" 30 #include "config.h"
31 31
32 #include "core/rendering/RenderFlowThread.h" 32 #include "core/rendering/RenderFlowThread.h"
33 33
34 #include "core/rendering/FlowThreadController.h"
35 #include "core/rendering/PaintInfo.h" 34 #include "core/rendering/PaintInfo.h"
36 #include "core/rendering/RenderMultiColumnSet.h" 35 #include "core/rendering/RenderMultiColumnSet.h"
37 #include "core/rendering/RenderView.h" 36 #include "core/rendering/RenderView.h"
38 37
39 namespace blink { 38 namespace blink {
40 39
41 RenderFlowThread::RenderFlowThread() 40 RenderFlowThread::RenderFlowThread()
42 : RenderBlockFlow(0) 41 : RenderBlockFlow(0)
43 , m_regionsInvalidated(false) 42 , m_regionsInvalidated(false)
44 , m_regionsHaveUniformLogicalHeight(true) 43 , m_regionsHaveUniformLogicalHeight(true)
(...skipping 13 matching lines...) Expand all
58 if (m_regionsInvalidated) { 57 if (m_regionsInvalidated) {
59 ASSERT(selfNeedsLayout()); 58 ASSERT(selfNeedsLayout());
60 return; 59 return;
61 } 60 }
62 61
63 setNeedsLayoutAndFullPaintInvalidation(); 62 setNeedsLayoutAndFullPaintInvalidation();
64 63
65 m_regionsInvalidated = true; 64 m_regionsInvalidated = true;
66 } 65 }
67 66
68 class CurrentRenderFlowThreadDisabler {
69 WTF_MAKE_NONCOPYABLE(CurrentRenderFlowThreadDisabler);
70 public:
71 CurrentRenderFlowThreadDisabler(RenderView* view)
72 : m_view(view)
73 , m_renderFlowThread(0)
74 {
75 m_renderFlowThread = m_view->flowThreadController()->currentRenderFlowTh read();
76 if (m_renderFlowThread)
77 view->flowThreadController()->setCurrentRenderFlowThread(0);
78 }
79 ~CurrentRenderFlowThreadDisabler()
80 {
81 if (m_renderFlowThread)
82 m_view->flowThreadController()->setCurrentRenderFlowThread(m_renderF lowThread);
83 }
84 private:
85 RenderView* m_view;
86 RenderFlowThread* m_renderFlowThread;
87 };
88
89 void RenderFlowThread::validateRegions() 67 void RenderFlowThread::validateRegions()
90 { 68 {
91 if (m_regionsInvalidated) { 69 if (m_regionsInvalidated) {
92 m_regionsInvalidated = false; 70 m_regionsInvalidated = false;
93 m_regionsHaveUniformLogicalHeight = true; 71 m_regionsHaveUniformLogicalHeight = true;
94 72
95 if (hasRegions()) { 73 if (hasRegions()) {
96 LayoutUnit previousRegionLogicalHeight = 0; 74 LayoutUnit previousRegionLogicalHeight = 0;
97 bool firstRegionVisited = false; 75 bool firstRegionVisited = false;
98 76
(...skipping 20 matching lines...) Expand all
119 void RenderFlowThread::mapRectToPaintInvalidationBacking(const RenderLayerModelO bject* paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationStat e* paintInvalidationState) const 97 void RenderFlowThread::mapRectToPaintInvalidationBacking(const RenderLayerModelO bject* paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationStat e* paintInvalidationState) const
120 { 98 {
121 ASSERT(paintInvalidationContainer != this); // A flow thread should never be an invalidation container. 99 ASSERT(paintInvalidationContainer != this); // A flow thread should never be an invalidation container.
122 rect = fragmentsBoundingBox(rect); 100 rect = fragmentsBoundingBox(rect);
123 RenderBlockFlow::mapRectToPaintInvalidationBacking(paintInvalidationContaine r, rect, paintInvalidationState); 101 RenderBlockFlow::mapRectToPaintInvalidationBacking(paintInvalidationContaine r, rect, paintInvalidationState);
124 } 102 }
125 103
126 void RenderFlowThread::layout() 104 void RenderFlowThread::layout()
127 { 105 {
128 m_pageLogicalSizeChanged = m_regionsInvalidated && everHadLayout(); 106 m_pageLogicalSizeChanged = m_regionsInvalidated && everHadLayout();
129
130 CurrentRenderFlowThreadMaintainer currentFlowThreadSetter(this);
131 RenderBlockFlow::layout(); 107 RenderBlockFlow::layout();
132
133 m_pageLogicalSizeChanged = false; 108 m_pageLogicalSizeChanged = false;
134 } 109 }
135 110
136 void RenderFlowThread::computeLogicalHeight(LayoutUnit, LayoutUnit logicalTop, L ogicalExtentComputedValues& computedValues) const 111 void RenderFlowThread::computeLogicalHeight(LayoutUnit, LayoutUnit logicalTop, L ogicalExtentComputedValues& computedValues) const
137 { 112 {
138 computedValues.m_position = logicalTop; 113 computedValues.m_position = logicalTop;
139 computedValues.m_extent = 0; 114 computedValues.m_extent = 0;
140 115
141 for (RenderMultiColumnSetList::const_iterator iter = m_multiColumnSetList.be gin(); iter != m_multiColumnSetList.end(); ++iter) { 116 for (RenderMultiColumnSetList::const_iterator iter = m_multiColumnSetList.be gin(); iter != m_multiColumnSetList.end(); ++iter) {
142 RenderMultiColumnSet* columnSet = *iter; 117 RenderMultiColumnSet* columnSet = *iter;
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 } 322 }
348 323
349 void RenderFlowThread::RegionSearchAdapter::collectIfNeeded(const MultiColumnSet Interval& interval) 324 void RenderFlowThread::RegionSearchAdapter::collectIfNeeded(const MultiColumnSet Interval& interval)
350 { 325 {
351 if (m_result) 326 if (m_result)
352 return; 327 return;
353 if (interval.low() <= m_offset && interval.high() > m_offset) 328 if (interval.low() <= m_offset && interval.high() > m_offset)
354 m_result = interval.data(); 329 m_result = interval.data();
355 } 330 }
356 331
357 CurrentRenderFlowThreadMaintainer::CurrentRenderFlowThreadMaintainer(RenderFlowT hread* renderFlowThread)
358 : m_renderFlowThread(renderFlowThread)
359 , m_previousRenderFlowThread(0)
360 {
361 if (!m_renderFlowThread)
362 return;
363 RenderView* view = m_renderFlowThread->view();
364 m_previousRenderFlowThread = view->flowThreadController()->currentRenderFlow Thread();
365 view->flowThreadController()->setCurrentRenderFlowThread(m_renderFlowThread) ;
366 }
367
368 CurrentRenderFlowThreadMaintainer::~CurrentRenderFlowThreadMaintainer()
369 {
370 if (!m_renderFlowThread)
371 return;
372 RenderView* view = m_renderFlowThread->view();
373 ASSERT(view->flowThreadController()->currentRenderFlowThread() == m_renderFl owThread);
374 view->flowThreadController()->setCurrentRenderFlowThread(m_previousRenderFlo wThread);
375 }
376
377
378 } // namespace blink 332 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698