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

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

Issue 379073002: Revert of Divorce PaintInvalidationState from LayoutState (https://codereview.chromium.org/36083300… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Correct revert order Created 6 years, 5 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 | « Source/core/rendering/RenderText.cpp ('k') | Source/core/rendering/RenderView.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderView.h
diff --git a/Source/core/rendering/RenderView.h b/Source/core/rendering/RenderView.h
index 45dd83bf858376b8ef62226559cb3e8c2eb07149..fa092aaac7850054477389005e09dddbf249f771 100644
--- a/Source/core/rendering/RenderView.h
+++ b/Source/core/rendering/RenderView.h
@@ -24,7 +24,6 @@
#include "core/frame/FrameView.h"
#include "core/rendering/LayoutState.h"
-#include "core/rendering/PaintInvalidationState.h"
#include "core/rendering/RenderBlockFlow.h"
#include "platform/PODFreeListArena.h"
#include "platform/scroll/ScrollableArea.h"
@@ -79,7 +78,7 @@ public:
FrameView* frameView() const { return m_frameView; }
- virtual void mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect&, bool fixed = false, const PaintInvalidationState* = 0) const OVERRIDE;
+ virtual void mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect&, bool fixed = false) const OVERRIDE;
void repaintViewRectangle(const LayoutRect&) const;
void repaintViewAndCompositedLayers();
@@ -105,8 +104,16 @@ public:
bool shouldDoFullRepaintForNextLayout() const;
bool doingFullRepaint() const { return m_frameView->needsFullPaintInvalidation(); }
+ // Returns true if layoutState should be used for its cached offset and clip.
+ bool layoutStateCachedOffsetsEnabled() const { return m_layoutState && m_layoutState->cachedOffsetsEnabled(); }
LayoutState* layoutState() const { return m_layoutState; }
+ bool canMapUsingLayoutStateForContainer(const RenderObject* repaintContainer) const
+ {
+ // FIXME: LayoutState should be enabled for other repaint containers than the RenderView. crbug.com/363834
+ return layoutStateCachedOffsetsEnabled() && (repaintContainer == this);
+ }
+
virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&) OVERRIDE;
LayoutUnit pageLogicalHeight() const { return m_pageLogicalHeight; }
@@ -157,12 +164,12 @@ public:
void popLayoutState();
private:
- virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = 0, const PaintInvalidationState* = 0) const OVERRIDE;
+ virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = 0) const OVERRIDE;
virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const OVERRIDE;
virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) const OVERRIDE;
virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOffset) const OVERRIDE;
- virtual void invalidateTreeAfterLayout(const PaintInvalidationState&) OVERRIDE FINAL;
+ virtual void invalidateTreeAfterLayout(const RenderLayerModelObject& paintInvalidationContainer) OVERRIDE FINAL;
bool shouldRepaint(const LayoutRect&) const;
@@ -213,22 +220,29 @@ DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderView, isRenderView());
class ForceHorriblySlowRectMapping {
WTF_MAKE_NONCOPYABLE(ForceHorriblySlowRectMapping);
public:
- ForceHorriblySlowRectMapping(const PaintInvalidationState* paintInvalidationState)
- : m_paintInvalidationState(paintInvalidationState)
- , m_didDisable(m_paintInvalidationState && m_paintInvalidationState->cachedOffsetsEnabled())
+ ForceHorriblySlowRectMapping(const RenderObject& root)
+ : m_view(*root.view())
+ , m_didDisable(m_view.layoutState() && m_view.layoutState()->cachedOffsetsEnabled())
{
- if (m_paintInvalidationState)
- m_paintInvalidationState->m_cachedOffsetsEnabled = false;
+ if (m_view.layoutState())
+ m_view.layoutState()->m_cachedOffsetsEnabled = false;
+#if ASSERT_ENABLED
+ m_layoutState = m_view.layoutState();
+#endif
}
~ForceHorriblySlowRectMapping()
{
+ ASSERT(m_view.layoutState() == m_layoutState);
if (m_didDisable)
- m_paintInvalidationState->m_cachedOffsetsEnabled = true;
+ m_view.layoutState()->m_cachedOffsetsEnabled = true;
}
private:
- const PaintInvalidationState* m_paintInvalidationState;
+ RenderView& m_view;
bool m_didDisable;
+#if ASSERT_ENABLED
+ LayoutState* m_layoutState;
+#endif
};
} // namespace WebCore
« no previous file with comments | « Source/core/rendering/RenderText.cpp ('k') | Source/core/rendering/RenderView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698