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

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

Issue 164553004: Convert LayoutState/LayoutStateMaintainer/LayoutStateDisabler to references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 10 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 return false; 204 return false;
205 205
206 return true; 206 return true;
207 } 207 }
208 208
209 void RenderFlowThread::repaintRectangleInRegions(const LayoutRect& repaintRect) const 209 void RenderFlowThread::repaintRectangleInRegions(const LayoutRect& repaintRect) const
210 { 210 {
211 if (!shouldRepaint(repaintRect) || !hasValidRegionInfo()) 211 if (!shouldRepaint(repaintRect) || !hasValidRegionInfo())
212 return; 212 return;
213 213
214 LayoutStateDisabler layoutStateDisabler(view()); // We can't use layout stat e to repaint, since the regions are somewhere else. 214 LayoutStateDisabler layoutStateDisabler(*this); // We can't use layout state to repaint, since the regions are somewhere else.
215 215
216 // We can't use currentFlowThread as it is possible to have interleaved flow threads and the wrong one could be used. 216 // We can't use currentFlowThread as it is possible to have interleaved flow threads and the wrong one could be used.
217 // Let each region figure out the proper enclosing flow thread. 217 // Let each region figure out the proper enclosing flow thread.
218 CurrentRenderFlowThreadDisabler disabler(view()); 218 CurrentRenderFlowThreadDisabler disabler(view());
219 219
220 for (RenderRegionList::const_iterator iter = m_regionList.begin(); iter != m _regionList.end(); ++iter) { 220 for (RenderRegionList::const_iterator iter = m_regionList.begin(); iter != m _regionList.end(); ++iter) {
221 RenderRegion* region = *iter; 221 RenderRegion* region = *iter;
222 222
223 region->repaintFlowThreadContent(repaintRect); 223 region->repaintFlowThreadContent(repaintRect);
224 } 224 }
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 559
560 const RenderBox* RenderFlowThread::currentStatePusherRenderBox() const 560 const RenderBox* RenderFlowThread::currentStatePusherRenderBox() const
561 { 561 {
562 const RenderObject* currentObject = m_statePusherObjectsStack.isEmpty() ? 0 : m_statePusherObjectsStack.last(); 562 const RenderObject* currentObject = m_statePusherObjectsStack.isEmpty() ? 0 : m_statePusherObjectsStack.last();
563 if (currentObject && currentObject->isBox()) 563 if (currentObject && currentObject->isBox())
564 return toRenderBox(currentObject); 564 return toRenderBox(currentObject);
565 565
566 return 0; 566 return 0;
567 } 567 }
568 568
569 void RenderFlowThread::pushFlowThreadLayoutState(const RenderObject* object) 569 void RenderFlowThread::pushFlowThreadLayoutState(const RenderObject& object)
570 { 570 {
571 if (const RenderBox* currentBoxDescendant = currentStatePusherRenderBox()) { 571 if (const RenderBox* currentBoxDescendant = currentStatePusherRenderBox()) {
572 LayoutState* layoutState = currentBoxDescendant->view()->layoutState(); 572 LayoutState* layoutState = currentBoxDescendant->view()->layoutState();
573 if (layoutState && layoutState->isPaginated()) { 573 if (layoutState && layoutState->isPaginated()) {
574 ASSERT(layoutState->renderer() == currentBoxDescendant); 574 ASSERT(layoutState->renderer() == currentBoxDescendant);
575 LayoutSize offsetDelta = layoutState->m_layoutOffset - layoutState-> m_pageOffset; 575 LayoutSize offsetDelta = layoutState->m_layoutOffset - layoutState-> m_pageOffset;
576 setOffsetFromLogicalTopOfFirstRegion(currentBoxDescendant, currentBo xDescendant->isHorizontalWritingMode() ? offsetDelta.height() : offsetDelta.widt h()); 576 setOffsetFromLogicalTopOfFirstRegion(currentBoxDescendant, currentBo xDescendant->isHorizontalWritingMode() ? offsetDelta.height() : offsetDelta.widt h());
577 } 577 }
578 } 578 }
579 579
580 m_statePusherObjectsStack.add(object); 580 m_statePusherObjectsStack.add(&object);
581 } 581 }
582 582
583 void RenderFlowThread::popFlowThreadLayoutState() 583 void RenderFlowThread::popFlowThreadLayoutState()
584 { 584 {
585 m_statePusherObjectsStack.removeLast(); 585 m_statePusherObjectsStack.removeLast();
586 586
587 if (const RenderBox* currentBoxDescendant = currentStatePusherRenderBox()) { 587 if (const RenderBox* currentBoxDescendant = currentStatePusherRenderBox()) {
588 LayoutState* layoutState = currentBoxDescendant->view()->layoutState(); 588 LayoutState* layoutState = currentBoxDescendant->view()->layoutState();
589 if (layoutState && layoutState->isPaginated()) 589 if (layoutState && layoutState->isPaginated())
590 clearOffsetFromLogicalTopOfFirstRegion(currentBoxDescendant); 590 clearOffsetFromLogicalTopOfFirstRegion(currentBoxDescendant);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 { 670 {
671 if (!m_renderFlowThread) 671 if (!m_renderFlowThread)
672 return; 672 return;
673 RenderView* view = m_renderFlowThread->view(); 673 RenderView* view = m_renderFlowThread->view();
674 ASSERT(view->flowThreadController()->currentRenderFlowThread() == m_renderFl owThread); 674 ASSERT(view->flowThreadController()->currentRenderFlowThread() == m_renderFl owThread);
675 view->flowThreadController()->setCurrentRenderFlowThread(m_previousRenderFlo wThread); 675 view->flowThreadController()->setCurrentRenderFlowThread(m_previousRenderFlo wThread);
676 } 676 }
677 677
678 678
679 } // namespace WebCore 679 } // namespace WebCore
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