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

Unified Diff: Source/core/frame/FrameView.h

Issue 351673007: Move paint invalidation after compositing update (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: New approach that should work, added a test based on Adam's review Created 6 years, 6 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
Index: Source/core/frame/FrameView.h
diff --git a/Source/core/frame/FrameView.h b/Source/core/frame/FrameView.h
index 4d04b781ab55040c9b9ac19c029117eb277799c0..be9b4e8391ef0b1a6ced64868239b56c57e7d4f4 100644
--- a/Source/core/frame/FrameView.h
+++ b/Source/core/frame/FrameView.h
@@ -96,8 +96,8 @@ public:
bool canInvalidatePaintDuringPerformLayout() const { return m_canInvalidatePaintDuringPerformLayout; }
RenderObject* layoutRoot(bool onlyDuringLayout = false) const;
- void clearLayoutSubtreeRoot() { m_layoutSubtreeRoot = 0; }
int layoutCount() const { return m_layoutCount; }
+ void rendererWillBeDestroyed(RenderObject*);
bool needsLayout() const;
void setNeedsLayout();
@@ -219,6 +219,8 @@ public:
void updateLayoutAndStyleForPainting();
void updateLayoutAndStyleIfNeededRecursive();
+ void invalidateTreeIfNeededRecursive();
+
void incrementVisuallyNonEmptyCharacterCount(unsigned);
void incrementVisuallyNonEmptyPixelCount(const IntSize&);
void setIsVisuallyNonEmpty() { m_isVisuallyNonEmpty = true; }
@@ -361,7 +363,7 @@ private:
void scheduleOrPerformPostLayoutTasks();
void performPostLayoutTasks();
- void invalidateTree(RenderObject* root);
+ void invalidateTreeIfNeeded();
void gatherDebugLayoutRects(RenderObject* layoutRoot);
@@ -436,6 +438,13 @@ private:
bool m_hasPendingLayout;
RenderObject* m_layoutSubtreeRoot;
+ // These are copies of the layout roots so that we can
+ // generate invalidations in their own phase. While the
+ // HashSet could potentially yield to unbounded memory,
+ // most layouts share a limited number of layout roots
+ // (6 at most in LayoutTests/fast/).
+ HashSet<RenderObject*> m_paintInvalidationSubtreeRoots;
+
bool m_layoutSchedulingEnabled;
bool m_inPerformLayout;
bool m_canInvalidatePaintDuringPerformLayout;

Powered by Google App Engine
This is Rietveld 408576698