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

Unified Diff: Source/core/rendering/RenderBlock.h

Issue 22463002: Optimize FloatIntervalSearchAdapter::collectIfNeeded (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased and merged. Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/rendering/RenderBlock.cpp » ('j') | Source/core/rendering/RenderBlock.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBlock.h
diff --git a/Source/core/rendering/RenderBlock.h b/Source/core/rendering/RenderBlock.h
index 06300e892bb4b4e7c19f4ab1b45816a955a21822..13e5649468123ba3cf425f4c98de15a6023be408 100644
--- a/Source/core/rendering/RenderBlock.h
+++ b/Source/core/rendering/RenderBlock.h
@@ -1168,19 +1168,19 @@ protected:
public:
typedef FloatingObjectInterval IntervalType;
- FloatIntervalSearchAdapter(const RenderBlock* renderer, int lowValue, int highValue, LayoutUnit& offset, LayoutUnit* heightRemaining)
+ FloatIntervalSearchAdapter(const RenderBlock* renderer, int lowValue, int highValue, LayoutUnit& offset)
: m_renderer(renderer)
, m_lowValue(lowValue)
, m_highValue(highValue)
, m_offset(offset)
- , m_heightRemaining(heightRemaining)
, m_last(0)
+ , m_floatForHeight(0)
{
}
inline int lowValue() const { return m_lowValue; }
inline int highValue() const { return m_highValue; }
- void collectIfNeeded(const IntervalType&) const;
+ void collectIfNeeded(const IntervalType&);
// When computing the offset caused by the floats on a given line, if
// the outermost float on that line has a shape-outside, the inline
@@ -1190,6 +1190,8 @@ protected:
// computed correctly by the code using this adapter.
const FloatingObject* lastFloat() const { return m_last; }
+ LayoutUnit getHeightRemaining() const;
+
private:
bool updateOffsetIfNeeded(const FloatingObject*) const;
@@ -1197,13 +1199,8 @@ protected:
int m_lowValue;
int m_highValue;
LayoutUnit& m_offset;
- LayoutUnit* m_heightRemaining;
- // This member variable is mutable because the collectIfNeeded method
- // is declared as const, even though it doesn't actually respect that
- // contract. It modifies other member variables via loopholes in the
- // const behavior. Instead of using loopholes, I decided it was better
- // to make the fact that this is modified in a const method explicit.
- mutable const FloatingObject* m_last;
+ const FloatingObject* m_last;
+ const FloatingObject* m_floatForHeight;
};
void createFloatingObjects();
« no previous file with comments | « no previous file | Source/core/rendering/RenderBlock.cpp » ('j') | Source/core/rendering/RenderBlock.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698