Changeset 95740 in webkit


Ignore:
Timestamp:
Sep 22, 2011 11:12:20 AM (13 years ago)
Author:
hyatt@apple.com
Message:

https://bugs.webkit.org/show_bug.cgi?id=68638

Make RenderFlowThread cache whether or not it has regions of varying widths. This will
be relevant for performance as we begin adding code to do custom block painting and
layout based off regions not having the same width.

Reviewed by Dan Bernstein and Adam Roben.

  • rendering/RenderFlowThread.cpp:

(WebCore::RenderFlowThread::RenderFlowThread):
(WebCore::RenderFlowThread::layout):

  • rendering/RenderFlowThread.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r95738 r95740  
     12011-09-22  David Hyatt  <hyatt@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=68638
     4       
     5        Make RenderFlowThread cache whether or not it has regions of varying widths. This will
     6        be relevant for performance as we begin adding code to do custom block painting and
     7        layout based off regions not having the same width.
     8
     9        Reviewed by Dan Bernstein and Adam Roben.
     10
     11        * rendering/RenderFlowThread.cpp:
     12        (WebCore::RenderFlowThread::RenderFlowThread):
     13        (WebCore::RenderFlowThread::layout):
     14        * rendering/RenderFlowThread.h:
     15
    1162011-09-22  Anders Carlsson  <andersca@apple.com>
    217
  • trunk/Source/WebCore/rendering/RenderFlowThread.cpp

    r95648 r95740  
    4848    , m_hasValidRegions(false)
    4949    , m_regionsInvalidated(false)
     50    , m_regionsHaveUniformLogicalWidth(true)
    5051    , m_regionFittingDisableCount(0)
    5152{
     
    304305    if (m_regionsInvalidated) {
    305306        m_regionsInvalidated = false;
     307        m_hasValidRegions = false;
     308        m_regionsHaveUniformLogicalWidth = true;
     309        LayoutUnit previousRegionLogicalWidth = 0;
    306310        if (hasRegions()) {
    307311            int logicalHeight = 0;
     
    314318                ASSERT(!region->needsLayout());
    315319               
    316                 m_hasValidRegions = true;
     320                LayoutUnit regionLogicalWidth;
    317321
    318322                IntRect regionRect;
     
    320324                    regionRect = IntRect(0, logicalHeight, region->contentWidth(), region->contentHeight());
    321325                    logicalHeight += regionRect.height();
     326                    regionLogicalWidth = region->contentWidth();
    322327                } else {
    323328                    regionRect = IntRect(logicalHeight, 0, region->contentWidth(), region->contentHeight());
    324329                    logicalHeight += regionRect.width();
     330                    regionLogicalWidth = region->contentHeight();
    325331                }
     332
     333                if (!m_hasValidRegions)
     334                    m_hasValidRegions = true;
     335                else if (m_regionsHaveUniformLogicalWidth && previousRegionLogicalWidth != regionLogicalWidth)
     336                    m_regionsHaveUniformLogicalWidth = false;
     337
     338                previousRegionLogicalWidth = regionLogicalWidth;
    326339
    327340                region->setRegionRect(regionRect);
  • trunk/Source/WebCore/rendering/RenderFlowThread.h

    r95264 r95740  
    106106    void enableRegionFitting() { ASSERT(m_regionFittingDisableCount > 0); m_regionFittingDisableCount--; }
    107107
     108    bool regionsHaveUniformLogicalWidth() const { return m_regionsHaveUniformLogicalWidth; }
     109   
    108110    RenderRegion* mapFromFlowToRegion(TransformState&) const;
    109111
     
    138140    bool m_hasValidRegions;
    139141    bool m_regionsInvalidated;
     142    bool m_regionsHaveUniformLogicalWidth;
    140143    unsigned m_regionFittingDisableCount;
    141144};
Note: See TracChangeset for help on using the changeset viewer.